r47972 MediaWiki - Code Review archive

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

Diff [purge]

Index: trunk/WikiWord/WikiWord/src/main/php/wikiword.php
@@ -27,9 +27,11 @@
2828 if (!isset($weight) && isset($freq)) $weight = $freq;
2929 if (!isset($weight) && isset($conf)) $weight = $conf;
3030 if (!isset($concept_name) && isset($name)) $concept_name = $name;
 31+ if (!isset($concept_name) && isset($name)) $concept_name = NULL;
3132 if (!isset($concept) && isset($id)) $concept = $id;
 33+ if (!isset($concept) && isset($id)) $concept = NULL;
3234
33 - $wu = "http://$lang.wikipedia.org/wiki/" . urlencode($concept_name);
 35+ $wu = $concept_name ? "http://$lang.wikipedia.org/wiki/" . urlencode($concept_name) : NULL;
3436 $cu = "$wwSelf?id=" . urlencode($concept) . "&lang=" . urlencode($lang);
3537
3638 ?>
@@ -92,7 +94,10 @@
9395 $wu = "http://$lang.wikipedia.org/wiki/" . urlencode($concept_name);
9496 $cu = "$wwSelf?id=" . urlencode($concept) . "&lang=" . urlencode($lang);
9597
96 - if (!isset($weight) || !$weight) $wclass = "x";
 98+ if (!isset($weight) || !$weight) {
 99+ $wclass = "x";
 100+ $weight = NULL;
 101+ }
97102 else if ($weight>1000) $wclass = "huge";
98103 else if ($weight>100) $wclass = "big";
99104 else if ($weight>10) $wclass = "normal";

Status & tagging log