• R/O
  • HTTP
  • SSH
  • HTTPS

nucleus-jp-ancient: Commit

Nucleus CMS日本語版SVNをgit-svnしたもの。リポジトリの変換作業用


Commit MetaInfo

Revision4bd96c97fb168bc77b722f229f0bb4d24f44915e (tree)
Zeit2012-10-05 23:46:26
Autorreine <reine@user...>
Commiterreine

Log Message

FIX: デバッグ動作時に発生する警告に対処

ACTIONS.php

変数名の大文字小文字の不一致

ADMIN.php

存在しないkey値の参照、変数の未定義

BLOG.php

変数の未定義

ITEMACTIONS.php

データ作成方法の不一致(StdClass/Array)による不正参照

MANAGER.php

参照渡しすべき引数の値渡し

PAGEFACTORY.php

存在しないkey値の参照、変数名の大文字小文字の不一致

PLUGIN.php

存在しないkey値の参照

PLUGINADMIN.php

global変数の定義漏れ

showlist.php

存在しないkey値の参照

media.php

変数の未定義

plugins/NP_SecurityEnforcer.php

存在しないkey値の参照

plugins/NP_SkinFiles.php

条件判定時の前提条件確認漏れ

plugins/securityenforcer/index.php

変数の未定義

plugins/NP_MediaFiles.php において、ディレクトリ作成処理時に警告が表示されるが
意図する動作が不明なため未対処。

Ändern Zusammenfassung

Diff

--- a/nucleus/libs/ACTIONS.php
+++ b/nucleus/libs/ACTIONS.php
@@ -636,7 +636,7 @@ class ACTIONS extends BaseActions {
636636 global $blog, $manager;
637637
638638 // when no blog found
639- if (($blogName == '') && (!is_object($blog)))
639+ if (($blogname == '') && (!is_object($blog)))
640640 return 0;
641641
642642 if ($blogname == '') {
--- a/nucleus/libs/ADMIN.php
+++ b/nucleus/libs/ADMIN.php
@@ -821,7 +821,7 @@ class ADMIN {
821821 if ($iForcedBlogInclude != -1)
822822 $aBlogIds[] = intval($iForcedBlogInclude);
823823
824- if (($member->isAdmin()) && ($CONF['ShowAllBlogs']))
824+ if (($member->isAdmin()) && (array_key_exists('ShowAllBlogs', $CONF) && $CONF['ShowAllBlogs']))
825825 $queryBlogs = 'SELECT bnumber FROM '.sql_table('blog').' ORDER BY bname';
826826 else
827827 $queryBlogs = 'SELECT bnumber FROM '.sql_table('blog').', '.sql_table('team').' WHERE tblog=bnumber and tmember=' . $member->getID();
@@ -842,6 +842,8 @@ class ADMIN {
842842 if ($mode == 'category') {
843843 if (sql_num_rows($blogs) > 1)
844844 $multipleBlogs = 1;
845+ else
846+ $multipleBlogs = 0;
845847
846848 while ($oBlog = sql_fetch_object($blogs)) {
847849 if ($multipleBlogs)
--- a/nucleus/libs/BLOG.php
+++ b/nucleus/libs/BLOG.php
@@ -279,6 +279,7 @@ class BLOG {
279279 $body = $body;
280280 $more = $more;
281281 $catid = intval($catid);
282+ $isFuture = 0;
282283
283284 // convert newlines to <br />
284285 if ($this->convertBreaks()) {
--- a/nucleus/libs/ITEMACTIONS.php
+++ b/nucleus/libs/ITEMACTIONS.php
@@ -123,7 +123,11 @@ class ITEMACTIONS extends BaseActions {
123123 function setCurrentItem(&$item) {
124124 $this->currentItem =& $item;
125125 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+ }
127131 }
128132
129133 function setBlog(&$blog) {
--- a/nucleus/libs/MANAGER.php
+++ b/nucleus/libs/MANAGER.php
@@ -407,7 +407,7 @@ class MANAGER {
407407 * Can contain any type of data, depending on the event type. Usually this is
408408 * an itemid, blogid, ... but it can also be an array containing multiple values
409409 */
410- function notify($eventName, $data) {
410+ function notify($eventName, &$data) {
411411 // load subscription list if needed
412412 if (!is_array($this->subscriptions))
413413 $this->_loadSubscriptions();
--- a/nucleus/libs/PAGEFACTORY.php
+++ b/nucleus/libs/PAGEFACTORY.php
@@ -169,7 +169,7 @@ class PAGEFACTORY extends BaseActions {
169169
170170 // create category dropdown box
171171 function parse_categories($startidx = 0) {
172- if ($this->variables['catid'])
172+ if (array_key_exists('catid', $this->variables) && $this->variables['catid'])
173173 $catid = $this->variables['catid']; // on edit item
174174 else
175175 $catid = $this->blog->getDefaultCategory(); // on add item
@@ -395,7 +395,7 @@ class PAGEFACTORY extends BaseActions {
395395 $manager->notify('AddItemFormExtras', $param);
396396 break;
397397 case 'edit':
398- $PARAM = array(
398+ $param = array(
399399 'variables' => $this->variables,
400400 'blog' => &$this->blog,
401401 'itemid' => $this->variables['itemid']
--- a/nucleus/libs/PLUGIN.php
+++ b/nucleus/libs/PLUGIN.php
@@ -510,8 +510,10 @@
510510 */
511511 function _getOID($context, $name) {
512512 $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+ }
515517
516518 // load all OIDs for this plugin from the database
517519 $this->_aOptionToInfo = array();
@@ -523,8 +525,13 @@
523525 }
524526 sql_free_result($res);
525527
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+ }
527533 }
534+
528535 function _getDefVal($context, $name) {
529536 $key = $context . '_' . $name;
530537 $info = $this->_aOptionToInfo[$key];
@@ -637,7 +644,7 @@
637644 $meta = NucleusPlugin::getOptionMeta($o->oextra);
638645
639646 // 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'))) {
641648
642649 $value = undoMagic($value); // value comes from request
643650
@@ -650,7 +657,7 @@
650657 }
651658
652659 // 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))) {
654661 //the option must be numeric, but the it isn't
655662 //use the default for this option
656663 $value = $o->odef;
--- a/nucleus/libs/PLUGINADMIN.php
+++ b/nucleus/libs/PLUGINADMIN.php
@@ -28,7 +28,7 @@ class PluginAdmin {
2828
2929 function PluginAdmin($pluginName)
3030 {
31- global $manager;
31+ global $manager, $DIR_LIBS;
3232 include_once($DIR_LIBS . 'ADMIN.php');
3333
3434 $this->strFullName = 'NP_' . $pluginName;
--- a/nucleus/libs/showlist.php
+++ b/nucleus/libs/showlist.php
@@ -272,7 +272,7 @@ function listplug_plugOptionRow($current) {
272272 $meta = NucleusPlugin::getOptionMeta($current['typeinfo']);
273273
274274 // 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') {
276276 echo '<td>',htmlspecialchars($current['description']?$current['description']:$current['name']),'</td>';
277277 echo '<td>';
278278 switch($current['type']) {
@@ -307,15 +307,17 @@ function listplug_plugOptionRow($current) {
307307 //$meta = NucleusPlugin::getOptionMeta($current['typeinfo']);
308308
309309 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') {
311311 echo ' onkeyup="checkNumeric(this)" onblur="checkNumeric(this)"';
312312 }
313- if ($meta['access'] == 'readonly') {
313+ if (array_key_exists('access', $meta) && $meta['access'] == 'readonly') {
314314 echo ' readonly="readonly"';
315315 }
316316 echo ' />';
317317 }
318- echo $current['extra'];
318+ if (array_key_exists('extra', $current)) {
319+ echo $current['extra'];
320+ }
319321 echo '</td>';
320322 }
321323 }
--- a/nucleus/media.php
+++ b/nucleus/media.php
@@ -164,7 +164,10 @@ function media_select() {
164164 </tr>
165165
166166 <?php
167-
167+
168+ $idxStart = 0;
169+ $idxEnd = 0;
170+
168171 if (sizeof($arr)>0) {
169172
170173 if (($offset + $CONF['MediaPerPage']) >= sizeof($arr))
--- a/nucleus/plugins/NP_SecurityEnforcer.php
+++ b/nucleus/plugins/NP_SecurityEnforcer.php
@@ -37,7 +37,7 @@ class NP_SecurityEnforcer extends NucleusPlugin {
3737 $query = "CREATE TABLE IF NOT EXISTS ". sql_table('plug_securityenforcer').
3838 " (
3939 `login` varchar(255),
40- `fails` int(11) NOT NULL default '0',
40+ `fails` int(11) NOT NULL default '0',
4141 `lastfail` bigint NOT NULL default '0',
4242 KEY `login` (`login`)) ENGINE=MyISAM";
4343 sql_query($query);
@@ -174,7 +174,7 @@ class NP_SecurityEnforcer extends NucleusPlugin {
174174 }
175175
176176 public function event_PrePluginOptionsEdit($data) {
177- if ($data['plugid'] === $this->getID()) {
177+ if (array_key_exists('plugid', $data) && $data['plugid'] === $this->getID()) {
178178 foreach($data['options'] as $key => $value){
179179 if (defined($value['description'])) {
180180 $data['options'][$key]['description'] = constant($value['description']);
--- a/nucleus/plugins/NP_SkinFiles.php
+++ b/nucleus/plugins/NP_SkinFiles.php
@@ -121,7 +121,7 @@ class NP_SkinFiles extends NucleusPlugin {
121121 }
122122
123123 public function event_PrePluginOptionsEdit($data) {
124- if ($data['plugid'] !== $this->getID()) {
124+ if ($data['context'] !== 'global' || $data['plugid'] !== $this->getID()) {
125125 return;
126126 }
127127 foreach($data['options'] as $key => $value){
--- a/nucleus/plugins/securityenforcer/index.php
+++ b/nucleus/plugins/securityenforcer/index.php
@@ -34,6 +34,7 @@ Admin area for NP_SecurityEnforcer
3434 $oPluginAdmin->start('');
3535
3636 // if form to unlock is posted
37+ $message = '';
3738 if(postVar('action') == 'unlock') {
3839 if (!$manager->checkTicket())
3940 doError('Invalid Ticket');
Show on old repository browser