r47971 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r47970‎ | r47971 | r47972 >
Date:11:06, 3 March 2009
Author:daniel
Status:deferred
Tags:
Comment:
fix undef vars
Modified paths:
  • /trunk/WikiWord/WikiWord/src/main/php/wikiword.php (modified) (history)
  • /trunk/WikiWord/WikiWord/src/main/php/wwutils.php (modified) (history)

Diff [purge]

Index: trunk/WikiWord/WikiWord/src/main/php/wwutils.php
@@ -58,8 +58,6 @@
5959 function queryLocalConceptInfo($lang, $id) {
6060 global $wwTablePrefix;
6161
62 - $term = trim($term);
63 -
6462 $sql = "SELECT C.*, F.*, definition FROM {$wwTablePrefix}_{$lang}_concept_info as F "
6563 . " JOIN {$wwTablePrefix}_{$lang}_concept as C ON F.concept = C.id "
6664 . " JOIN {$wwTablePrefix}_{$lang}_definition as D ON F.concept = D.concept "
@@ -111,9 +109,9 @@
112110 $r = explode("\x1F", $i);
113111 $offs = -1;
114112
115 - if ($hasId) $r['id'] = $r[$offs += 1];
116 - if ($hasName) $r['name'] = $r[$offs += 1];
117 - if ($hasConf) $r['conf'] = $r[$offs += 1];
 113+ if ($hasId) $r['id'] = @$r[$offs += 1];
 114+ if ($hasName) $r['name'] = @$r[$offs += 1];
 115+ if ($hasConf) $r['conf'] = @$r[$offs += 1];
118116
119117 $items[] = $r;
120118 }
Index: trunk/WikiWord/WikiWord/src/main/php/wikiword.php
@@ -92,7 +92,7 @@
9393 $wu = "http://$lang.wikipedia.org/wiki/" . urlencode($concept_name);
9494 $cu = "$wwSelf?id=" . urlencode($concept) . "&lang=" . urlencode($lang);
9595
96 - if (!$weight) $wclass = "x";
 96+ if (!isset($weight) || !$weight) $wclass = "x";
9797 else if ($weight>1000) $wclass = "huge";
9898 else if ($weight>100) $wclass = "big";
9999 else if ($weight>10) $wclass = "normal";
@@ -154,7 +154,7 @@
155155 </tr>
156156 <?php } ?>
157157 <?php
158 - if ($weight && $weight<2 && $pos>=3) return false;
 158+ if (isset($weight) && $weight && $weight<2 && $pos>=3) return false;
159159 else return true;
160160 }
161161

Status & tagging log