OSDN Git Service

Fix 6 undefined variables.
authorshizuki <shizuki@1ca29b6e-896d-4ea0-84a5-967f57386b96>
Sat, 28 Feb 2009 15:20:07 +0000 (15:20 +0000)
committershizuki <shizuki@1ca29b6e-896d-4ea0-84a5-967f57386b96>
Sat, 28 Feb 2009 15:20:07 +0000 (15:20 +0000)
git-svn-id: https://svn.sourceforge.jp/svnroot/nucleus-jp/nucleus-jp/trunk/utf8@962 1ca29b6e-896d-4ea0-84a5-967f57386b96

nucleus/libs/ADMIN.php
nucleus/libs/ITEMACTIONS.php
nucleus/libs/PAGEFACTORY.php
nucleus/libs/TEMPLATE.php

index 2ed2514..ff53f1b 100755 (executable)
@@ -335,7 +335,7 @@ class ADMIN {
                        $amount = intPostVar('amount');\r
                else {\r
                        $amount = intval($CONF['DefaultListSize']);\r
-                       if ($amount < 1) \r
+                       if ($amount < 1)\r
                                $amount = 10;\r
                }\r
 \r
@@ -902,7 +902,7 @@ class ADMIN {
                        $amount = intPostVar('amount');\r
                else {\r
                        $amount = intval($CONF['DefaultListSize']);\r
-                       if ($amount < 1) \r
+                       if ($amount < 1)\r
                                $amount = 10;\r
                }\r
 \r
@@ -957,7 +957,7 @@ class ADMIN {
                        $amount = intPostVar('amount');\r
                else {\r
                        $amount = intval($CONF['DefaultListSize']);\r
-                       if ($amount < 1) \r
+                       if ($amount < 1)\r
                                $amount = 10;\r
                }\r
 \r
@@ -1001,7 +1001,7 @@ class ADMIN {
                        $amount = intPostVar('amount');\r
                else {\r
                        $amount = intval($CONF['DefaultListSize']);\r
-                       if ($amount < 1) \r
+                       if ($amount < 1)\r
                                $amount = 10;\r
                }\r
 \r
@@ -1057,7 +1057,7 @@ class ADMIN {
                        $amount = intPostVar('amount');\r
                else {\r
                        $amount = intval($CONF['DefaultListSize']);\r
-                       if ($amount < 1) \r
+                       if ($amount < 1)\r
                                $amount = 10;\r
                }\r
 \r
@@ -1225,7 +1225,7 @@ class ADMIN {
                                $wasdraft = 0;\r
                                $publish = 0;\r
                                $timestamp = 0;\r
-                               break;                  \r
+                               break;\r
                        case 'edit':\r
                        default:\r
                                $publish = 1;\r
@@ -1520,7 +1520,7 @@ class ADMIN {
                }\r
                if ($result['status'] == 'newcategory') {\r
 //                     $distURI = ($nextAction == 'sendping') ? $manager->addTicketToUrl($CONF['AdminURL'] . 'index.php?action='\r
-//                                      . $nextAction . '&blogid=' . intval($blogid)) : \r
+//                                      . $nextAction . '&blogid=' . intval($blogid)) :\r
 //                                        '';\r
                        $distURI = $manager->addTicketToUrl($CONF['AdminURL'] . 'index.php?action=' . $nextAction . '&blogid=' . intval($blogid));\r
                        $this->action_categoryedit($result['catid'], $blogid, $distURI);\r
@@ -2101,7 +2101,7 @@ class ADMIN {
                        $mem->setCanLogin($canlogin);\r
                }\r
 \r
-               $autosave = postVar ('autosave'); \r
+               $autosave = postVar ('autosave');\r
                $mem->setAutosave($autosave);\r
 \r
                $mem->write();\r
@@ -4006,7 +4006,7 @@ selector();
                                $this->_templateEditRow($template, $pfdesc, $pffield, '',++$tab,0);\r
                        }\r
                }\r
-?>                     \r
+?>\r
                </tr><tr>\r
                        <th colspan="2"><?php echo _TEMPLATE_UPDATE?></th>\r
                </tr><tr>\r
@@ -4028,6 +4028,7 @@ selector();
         */\r
        function _templateEditRow(&$template, $description, $name, $help = '', $tabindex = 0, $big = 0) {\r
                static $count = 1;\r
+               if (!isset($template[$name])) $template[$name] = '';\r
        ?>\r
                </tr><tr>\r
                        <td><?php echo $description?> <?php if ($help) help('template'.$help); ?></td>\r
@@ -4914,14 +4915,14 @@ selector();
                                           <td><?php\r
 \r
                                                $this->input_yesno('DebugVars',$CONF['DebugVars'],10078);\r
-                                               \r
+\r
                                                         ?>\r
 \r
                                           </td>\r
                </tr><tr>\r
                        <td><?php echo _SETTINGS_DEFAULTLISTSIZE?> <?php help('defaultlistsize');?></td>\r
                        <td>\r
-                       <?php \r
+                       <?php\r
                                if (!array_key_exists('DefaultListSize',$CONF)) {\r
                                        sql_query("INSERT INTO ".sql_table('config')." VALUES ('DefaultListSize', '10')");\r
                                        $CONF['DefaultListSize'] = 10;\r
@@ -5108,7 +5109,7 @@ selector();
 \r
        /**\r
         *  Give an overview over the used system\r
-        */     \r
+        */\r
        function action_systemoverview() {\r
                global $member, $nucleus, $CONF;\r
 \r
@@ -5182,14 +5183,14 @@ selector();
                        echo "\t\t" . '<th colspan="2">' . _ADMIN_SYSTEMOVERVIEW_MODULES . "</th>\n";\r
                        echo "\t</tr><tr>\n";\r
                        echo "\t\t" . '<td width="50%">mod_rewrite' . "</td>\n";\r
-                       $modrewrite = (strstr($im, 'mod_rewrite') != '') ? \r
+                       $modrewrite = (strstr($im, 'mod_rewrite') != '') ?\r
                                                _ADMIN_SYSTEMOVERVIEW_ENABLE :\r
                                                _ADMIN_SYSTEMOVERVIEW_DISABLE;\r
                        echo "\t\t" . '<td>' . $modrewrite . "</td>\n";\r
                        echo "\t</tr>\n";\r
                        echo "</table>\n";\r
 \r
-                       // Information about the used Nucleus CMS \r
+                       // Information about the used Nucleus CMS\r
                        echo '<h3>' . _ADMIN_SYSTEMOVERVIEW_NUCLEUSSYSTEM . "</h3>\n";\r
                        global $nucleus;\r
                        $nv = getNucleusVersion() / 100 . '(' . $nucleus['version'] . ')';\r
@@ -5239,7 +5240,7 @@ selector();
                else {\r
                        echo _ADMIN_SYSTEMOVERVIEW_NOT_ADMIN;\r
                }\r
-               \r
+\r
                $this->pagefoot();\r
        }\r
 \r
index b09a4ca..82f7470 100644 (file)
@@ -58,7 +58,7 @@ class ITEMACTIONS extends BaseActions {
 \r
        /**\r
          * Returns an array with the actions that are defined\r
-         * in the ITEMACTIONS class \r
+         * in the ITEMACTIONS class\r
          */\r
        function getDefinedActions() {\r
                return array(\r
@@ -115,23 +115,23 @@ class ITEMACTIONS extends BaseActions {
        function setLastVisit($lastVisit) {\r
                $this->lastVisit = $lastVisit;\r
        }\r
-       \r
+\r
        function setParser(&$parser) {\r
                $this->parser =& $parser;\r
        }\r
-       \r
+\r
        function setCurrentItem(&$item) {\r
                $this->currentItem =& $item;\r
        }\r
-       \r
+\r
        function setBlog(&$blog) {\r
                $this->blog =& $blog;\r
        }\r
-       \r
+\r
        function setTemplate($template) {\r
                $this->template =& $template;\r
        }\r
-       \r
+\r
        function setShowComments($val) {\r
                $this->showComments = $val;\r
        }\r
@@ -145,21 +145,21 @@ class ITEMACTIONS extends BaseActions {
        function parse_blogid() {\r
                echo $this->blog->getID();\r
        }\r
-       \r
+\r
        /**\r
         * Parse templatevar body\r
         */\r
        function parse_body() {\r
                $this->highlightAndParse($this->currentItem->body);\r
        }\r
-       \r
+\r
        /**\r
         * Parse templatevar more\r
         */\r
        function parse_more() {\r
                $this->highlightAndParse($this->currentItem->more);\r
        }\r
-       \r
+\r
        /**\r
         * Parse templatevar itemid\r
         */\r
@@ -169,32 +169,32 @@ class ITEMACTIONS extends BaseActions {
 \r
        /**\r
         * Parse templatevar category\r
-        */     \r
+        */\r
        function parse_category() {\r
                echo $this->currentItem->category;\r
        }\r
-       \r
+\r
        /**\r
         * Parse templatevar categorylink\r
         */\r
        function parse_categorylink() {\r
                echo createLink('category', array('catid' => $this->currentItem->catid, 'name' => $this->currentItem->category));\r
        }\r
-       \r
+\r
        /**\r
         * Parse templatevar catid\r
         */\r
        function parse_catid() {\r
                echo $this->currentItem->catid;\r
        }\r
-       \r
+\r
        /**\r
         * Parse templatevar authorid\r
         */\r
        function parse_authorid() {\r
                echo $this->currentItem->authorid;\r
        }\r
-       \r
+\r
        /**\r
         * Parse templatevar authorlink\r
         */\r
@@ -208,14 +208,14 @@ class ITEMACTIONS extends BaseActions {
                        )\r
                );\r
        }\r
-       \r
+\r
        /**\r
         * Parse templatevar query\r
         */\r
        function parse_query() {\r
                echo $this->strHighlight;\r
        }\r
-       \r
+\r
        /**\r
         * Parse templatevar itemlink\r
         */\r
@@ -230,21 +230,21 @@ class ITEMACTIONS extends BaseActions {
                        )\r
                );\r
        }\r
-       \r
+\r
        /**\r
         * Parse templatevar blogurl\r
         */\r
        function parse_blogurl() {\r
                echo $this->blog->getURL();\r
        }\r
-       \r
+\r
        /**\r
         * Parse templatevar closed\r
         */\r
        function parse_closed() {\r
                echo $this->currentItem->closed;\r
        }\r
-       \r
+\r
        /**\r
         * Parse templatevar relevance\r
         */\r
@@ -254,8 +254,8 @@ class ITEMACTIONS extends BaseActions {
 \r
        /**\r
         * Parse templatevar title\r
-        * \r
-        * @param string $format defines in which format the title is shown              \r
+        *\r
+        * @param string $format defines in which format the title is shown\r
         */\r
        function parse_title($format = '') {\r
                if (is_array($this->currentItem)) {\r
@@ -363,19 +363,21 @@ class ITEMACTIONS extends BaseActions {
 \r
        /**\r
         * Parse templatevar date\r
-        * \r
-        * @param format optional strftime format                \r
+        *\r
+        * @param format optional strftime format\r
         */\r
        function parse_date($format = '') {\r
+               if (!isset($this->template['FORMAT_DATE'])) $this->template['FORMAT_DATE'] = '';
                echo formatDate($format, $this->currentItem->timestamp, $this->template['FORMAT_DATE'], $this->blog);\r
        }\r
 \r
        /**\r
          * Parse templatevar time\r
-         *       \r
+         *\r
          * @param format optional strftime format\r
          */\r
        function parse_time($format = '') {\r
+               if (!isset($this->template['FORMAT_TIME'])) $this->template['FORMAT_TIME'] = '';
                echo strftime($format ? $format : $this->template['FORMAT_TIME'],$this->currentItem->timestamp);\r
        }\r
 \r
index 4275143..c071cfc 100755 (executable)
@@ -275,10 +275,12 @@ class PAGEFACTORY extends BaseActions {
        }\r
 \r
        function parse_contents($which) {\r
+               if (!isset($this->variables[$which])) $this->variables[$which] = '';\r
                echo htmlspecialchars($this->variables[$which],ENT_QUOTES);\r
        }\r
 \r
        function parse_checkedonval($value, $name) {\r
+               if (!isset($this->variables[$name])) $this->variables[$name] = '';\r
                if ($this->variables[$name] == $value)\r
                        echo 'checked="checked"';\r
        }\r
index 3cd32e2..7f972d8 100755 (executable)
@@ -143,7 +143,7 @@ class TEMPLATE {
                        $template[$obj->tpartname] = $obj->tcontent;\r
 \r
                // set locale according to template:\r
-               if ($template['LOCALE'])\r
+               if (isset($template['LOCALE']))\r
                        setlocale(LC_TIME,$template['LOCALE']);\r
                else\r
                        setlocale(LC_TIME,'');\r