Index: trunk/WikiWord/WikiWord/src/main/php/wwutils.php |
— | — | @@ -58,8 +58,6 @@ |
59 | 59 | function queryLocalConceptInfo($lang, $id) { |
60 | 60 | global $wwTablePrefix; |
61 | 61 | |
62 | | - $term = trim($term); |
63 | | - |
64 | 62 | $sql = "SELECT C.*, F.*, definition FROM {$wwTablePrefix}_{$lang}_concept_info as F " |
65 | 63 | . " JOIN {$wwTablePrefix}_{$lang}_concept as C ON F.concept = C.id " |
66 | 64 | . " JOIN {$wwTablePrefix}_{$lang}_definition as D ON F.concept = D.concept " |
— | — | @@ -111,9 +109,9 @@ |
112 | 110 | $r = explode("\x1F", $i); |
113 | 111 | $offs = -1; |
114 | 112 | |
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]; |
118 | 116 | |
119 | 117 | $items[] = $r; |
120 | 118 | } |
Index: trunk/WikiWord/WikiWord/src/main/php/wikiword.php |
— | — | @@ -92,7 +92,7 @@ |
93 | 93 | $wu = "http://$lang.wikipedia.org/wiki/" . urlencode($concept_name); |
94 | 94 | $cu = "$wwSelf?id=" . urlencode($concept) . "&lang=" . urlencode($lang); |
95 | 95 | |
96 | | - if (!$weight) $wclass = "x"; |
| 96 | + if (!isset($weight) || !$weight) $wclass = "x"; |
97 | 97 | else if ($weight>1000) $wclass = "huge"; |
98 | 98 | else if ($weight>100) $wclass = "big"; |
99 | 99 | else if ($weight>10) $wclass = "normal"; |
— | — | @@ -154,7 +154,7 @@ |
155 | 155 | </tr> |
156 | 156 | <?php } ?> |
157 | 157 | <?php |
158 | | - if ($weight && $weight<2 && $pos>=3) return false; |
| 158 | + if (isset($weight) && $weight && $weight<2 && $pos>=3) return false; |
159 | 159 | else return true; |
160 | 160 | } |
161 | 161 | |