Nucleus CMS日本語版SVNをgit-svnしたもの。リポジトリの変換作業用
Revisão | 4bd96c97fb168bc77b722f229f0bb4d24f44915e (tree) |
---|---|
Hora | 2012-10-05 23:46:26 |
Autor | reine <reine@user...> |
Commiter | reine |
FIX: デバッグ動作時に発生する警告に対処
ACTIONS.php
ADMIN.php
BLOG.php
ITEMACTIONS.php
MANAGER.php
PAGEFACTORY.php
PLUGIN.php
PLUGINADMIN.php
showlist.php
media.php
plugins/NP_SecurityEnforcer.php
plugins/NP_SkinFiles.php
plugins/securityenforcer/index.php
plugins/NP_MediaFiles.php において、ディレクトリ作成処理時に警告が表示されるが
意図する動作が不明なため未対処。
@@ -636,7 +636,7 @@ class ACTIONS extends BaseActions { | ||
636 | 636 | global $blog, $manager; |
637 | 637 | |
638 | 638 | // when no blog found |
639 | - if (($blogName == '') && (!is_object($blog))) | |
639 | + if (($blogname == '') && (!is_object($blog))) | |
640 | 640 | return 0; |
641 | 641 | |
642 | 642 | if ($blogname == '') { |
@@ -821,7 +821,7 @@ class ADMIN { | ||
821 | 821 | if ($iForcedBlogInclude != -1) |
822 | 822 | $aBlogIds[] = intval($iForcedBlogInclude); |
823 | 823 | |
824 | - if (($member->isAdmin()) && ($CONF['ShowAllBlogs'])) | |
824 | + if (($member->isAdmin()) && (array_key_exists('ShowAllBlogs', $CONF) && $CONF['ShowAllBlogs'])) | |
825 | 825 | $queryBlogs = 'SELECT bnumber FROM '.sql_table('blog').' ORDER BY bname'; |
826 | 826 | else |
827 | 827 | $queryBlogs = 'SELECT bnumber FROM '.sql_table('blog').', '.sql_table('team').' WHERE tblog=bnumber and tmember=' . $member->getID(); |
@@ -842,6 +842,8 @@ class ADMIN { | ||
842 | 842 | if ($mode == 'category') { |
843 | 843 | if (sql_num_rows($blogs) > 1) |
844 | 844 | $multipleBlogs = 1; |
845 | + else | |
846 | + $multipleBlogs = 0; | |
845 | 847 | |
846 | 848 | while ($oBlog = sql_fetch_object($blogs)) { |
847 | 849 | if ($multipleBlogs) |
@@ -279,6 +279,7 @@ class BLOG { | ||
279 | 279 | $body = $body; |
280 | 280 | $more = $more; |
281 | 281 | $catid = intval($catid); |
282 | + $isFuture = 0; | |
282 | 283 | |
283 | 284 | // convert newlines to <br /> |
284 | 285 | if ($this->convertBreaks()) { |
@@ -123,7 +123,11 @@ class ITEMACTIONS extends BaseActions { | ||
123 | 123 | function setCurrentItem(&$item) { |
124 | 124 | $this->currentItem =& $item; |
125 | 125 | global $currentitemid; |
126 | - $currentitemid = $this->currentItem->itemid; | |
126 | + if (is_array($this->currentItem)) { | |
127 | + $currentitemid = $this->currentItem['itemid']; | |
128 | + } else { | |
129 | + $currentitemid = $this->currentItem->itemid; | |
130 | + } | |
127 | 131 | } |
128 | 132 | |
129 | 133 | function setBlog(&$blog) { |
@@ -407,7 +407,7 @@ class MANAGER { | ||
407 | 407 | * Can contain any type of data, depending on the event type. Usually this is |
408 | 408 | * an itemid, blogid, ... but it can also be an array containing multiple values |
409 | 409 | */ |
410 | - function notify($eventName, $data) { | |
410 | + function notify($eventName, &$data) { | |
411 | 411 | // load subscription list if needed |
412 | 412 | if (!is_array($this->subscriptions)) |
413 | 413 | $this->_loadSubscriptions(); |
@@ -169,7 +169,7 @@ class PAGEFACTORY extends BaseActions { | ||
169 | 169 | |
170 | 170 | // create category dropdown box |
171 | 171 | function parse_categories($startidx = 0) { |
172 | - if ($this->variables['catid']) | |
172 | + if (array_key_exists('catid', $this->variables) && $this->variables['catid']) | |
173 | 173 | $catid = $this->variables['catid']; // on edit item |
174 | 174 | else |
175 | 175 | $catid = $this->blog->getDefaultCategory(); // on add item |
@@ -395,7 +395,7 @@ class PAGEFACTORY extends BaseActions { | ||
395 | 395 | $manager->notify('AddItemFormExtras', $param); |
396 | 396 | break; |
397 | 397 | case 'edit': |
398 | - $PARAM = array( | |
398 | + $param = array( | |
399 | 399 | 'variables' => $this->variables, |
400 | 400 | 'blog' => &$this->blog, |
401 | 401 | 'itemid' => $this->variables['itemid'] |
@@ -510,8 +510,10 @@ | ||
510 | 510 | */ |
511 | 511 | function _getOID($context, $name) { |
512 | 512 | $key = $context . '_' . $name; |
513 | - $info = $this->_aOptionToInfo[$key]; | |
514 | - if (is_array($info)) return $info['oid']; | |
513 | + if (array_key_exists($key, $this->_aOptionToInfo)) { | |
514 | + $info = $this->_aOptionToInfo[$key]; | |
515 | + if (is_array($info)) return $info['oid']; | |
516 | + } | |
515 | 517 | |
516 | 518 | // load all OIDs for this plugin from the database |
517 | 519 | $this->_aOptionToInfo = array(); |
@@ -523,8 +525,13 @@ | ||
523 | 525 | } |
524 | 526 | sql_free_result($res); |
525 | 527 | |
526 | - return $this->_aOptionToInfo[$key]['oid']; | |
528 | + if (array_key_exists($key, $this->_aOptionToInfo)) { | |
529 | + return $this->_aOptionToInfo[$key]['oid']; | |
530 | + } else { | |
531 | + return null; | |
532 | + } | |
527 | 533 | } |
534 | + | |
528 | 535 | function _getDefVal($context, $name) { |
529 | 536 | $key = $context . '_' . $name; |
530 | 537 | $info = $this->_aOptionToInfo[$key]; |
@@ -637,7 +644,7 @@ | ||
637 | 644 | $meta = NucleusPlugin::getOptionMeta($o->oextra); |
638 | 645 | |
639 | 646 | // if the option is readonly or hidden it may not be saved |
640 | - if (($meta['access'] != 'readonly') && ($meta['access'] != 'hidden')) { | |
647 | + if (!array_key_exists('access', $meta) || (($meta['access'] != 'readonly') && ($meta['access'] != 'hidden'))) { | |
641 | 648 | |
642 | 649 | $value = undoMagic($value); // value comes from request |
643 | 650 |
@@ -650,7 +657,7 @@ | ||
650 | 657 | } |
651 | 658 | |
652 | 659 | // check the validity of numerical options |
653 | - if (($meta['datatype'] == 'numerical') && (!is_numeric($value))) { | |
660 | + if (array_key_exists('datatype', $meta) && ($meta['datatype'] == 'numerical') && (!is_numeric($value))) { | |
654 | 661 | //the option must be numeric, but the it isn't |
655 | 662 | //use the default for this option |
656 | 663 | $value = $o->odef; |
@@ -28,7 +28,7 @@ class PluginAdmin { | ||
28 | 28 | |
29 | 29 | function PluginAdmin($pluginName) |
30 | 30 | { |
31 | - global $manager; | |
31 | + global $manager, $DIR_LIBS; | |
32 | 32 | include_once($DIR_LIBS . 'ADMIN.php'); |
33 | 33 | |
34 | 34 | $this->strFullName = 'NP_' . $pluginName; |
@@ -272,7 +272,7 @@ function listplug_plugOptionRow($current) { | ||
272 | 272 | $meta = NucleusPlugin::getOptionMeta($current['typeinfo']); |
273 | 273 | |
274 | 274 | // only if it is not a hidden option write the controls to the page |
275 | - if ($meta['access'] != 'hidden') { | |
275 | + if (!array_key_exists('access', $meta) || $meta['access'] != 'hidden') { | |
276 | 276 | echo '<td>',htmlspecialchars($current['description']?$current['description']:$current['name']),'</td>'; |
277 | 277 | echo '<td>'; |
278 | 278 | switch($current['type']) { |
@@ -307,15 +307,17 @@ function listplug_plugOptionRow($current) { | ||
307 | 307 | //$meta = NucleusPlugin::getOptionMeta($current['typeinfo']); |
308 | 308 | |
309 | 309 | echo '<input type="text" size="40" maxlength="128" name="',htmlspecialchars($varname),'" value="',htmlspecialchars($current['value']),'"'; |
310 | - if ($meta['datatype'] == 'numerical') { | |
310 | + if (array_key_exists('datatype', $meta) && $meta['datatype'] == 'numerical') { | |
311 | 311 | echo ' onkeyup="checkNumeric(this)" onblur="checkNumeric(this)"'; |
312 | 312 | } |
313 | - if ($meta['access'] == 'readonly') { | |
313 | + if (array_key_exists('access', $meta) && $meta['access'] == 'readonly') { | |
314 | 314 | echo ' readonly="readonly"'; |
315 | 315 | } |
316 | 316 | echo ' />'; |
317 | 317 | } |
318 | - echo $current['extra']; | |
318 | + if (array_key_exists('extra', $current)) { | |
319 | + echo $current['extra']; | |
320 | + } | |
319 | 321 | echo '</td>'; |
320 | 322 | } |
321 | 323 | } |
@@ -164,7 +164,10 @@ function media_select() { | ||
164 | 164 | </tr> |
165 | 165 | |
166 | 166 | <?php |
167 | - | |
167 | + | |
168 | + $idxStart = 0; | |
169 | + $idxEnd = 0; | |
170 | + | |
168 | 171 | if (sizeof($arr)>0) { |
169 | 172 | |
170 | 173 | if (($offset + $CONF['MediaPerPage']) >= sizeof($arr)) |
@@ -37,7 +37,7 @@ class NP_SecurityEnforcer extends NucleusPlugin { | ||
37 | 37 | $query = "CREATE TABLE IF NOT EXISTS ". sql_table('plug_securityenforcer'). |
38 | 38 | " ( |
39 | 39 | `login` varchar(255), |
40 | - `fails` int(11) NOT NULL default '0', | |
40 | + `fails` int(11) NOT NULL default '0', | |
41 | 41 | `lastfail` bigint NOT NULL default '0', |
42 | 42 | KEY `login` (`login`)) ENGINE=MyISAM"; |
43 | 43 | sql_query($query); |
@@ -174,7 +174,7 @@ class NP_SecurityEnforcer extends NucleusPlugin { | ||
174 | 174 | } |
175 | 175 | |
176 | 176 | public function event_PrePluginOptionsEdit($data) { |
177 | - if ($data['plugid'] === $this->getID()) { | |
177 | + if (array_key_exists('plugid', $data) && $data['plugid'] === $this->getID()) { | |
178 | 178 | foreach($data['options'] as $key => $value){ |
179 | 179 | if (defined($value['description'])) { |
180 | 180 | $data['options'][$key]['description'] = constant($value['description']); |
@@ -121,7 +121,7 @@ class NP_SkinFiles extends NucleusPlugin { | ||
121 | 121 | } |
122 | 122 | |
123 | 123 | public function event_PrePluginOptionsEdit($data) { |
124 | - if ($data['plugid'] !== $this->getID()) { | |
124 | + if ($data['context'] !== 'global' || $data['plugid'] !== $this->getID()) { | |
125 | 125 | return; |
126 | 126 | } |
127 | 127 | foreach($data['options'] as $key => $value){ |
@@ -34,6 +34,7 @@ Admin area for NP_SecurityEnforcer | ||
34 | 34 | $oPluginAdmin->start(''); |
35 | 35 | |
36 | 36 | // if form to unlock is posted |
37 | + $message = ''; | |
37 | 38 | if(postVar('action') == 'unlock') { |
38 | 39 | if (!$manager->checkTicket()) |
39 | 40 | doError('Invalid Ticket'); |