Revision 442
Added by Matthias over 17 years ago
trunk/CHANGELOG | ||
---|---|---|
36 | 36 |
27-Dec-2006 Matthias Gallas |
37 | 37 |
# Fixed form modul stores empty records |
38 | 38 |
------------------------------------- 2.6.6 ------------------------------------- |
39 |
01-Apr-2007 Matthias Gallas |
|
40 |
# Fixed issues with some languages when UTF8 is used. Removed all htmlentites |
|
41 |
from the code (revoked changeset 396) and added new functions instead. Adapted the |
|
42 |
search and the highlighting to use the new functions. With this changes WB can now |
|
43 |
be used with charset UTF8 for all languages. |
|
39 | 44 |
12-Mar-2007 Matthias Gallas |
40 | 45 |
+ Added multilingual support to search |
41 | 46 |
03-Mar-2007 Matthias Gallas |
trunk/wb/search/search.php | ||
---|---|---|
28 | 28 |
exit(0); |
29 | 29 |
} |
30 | 30 |
|
31 |
// Include the WB functions file |
|
32 |
require_once(WB_PATH.'/framework/functions.php'); |
|
33 |
|
|
31 | 34 |
// Check if search is enabled |
32 | 35 |
if(SHOW_SEARCH != true) { |
33 | 36 |
echo $TEXT['SEARCH'].' '.$TEXT['DISABLED']; |
... | ... | |
55 | 58 |
// Double backslashes (mySQL needs doubly escaped backslashes in LIKE comparisons) |
56 | 59 |
$string = addslashes($wb->escape_backslashes($original_string)); |
57 | 60 |
// convert a copy of $string to HTML-ENTITIES |
58 |
$string_entities=mb_convert_encoding($string, 'UTF-8', 'HTML-ENTITIES'); |
|
59 |
$string_entities=htmlspecialchars($string_entities,ENT_QUOTES); |
|
60 |
$string_entities=mb_convert_encoding($string_entities, 'HTML-ENTITIES', 'UTF-8'); |
|
61 |
$string_entities = umlauts_to_entities($string); |
|
61 | 62 |
// and do some convertion to both |
62 | 63 |
require(WB_PATH.'/search/search_convert.php'); |
63 |
$string=strtr($string,$string_conv); |
|
64 |
$string_entities=strtr($string_entities,$string_entities_conv); |
|
64 |
if(strcmp(DEFAULT_CHARSET, "iso-8859-1") == 0) { |
|
65 |
$string=strtr($string,$string_conv_iso88591); |
|
66 |
$string_entities=strtr($string_entities,$string_entities_conv_iso88591); |
|
67 |
} |
|
65 | 68 |
$search_string = $string_entities; |
66 | 69 |
} else { |
67 | 70 |
$string = ''; |
... | ... | |
181 | 184 |
$link = page_link($page['link']); |
182 | 185 |
|
183 | 186 |
//Add search string for highlighting |
184 |
$sstring = implode(" ", array_merge($string,$string_entities)); |
|
185 |
//$link = $link."?searchresult=1&sstring=".$sstring; |
|
186 |
$link = $link."?searchresult=1&sstring=".urlencode($sstring); |
|
187 |
if ($match!='exact') { |
|
188 |
$sorted=array_merge($string,$string_entities); |
|
189 |
sort($sorted); |
|
190 |
$sstring = implode(" ", $sorted); |
|
191 |
$link = $link."?searchresult=1&sstring=".urlencode($sstring); |
|
192 |
} |
|
193 |
else { |
|
194 |
$sstring = strtr($string[0], " ", "_")." ".strtr($string_entities[0], " ","_"); |
|
195 |
$link = $link."?searchresult=2&sstring=".urlencode($sstring); |
|
196 |
} |
|
187 | 197 |
|
188 | 198 |
// Set vars to be replaced by values |
189 | 199 |
$vars = array('[LINK]', '[TITLE]', '[DESCRIPTION]', '[USERNAME]','[DISPLAY_NAME]','[DATE]','[TIME]','[TEXT_LAST_UPDATED_BY]','[TEXT_ON]'); |
... | ... | |
268 | 278 |
$link = page_link($page[$fields['link']]); |
269 | 279 |
|
270 | 280 |
//Add search string for highlighting |
271 |
$sstring = implode(" ", array_merge($string,$string_entities)); |
|
272 |
//$link = $link."?searchresult=1&sstring=".$sstring; |
|
273 |
$link = $link."?searchresult=1&sstring=".urlencode($sstring); |
|
281 |
if ($match!='exact') { |
|
282 |
$sorted=array_merge($string,$string_entities); |
|
283 |
sort($sorted); |
|
284 |
$sstring = implode(" ", $sorted); |
|
285 |
$link = $link."?searchresult=1&sstring=".urlencode($sstring); |
|
286 |
} |
|
287 |
else { |
|
288 |
$sstring = strtr($string[0], " ", "_")." ".strtr($string_entities[0], " ","_"); |
|
289 |
$link = $link."?searchresult=2&sstring=".urlencode($sstring); |
|
290 |
} |
|
274 | 291 |
|
275 | 292 |
// Set vars to be replaced by values |
276 | 293 |
$vars = array('[LINK]', '[TITLE]', '[DESCRIPTION]', '[USERNAME]','[DISPLAY_NAME]','[DATE]','[TIME]','[TEXT_LAST_UPDATED_BY]','[TEXT_ON]'); |
trunk/wb/search/search_convert.php | ||
---|---|---|
33 | 33 |
} |
34 | 34 |
|
35 | 35 |
//for Xinha, (htmlarea) |
36 |
$string_conv=array( |
|
36 |
$string_conv_iso88591=array(
|
|
37 | 37 |
"?"=>"Š","?"=>"š","?"=>"Œ","?"=>"œ","?"=>"Ÿ", |
38 | 38 |
">"=>">","<"=>"<", |
39 | 39 |
"?"=>"„","?"=>"•","?"=>"ˆ","Ν"=>"Ν","ν"=>"ν", |
... | ... | |
61 | 61 |
); |
62 | 62 |
|
63 | 63 |
//for fckeditor, (tiny_mce) |
64 |
$string_entities_conv=array( |
|
64 |
$string_entities_conv_iso88591=array(
|
|
65 | 65 |
"Œ"=>"Œ","œ"=>"œ","Š"=>"Š","š"=>"š", |
66 | 66 |
"Ÿ"=>"Ÿ", |
67 | 67 |
"˜"=>"˜","ϒ"=>"ϒ","•"=>"•","™"=>"™", |
trunk/wb/admin/pages/settings.php | ||
---|---|---|
76 | 76 |
$template->set_block('page', 'main_block', 'main'); |
77 | 77 |
$template->set_var(array( |
78 | 78 |
'PAGE_ID' => $results_array['page_id'], |
79 |
'PAGE_TITLE' => (htmlentities($results_array['page_title'])),
|
|
80 |
'MENU_TITLE' => (htmlentities($results_array['menu_title'])),
|
|
79 |
'PAGE_TITLE' => ($results_array['page_title']),
|
|
80 |
'MENU_TITLE' => ($results_array['menu_title']),
|
|
81 | 81 |
'DESCRIPTION' => ($results_array['description']), |
82 | 82 |
'KEYWORDS' => ($results_array['keywords']), |
83 | 83 |
'MODIFIED_BY' => $user['display_name'], |
... | ... | |
249 | 249 |
for($i = 1; $i <= $page['level']; $i++) { $title_prefix .= ' - '; } |
250 | 250 |
$template->set_var(array( |
251 | 251 |
'ID' => $page['page_id'], |
252 |
'TITLE' => ($title_prefix.htmlentities($page['page_title']))
|
|
252 |
'TITLE' => ($title_prefix.$page['page_title'])
|
|
253 | 253 |
) |
254 | 254 |
); |
255 | 255 |
if($results_array['parent'] == $page['page_id']) { |
trunk/wb/admin/pages/index.php | ||
---|---|---|
166 | 166 |
</td> |
167 | 167 |
<?php if($admin->get_permission('pages_modify') == true AND $can_modify == true) { ?> |
168 | 168 |
<td> |
169 |
<a href="<?php echo ADMIN_URL; ?>/pages/modify.php?page_id=<?php echo $page['page_id']; ?>" title="<?php echo $TEXT['MODIFY']; ?>"><?php echo (htmlentities($page['page_title'])); ?></a>
|
|
169 |
<a href="<?php echo ADMIN_URL; ?>/pages/modify.php?page_id=<?php echo $page['page_id']; ?>" title="<?php echo $TEXT['MODIFY']; ?>"><?php echo ($page['page_title']); ?></a>
|
|
170 | 170 |
</td> |
171 | 171 |
<?php } else { ?> |
172 | 172 |
<td> |
173 |
<?php echo (htmlentities($page['page_title'])); ?>
|
|
173 |
<?php echo ($page['page_title']); ?>
|
|
174 | 174 |
</td> |
175 | 175 |
<?php } ?> |
176 | 176 |
<td align="left" width="232"> |
177 |
<font color="#999999"><?php echo (htmlentities($page['menu_title'])); ?></font>
|
|
177 |
<font color="#999999"><?php echo ($page['menu_title']); ?></font>
|
|
178 | 178 |
</td> |
179 | 179 |
<td align="center" valign="middle" width="90"> |
180 | 180 |
<?php if($page['visibility'] == 'public') { ?> |
... | ... | |
462 | 462 |
for($i = 1; $i <= $page['level']; $i++) { $title_prefix .= ' - '; } |
463 | 463 |
$template->set_var(array( |
464 | 464 |
'ID' => $page['page_id'], |
465 |
'TITLE' => ($title_prefix.htmlentities($page['page_title']))
|
|
465 |
'TITLE' => ($title_prefix.$page['page_title'])
|
|
466 | 466 |
) |
467 | 467 |
); |
468 | 468 |
if($can_modify == true) { |
trunk/wb/admin/pages/trash.php | ||
---|---|---|
141 | 141 |
</td> |
142 | 142 |
<?php if($admin->get_permission('pages_modify') == true AND $can_modify == true AND $page['visibility'] != 'heading') { ?> |
143 | 143 |
<td> |
144 |
<a href="<?php echo ADMIN_URL; ?>/pages/modify.php?page_id=<?php echo $page['page_id']; ?>" title="<?php echo $TEXT['MODIFY']; ?>"><?php echo (htmlentities($page['page_title'])); ?></a>
|
|
144 |
<a href="<?php echo ADMIN_URL; ?>/pages/modify.php?page_id=<?php echo $page['page_id']; ?>" title="<?php echo $TEXT['MODIFY']; ?>"><?php echo ($page['page_title']); ?></a>
|
|
145 | 145 |
</td> |
146 | 146 |
<?php } else { ?> |
147 | 147 |
<td> |
148 | 148 |
<?php |
149 | 149 |
if($page['visibility'] != 'heading') { |
150 |
echo (htmlentities($page['page_title']));
|
|
150 |
echo ($page['page_title']);
|
|
151 | 151 |
} else { |
152 |
echo '<b>'.(htmlentities($page['page_title'])).'</b>';
|
|
152 |
echo '<b>'.($page['page_title']).'</b>';
|
|
153 | 153 |
} |
154 | 154 |
?> |
155 | 155 |
</td> |
156 | 156 |
<?php } ?> |
157 | 157 |
<td align="left" width="232"> |
158 |
<font color="#999999"><?php echo htmlentities($page['menu_title']); ?></font>
|
|
158 |
<font color="#999999"><?php echo $page['menu_title']; ?></font>
|
|
159 | 159 |
</td> |
160 | 160 |
<td align="right" valign="middle" width="30" style="padding-right: 20px;"> |
161 | 161 |
<?php if($page['visibility'] == 'public') { ?> |
trunk/wb/admin/pages/settings2.php | ||
---|---|---|
41 | 41 |
|
42 | 42 |
// Get values |
43 | 43 |
$page_title = $admin->add_slashes($admin->get_post_escaped('page_title')); |
44 |
$page_title = my_htmlspecialchars($page_title); |
|
44 | 45 |
$menu_title = $admin->add_slashes($admin->get_post_escaped('menu_title')); |
46 |
$menu_title = my_htmlspecialchars($menu_title); |
|
45 | 47 |
$description = $admin->add_slashes($admin->get_post('description')); |
46 | 48 |
$keywords = $admin->add_slashes($admin->get_post('keywords')); |
47 | 49 |
$parent = $admin->get_post('parent'); |
trunk/wb/admin/pages/sections.php | ||
---|---|---|
138 | 138 |
</td> |
139 | 139 |
<td align="right"> |
140 | 140 |
<?php echo $TEXT['CURRENT_PAGE']; ?>: |
141 |
<b><?php echo (htmlentities($results_array['page_title'])); ?></b>
|
|
141 |
<b><?php echo ($results_array['page_title']); ?></b>
|
|
142 | 142 |
- |
143 | 143 |
<a href="<?php echo ADMIN_URL; ?>/pages/modify.php?page_id=<?php echo $page_id; ?>"><?php echo $HEADING['MODIFY_PAGE']; ?></a> |
144 | 144 |
- |
trunk/wb/admin/pages/modify.php | ||
---|---|---|
60 | 60 |
$template->set_block('page', 'main_block', 'main'); |
61 | 61 |
$template->set_var(array( |
62 | 62 |
'PAGE_ID' => $results_array['page_id'], |
63 |
'PAGE_TITLE' => (htmlentities($results_array['page_title'])),
|
|
63 |
'PAGE_TITLE' => ($results_array['page_title']),
|
|
64 | 64 |
'MODIFIED_BY' => $user['display_name'], |
65 | 65 |
'MODIFIED_BY_USERNAME' => $user['username'], |
66 | 66 |
'MODIFIED_WHEN' => $modified_ts, |
trunk/wb/admin/pages/add.php | ||
---|---|---|
33 | 33 |
|
34 | 34 |
// Get values |
35 | 35 |
$title = $admin->add_slashes($admin->get_post_escaped('title')); |
36 |
$title = my_htmlspecialchars($title); |
|
36 | 37 |
$module = $admin->get_post('type'); |
37 | 38 |
$parent = $admin->get_post('parent'); |
38 | 39 |
$visibility = $admin->get_post('visibility'); |
trunk/wb/framework/convert.php | ||
---|---|---|
25 | 25 |
|
26 | 26 |
/* |
27 | 27 |
Character Conversion file |
28 |
This file helps convert possible error-causing |
|
29 |
characters to equivalent non-error-causing ones |
|
28 |
to convert some entities to there 7bit equivalents |
|
30 | 29 |
*/ |
31 | 30 |
if(!defined('WB_URL')) { |
32 | 31 |
header('Location: ../index.php'); |
... | ... | |
34 | 33 |
} |
35 | 34 |
|
36 | 35 |
$conversion_array = array( |
37 |
'À'=>'A','�?'=>'A','Â'=>'A','Ã'=>'A','Ä'=>'Ae', 'Ä'=>'A', |
|
38 |
'Å'=>'A','Ā'=>'A','Ą'=>'A','Ă'=>'A', 'Æ'=>'Ae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', 'à'=>'a','á'=>'a','â'=>'a','ã'=>'a','ä'=>'ae', |
|
58 |
'ä'=>'ae', 'å'=>'a','�?'=>'a','ą'=>'a','ă'=>'a', |
|
59 |
'æ'=>'ae', 'ç'=>'c','ć'=>'c','�?'=>'c','ĉ'=>'c','ċ'=>'c', |
|
60 |
'�?'=>'d','đ'=>'d','ð'=>'d', 'è'=>'e','é'=>'e','ê'=>'e','ë'=>'e','ē'=>'e', |
|
61 |
'ę'=>'e','ě'=>'e','ĕ'=>'e','ė'=>'e', 'ƒ'=>'f', |
|
62 |
'�?'=>'g','ğ'=>'g','ġ'=>'g','ģ'=>'g', 'ĥ'=>'h','ħ'=>'h', |
|
63 |
'ì'=>'i','í'=>'i','î'=>'i','ï'=>'i','ī'=>'i', 'ĩ'=>'i','ĭ'=>'i','į'=>'i','ı'=>'i', |
|
64 |
'ij'=>'ij', 'ĵ'=>'j', 'ķ'=>'k','ĸ'=>'k', 'ł'=>'l','ľ'=>'l','ĺ'=>'l','ļ'=>'l','ŀ'=>'l', |
|
65 |
'ñ'=>'n','ń'=>'n','ň'=>'n','ņ'=>'n','ʼn'=>'n', 'ŋ'=>'n', |
|
66 |
'ò'=>'o','ó'=>'o','ô'=>'o','õ'=>'o','ö'=>'oe', 'ö'=>'oe', |
|
67 |
'ø'=>'o','�?'=>'o','ő'=>'o','�?'=>'o', 'œ'=>'oe', 'ŕ'=>'r','ř'=>'r','ŗ'=>'r', |
|
68 |
'š'=>'s', 'ù'=>'u','ú'=>'u','û'=>'u','ü'=>'ue','ū'=>'u', 'ü'=>'ue', |
|
69 |
'ů'=>'u','ű'=>'u','ŭ'=>'u','ũ'=>'u','ų'=>'u', 'ŵ'=>'w', |
|
70 |
'ý'=>'y','ÿ'=>'y','ŷ'=>'y', 'ž'=>'z','ż'=>'z','ź'=>'z', 'þ'=>'t', 'ß'=>'ss', 'ſ'=>'ss', |
|
71 |
'ä'=>'ae', 'ö'=>'oe', 'ü'=>'ue', 'Ä'=>'Ae', 'Ö'=>'Oe', 'Ü'=>'Ue' |
|
36 |
|
|
37 |
//### LATIN |
|
38 |
'Á'=>'A','á'=>'a','Â'=>'A','â'=>'a','Æ'=>'AE','æ'=>'ae','À'=>'A','à'=>'a','Å'=>'A','å'=>'a','Ã'=>'A','ã'=>'a','Ä'=>'AE','ä'=>'ae', |
|
39 |
'Ç'=>'C','ç'=>'c', |
|
40 |
'É'=>'E','é'=>'e','Ê'=>'E','ê'=>'e','È'=>'E','è'=>'e','Ë'=>'E','ë'=>'e', |
|
41 |
'Í'=>'I','í'=>'i','Î'=>'I','î'=>'i','Ì'=>'I','ì'=>'i','Ï'=>'I','ï'=>'i', |
|
42 |
'Ñ'=>'N','ñ'=>'n', |
|
43 |
'Ó'=>'O','ó'=>'o','Ô'=>'O','ô'=>'o','Œ'=>'OE','œ'=>'oe','Ò'=>'O','ò'=>'o','Õ'=>'O','õ'=>'o','Ö'=>'OE','ö'=>'oe', |
|
44 |
'Š'=>'S','š'=>'s', |
|
45 |
'ß'=>'ss', |
|
46 |
'Ú'=>'U','ú'=>'u','Û'=>'U','û'=>'u','Ù'=>'U','ù'=>'u','Ü'=>'UE','ü'=>'ue', |
|
47 |
'Ý'=>'Y','ý'=>'y','Ÿ'=>'Y','ÿ'=>'y', |
|
48 |
'Š'=>'S', |
|
49 |
'Œ'=>'OE','œ'=>'oe', |
|
50 |
'š'=>'s', |
|
51 |
'Ÿ'=>'Y', |
|
52 |
'©'=>'(c)','®'=>'(r)','Ð'=>'D','×'=>'x','Ø'=>'O','Þ'=>'TH','ð'=>'d','ø'=>'o','þ'=>'th', |
|
53 |
|
|
54 |
// latin extended-A |
|
55 |
'Ā'=>'A','ā'=>'a','Ă'=>'A','ă'=>'a','Ą'=>'A','ą'=>'a', |
|
56 |
'Ć'=>'C','ć'=>'c','Ĉ'=>'C','ĉ'=>'c','č'=>'c','Č'=>'C','ċ'=>'c','Ċ'=>'C', |
|
57 |
'đ'=>'d','Đ'=>'D','ď'=>'d','Ď'=>'D',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'=>'V','ṽ'=>'v','Ṿ'=>'V','ṿ'=>'v', |
|
134 |
'Ẁ'=>'W','ẁ'=>'w','Ẃ'=>'W','ẃ'=>'w','Ẅ'=>'W','ẅ'=>'w','Ẇ'=>'W','ẇ'=>'w','Ẉ'=>'W','ẉ'=>'w', |
|
135 |
'Ẋ'=>'X','ẋ'=>'x','Ẍ'=>'X','ẍ'=>'x', |
|
136 |
'Ẏ'=>'Y','ẏ'=>'y', |
|
137 |
'Ẑ'=>'Z','ẑ'=>'z','Ẓ'=>'Z','ẓ'=>'z','Ẕ'=>'Z','ẕ'=>'z', |
|
138 |
'ẖ'=>'h', |
|
139 |
'ẗ'=>'t', |
|
140 |
'ẘ'=>'w', |
|
141 |
'ẙ'=>'y', |
|
142 |
'ẚ'=>'a', |
|
143 |
'ẛ'=>'f', |
|
144 |
'Ạ'=>'A','ạ'=>'a','Ả'=>'A','ả'=>'a','Ấ'=>'A','ấ'=>'a','Ầ'=>'A','ầ'=>'a','Ẩ'=>'A','ẩ'=>'a', |
|
145 |
'Ẫ'=>'A','ẫ'=>'a','Ậ'=>'A','ậ'=>'a','Ắ'=>'A','ắ'=>'a','Ằ'=>'A','ằ'=>'a','Ẳ'=>'A','ẳ'=>'a','Ẵ'=>'A','ẵ'=>'a','Ặ'=>'A','ặ'=>'a', |
|
146 |
'Ẹ'=>'E','ẹ'=>'e','Ẻ'=>'E','ẻ'=>'e','Ẽ'=>'E','ẽ'=>'e','Ế'=>'E','ế'=>'e','Ề'=>'E','ề'=>'e','Ể'=>'E','ể'=>'e','Ễ'=>'E','ễ'=>'e','Ệ'=>'E','ệ'=>'e', |
|
147 |
'Ỉ'=>'I','ỉ'=>'i','Ị'=>'I','ị'=>'i', |
|
148 |
'Ọ'=>'O','ọ'=>'o','Ỏ'=>'O','ỏ'=>'o','Ố'=>'O','ố'=>'o','Ồ'=>'O','ồ'=>'o','Ổ'=>'O','ổ'=>'o','Ỗ'=>'O','ỗ'=>'o', |
|
149 |
'Ộ'=>'O','ộ'=>'o','Ớ'=>'O','ớ'=>'o','Ờ'=>'O','ờ'=>'o','Ở'=>'O','ở'=>'o','Ỡ'=>'O','ỡ'=>'o','Ợ'=>'O','ợ'=>'o', |
|
150 |
'Ụ'=>'U','ụ'=>'u','Ủ'=>'U','ủ'=>'u','Ứ'=>'U','ứ'=>'u','Ừ'=>'U','ừ'=>'u','Ử'=>'U','ử'=>'u','Ữ'=>'U','ữ'=>'u','Ự'=>'U','ự'=>'u', |
|
151 |
'Ỳ'=>'Y','ỳ'=>'y','Ỵ'=>'Y','ỵ'=>'y','Ỷ'=>'Y','ỷ'=>'y','Ỹ'=>'Y','ỹ'=>'y', |
|
152 |
|
|
153 |
//### CYRILLIC (transliteration following iso 9:1995) |
|
154 |
'А'=>'A','а'=>'a', |
|
155 |
'Ӑ'=>'A','ӑ'=>'a', |
|
156 |
'Ӓ'=>'A','ӓ'=>'a', |
|
157 |
'Ә'=>'A','ә'=>'a', |
|
158 |
'Б'=>'B','б'=>'b', |
|
159 |
'В'=>'V','в'=>'v', |
|
160 |
'Г'=>'G','г'=>'g', |
|
161 |
'Ґ'=>'G','ґ'=>'g', |
|
162 |
'Ҕ'=>'G','ҕ'=>'g', |
|
163 |
'Ғ'=>'G','ғ'=>'g', |
|
164 |
'Д'=>'D','д'=>'d', |
|
165 |
'Ђ'=>'D','ђ'=>'d', |
|
166 |
'Ѓ'=>'G','ѓ'=>'g', |
|
167 |
'Е'=>'E','е'=>'e', |
|
168 |
'Ё'=>'E','ё'=>'e', |
|
169 |
'Ӗ'=>'E','ӗ'=>'e', |
|
170 |
'Є'=>'E','є'=>'e', |
|
171 |
'Ҽ'=>'C','ҽ'=>'c', |
|
172 |
'Ҿ'=>'C','ҿ'=>'c', |
|
173 |
'Ж'=>'Z','ж'=>'z', |
|
174 |
'Ӂ'=>'Z','ӂ'=>'z', |
|
175 |
'Ӝ'=>'Z','ӝ'=>'z', |
|
176 |
'Җ'=>'Z','җ'=>'z', |
|
177 |
'З'=>'Z','з'=>'z', |
|
178 |
'Ӟ'=>'Z','ӟ'=>'z', |
|
179 |
'Ѕ'=>'Z','ѕ'=>'z', |
|
180 |
'Ӡ'=>'Z','ӡ'=>'z', |
|
181 |
'И'=>'I','и'=>'i', |
|
182 |
'Ӥ'=>'I','ӥ'=>'i', |
|
183 |
'І'=>'I','і'=>'i', |
|
184 |
'Ї'=>'I','ї'=>'i', |
|
185 |
'Й'=>'J','й'=>'j', |
|
186 |
'Ј'=>'J','ј'=>'j', |
|
187 |
'К'=>'K','к'=>'k', |
|
188 |
'Қ'=>'K','қ'=>'k', |
|
189 |
'Ҟ'=>'K','ҟ'=>'k', |
|
190 |
'Л'=>'L','л'=>'l', |
|
191 |
'Љ'=>'L','љ'=>'l', |
|
192 |
'М'=>'M','м'=>'m', |
|
193 |
'Н'=>'N','н'=>'n', |
|
194 |
'Њ'=>'N','њ'=>'n', |
|
195 |
'Ҥ'=>'N','ҥ'=>'n', |
|
196 |
'Ң'=>'N','ң'=>'n', |
|
197 |
'О'=>'O','о'=>'o', |
|
198 |
'Ӧ'=>'O','ӧ'=>'o', |
|
199 |
'Ө'=>'O','ө'=>'o', |
|
200 |
'П'=>'P','п'=>'p', |
|
201 |
'Ҧ'=>'P','ҧ'=>'p', |
|
202 |
'Р'=>'R','р'=>'r', |
|
203 |
'С'=>'S','с'=>'s', |
|
204 |
'Ҫ'=>'C','ҫ'=>'c', |
|
205 |
'Т'=>'T','т'=>'t', |
|
206 |
'Ҭ'=>'T','ҭ'=>'t', |
|
207 |
'Ћ'=>'C','ћ'=>'c', |
|
208 |
'Ќ'=>'K','ќ'=>'k', |
|
209 |
'У'=>'U','у'=>'u', |
|
210 |
'Ў'=>'U','ў'=>'u', |
|
211 |
'Ӱ'=>'U','ӱ'=>'u', |
|
212 |
'Ӳ'=>'U','ӳ'=>'u', |
|
213 |
'Ү'=>'U','ү'=>'u', |
|
214 |
'Ф'=>'F','ф'=>'f', |
|
215 |
'Х'=>'H','х'=>'h', |
|
216 |
'Ҳ'=>'H','ҳ'=>'h', |
|
217 |
'Һ'=>'H','һ'=>'h', |
|
218 |
'Ц'=>'C','ц'=>'c', |
|
219 |
'Ҵ'=>'C','ҵ'=>'c', |
|
220 |
'Ч'=>'C','ч'=>'c', |
|
221 |
'Ӵ'=>'C','ӵ'=>'c', |
|
222 |
'Ҷ'=>'C','ҷ'=>'c', |
|
223 |
'Џ'=>'D','џ'=>'d', |
|
224 |
'Ш'=>'S','ш'=>'s', |
|
225 |
'Щ'=>'S','щ'=>'s', |
|
226 |
'Ы'=>'Y','ы'=>'y', |
|
227 |
'Ӹ'=>'Y','ӹ'=>'y', |
|
228 |
'Э'=>'E','э'=>'e', |
|
229 |
'Ю'=>'U','ю'=>'u', |
|
230 |
'Я'=>'A','я'=>'a', |
|
231 |
'Ѣ'=>'E','ѣ'=>'e', |
|
232 |
'Ѫ'=>'A','ѫ'=>'a', |
|
233 |
'Ѳ'=>'F','ѳ'=>'f', |
|
234 |
'Ѵ'=>'Y','ѵ'=>'y', |
|
235 |
'Ҩ'=>'O','ҩ'=>'o', |
|
236 |
// ? |
|
237 |
'Ъ'=>'-', |
|
238 |
'Ь'=>'-', |
|
239 |
'Ӏ'=>'-', |
|
240 |
'ь'=>'-', |
|
241 |
'́'=>'', |
|
242 |
|
|
243 |
//### (new) GREEK (transcription following wikipedia: http://de.wikipedia.org/w/index.php?title=Wikipedia:Namenskonventionen/Neugriechisch&oldid=29601735 ) |
|
244 |
// groups of two chars |
|
245 |
'αι'=>'e','Αι'=>'E', |
|
246 |
'ει'=>'i','Ει'=>'I', |
|
247 |
'οι'=>'i','Οι'=>'I', |
|
248 |
'ου'=>'ou','Ου'=>'Ou', |
|
249 |
'αυ'=>'av','Αυ'=>'Av', |
|
250 |
'ευ'=>'ev','Ευ'=>'Ev', |
|
251 |
'ηυ'=>'iv','Ηυ'=>'Iv', |
|
252 |
'μπ'=>'mp','Μπ'=>'B', |
|
253 |
'ντ'=>'nt','Ντ'=>'D', |
|
254 |
'τζ'=>'tz','Τζ'=>'Tz', |
|
255 |
'γκ'=>'ng','Γκ'=>'G', |
|
256 |
'γγ'=>'ng','Γγ'=>'Ng', |
|
257 |
// single chars |
|
258 |
'Ά'=>'A','Έ'=>'E','Ή'=>'I','Ί'=>'I','Ό'=>'O','Ύ'=>'Y','Ώ'=>'O','ΐ'=>'i', |
|
259 |
'Α'=>'A','Β'=>'V','Γ'=>'G','Δ'=>'D','Ε'=>'E','Ζ'=>'Z','Η'=>'I','Θ'=>'Th','Ι'=>'I','Κ'=>'K','Λ'=>'L','Μ'=>'M','Ν'=>'N','Ξ'=>'X','Ο'=>'O','Π'=>'P','Ρ'=>'R','Σ'=>'S','Τ'=>'T','Υ'=>'Y','Φ'=>'F','Χ'=>'Ch','Ψ'=>'Ps','Ω'=>'O', |
|
260 |
'Ϊ'=>'I','Ϋ'=>'Y','ά'=>'a','έ'=>'e','ή'=>'i','ί'=>'i','ΰ'=>'y', |
|
261 |
'α'=>'a','β'=>'v','γ'=>'g','δ'=>'d','ε'=>'e','ζ'=>'z','η'=>'i','θ'=>'th','ι'=>'i','κ'=>'k','λ'=>'l','μ'=>'m','ν'=>'n','ξ'=>'x','ο'=>'o','π'=>'p','ρ'=>'r','ς'=>'s','σ'=>'s','τ'=>'t','υ'=>'y','φ'=>'f','χ'=>'ch','ψ'=>'ps','ω'=>'o', |
|
262 |
'ϊ'=>'i','ϋ'=>'y','ό'=>'o','ύ'=>'y','ώ'=>'o','ϐ'=>'b','ϑ'=>'th','ϒ'=>'y','ϓ'=>'y','ϔ'=>'y' |
|
263 |
|
|
72 | 264 |
); |
73 | 265 |
|
74 | 266 |
?> |
trunk/wb/framework/class.frontend.php | ||
---|---|---|
72 | 72 |
$content = @fread($handle, filesize($filename)); |
73 | 73 |
@fclose($handle); |
74 | 74 |
$this->preprocess($content); |
75 |
header("Location: pages/intro.php"); // send intro.php as header to allow parsing of php statements
|
|
75 |
header("Location: pages/intro.php"); // send intro.php as header to allow parsing of php statements
|
|
76 | 76 |
echo ($content); |
77 | 77 |
return false; |
78 | 78 |
} |
... | ... | |
140 | 140 |
// Page ID |
141 | 141 |
define('PAGE_ID', $this->page['page_id']); |
142 | 142 |
// Page Title |
143 |
define('PAGE_TITLE', htmlentities(($this->page['page_title'])));
|
|
143 |
define('PAGE_TITLE', $this->page['page_title']);
|
|
144 | 144 |
$this->page_title=PAGE_TITLE; |
145 | 145 |
// Menu Title |
146 |
$menu_title = htmlentities($this->page['menu_title']);
|
|
146 |
$menu_title = $this->page['menu_title'];
|
|
147 | 147 |
if($menu_title != '') { |
148 | 148 |
define('MENU_TITLE', $menu_title); |
149 | 149 |
} else { |
... | ... | |
354 | 354 |
$link = $this->page_link($page['link']); |
355 | 355 |
} |
356 | 356 |
// Create values |
357 |
$values = array($class,'<a href="'.$link.'" target="'.$page['target'].'" '.$class.'>', '</a>', htmlentities($page['menu_title']), htmlentities($page['page_title']));
|
|
357 |
$values = array($class,'<a href="'.$link.'" target="'.$page['target'].'" '.$class.'>', '</a>', $page['menu_title'], $page['page_title']);
|
|
358 | 358 |
// Replace vars with value and print |
359 | 359 |
echo "\n".str_replace($vars, $values, $this->menu_item_template); |
360 | 360 |
// Generate sub-menu |
trunk/wb/framework/frontend.functions.php | ||
---|---|---|
73 | 73 |
// filter meta-characters |
74 | 74 |
$string=preg_quote($string, '/'); |
75 | 75 |
if ($string!=$last_string ) { |
76 |
$foo=preg_replace('/('.$string.')(?=[^>;]*(&|<))/iUS', '<span class="highlight">$1</span>',$foo);
|
|
76 |
$foo=preg_replace('/((>|;)[^&<]*)('.$string.')(?=[^>;]*(&|<))/iUS', '$1<span class="highlight">$3</span>',$foo);
|
|
77 | 77 |
$last_string=$string; |
78 | 78 |
} |
79 | 79 |
} |
... | ... | |
184 | 184 |
if (isset($_GET['searchresult']) AND is_numeric($_GET['searchresult']) ) { |
185 | 185 |
if (isset($_GET['sstring']) AND !empty($_GET['sstring']) ){ |
186 | 186 |
$arr_string = explode(" ", $_GET['sstring']); |
187 |
if($_GET['searchresult'] == 2) { |
|
188 |
// exact match |
|
189 |
$arr_string[0] = strtr($arr_string[0], "_"," "); |
|
190 |
$arr_string[1] = strtr($arr_string[1], "_"," "); |
|
191 |
} |
|
187 | 192 |
ob_start(); //start output buffer |
188 | 193 |
require(WB_PATH.'/modules/'.$module.'/view.php'); |
189 | 194 |
$foo = ob_get_contents(); // put outputbuffer in $foo |
... | ... | |
223 | 228 |
$query_menu=$database->query("SELECT menu_title,link FROM ".TABLE_PREFIX."pages WHERE page_id=$temp"); |
224 | 229 |
$page=$query_menu->fetchRow(); |
225 | 230 |
if ($links==true AND $temp!=$page_id) |
226 |
echo '<a href="'.page_link($page['link']).'">'.htmlentities($page['menu_title']).'</a>';
|
|
231 |
echo '<a href="'.page_link($page['link']).'">'.$page['menu_title'].'</a>';
|
|
227 | 232 |
else |
228 |
echo htmlentities($page['menu_title']);
|
|
233 |
echo $page['menu_title'];
|
|
229 | 234 |
} |
230 | 235 |
$counter++; |
231 | 236 |
} |
trunk/wb/framework/functions.php | ||
---|---|---|
338 | 338 |
return $subs; |
339 | 339 |
} |
340 | 340 |
|
341 |
// Function as replecement for php's htmlspecialchars() |
|
342 |
function my_htmlspecialchars($string) { |
|
343 |
$string = umlauts_to_entities($string); |
|
344 |
$string = entities_to_umlauts($string); |
|
345 |
return($string); |
|
346 |
} |
|
347 |
|
|
348 |
// Function to get the DEFAULT_CHARSET |
|
349 |
function get_wbcharset() { |
|
350 |
$charset=strtoupper(DEFAULT_CHARSET); |
|
351 |
if(strcmp($charset,"BIG5") == 0) { |
|
352 |
$charset="BIG-5"; |
|
353 |
} |
|
354 |
return($charset); |
|
355 |
} |
|
356 |
|
|
357 |
// Function to convert a string from $from- to $to-encoding, using mysql |
|
358 |
function my_mysql_iconv($string, $from, $to) { |
|
359 |
// keep current character set values: |
|
360 |
$character_set_database = mysql_result(mysql_query("SELECT @@character_set_client"),0,0); |
|
361 |
$character_set_results = mysql_result(mysql_query("SELECT @@character_set_results"),0,0); |
|
362 |
$collation_results = mysql_result(mysql_query("SELECT @@collation_connection"),0,0); |
|
363 |
mysql_query("SET character_set_client=$from"); |
|
364 |
mysql_query("SET character_set_results=$to"); |
|
365 |
mysql_query("SET collation_connection=utf8_unicode_ci"); |
|
366 |
$string_escaped = mysql_real_escape_string($string); |
|
367 |
$converted_string = mysql_result(mysql_query("SELECT '$string_escaped'"),0,0); |
|
368 |
// restore previous character set values: |
|
369 |
mysql_query("SET character_set_client=$character_set_database"); |
|
370 |
mysql_query("SET character_set_results=$character_set_results"); |
|
371 |
mysql_query("SET collation_connection=$collation_results"); |
|
372 |
return $converted_string; |
|
373 |
} |
|
374 |
|
|
375 |
// Function to convert a string from html-entities to umlauts |
|
376 |
// and encode htmlspecialchars |
|
377 |
function entities_to_umlauts($string) { |
|
378 |
$charset = get_wbcharset(); |
|
379 |
// there's no GB2312 or ISO-8859-11 encoding in php's mb_* functions |
|
380 |
if (strcmp($charset,"GB2312") == 0) { |
|
381 |
if(function_exists('iconv')) { |
|
382 |
$string=mb_convert_encoding($string,'UTF-8','HTML-ENTITIES'); |
|
383 |
$string=iconv("UTF-8","GB2312",$string); |
|
384 |
} else { |
|
385 |
$string=mb_convert_encoding($string,'UTF-8','HTML-ENTITIES'); |
|
386 |
$string=my_mysql_iconv($string, 'utf8', 'gb2312'); |
|
387 |
} |
|
388 |
} elseif (strcmp($charset,"ISO-8859-11") == 0) { |
|
389 |
if(function_exists('iconv')) { |
|
390 |
$string=mb_convert_encoding($string,'UTF-8','HTML-ENTITIES'); |
|
391 |
$string=iconv("UTF-8","ISO-8859-11",$string); |
|
392 |
} else { |
|
393 |
$string=mb_convert_encoding($string,'UTF-8','HTML-ENTITIES'); |
|
394 |
$string=my_mysql_iconv($string, 'utf8', 'tis620'); |
|
395 |
} |
|
396 |
} else { |
|
397 |
$string=mb_convert_encoding($string,$charset,'HTML-ENTITIES'); |
|
398 |
} |
|
399 |
$string=htmlspecialchars($string); |
|
400 |
return($string); |
|
401 |
} |
|
402 |
|
|
403 |
// Function to convert a string from umlauts to html-entities |
|
404 |
// and encode htmlspecialchars |
|
405 |
function umlauts_to_entities($string) { |
|
406 |
$charset=get_wbcharset(); |
|
407 |
// there's no GB2312 or ISO-8859-11 encoding in php's mb_* functions |
|
408 |
if (strcmp($charset,"GB2312") == 0) { |
|
409 |
if(function_exists('iconv')) { |
|
410 |
$string=iconv("GB2312","UTF-8",$string); |
|
411 |
$charset="UTF-8"; |
|
412 |
} else { |
|
413 |
$string=my_mysql_iconv($string, 'gb2312', 'utf8'); |
|
414 |
$charset="UTF-8"; |
|
415 |
} |
|
416 |
} elseif (strcmp($charset,"ISO-8859-11") == 0) { |
|
417 |
if(function_exists('iconv')) { |
|
418 |
$string=iconv("ISO-8859-11","UTF-8",$string); |
|
419 |
$charset="UTF-8"; |
|
420 |
} else { |
|
421 |
$string=my_mysql_iconv($string, 'tis620', 'utf8'); |
|
422 |
$charset="UTF-8"; |
|
423 |
} |
|
424 |
} |
|
425 |
$string=mb_convert_encoding($string,'HTML-ENTITIES',$charset); |
|
426 |
$string=mb_convert_encoding($string,'UTF-8','HTML-ENTITIES'); |
|
427 |
$string=htmlspecialchars($string,ENT_QUOTES); |
|
428 |
$string=mb_convert_encoding($string,'HTML-ENTITIES','UTF-8'); |
|
429 |
return($string); |
|
430 |
} |
|
431 |
|
|
432 |
// translate any "latin" html-entities to their plain 7bit equivalents |
|
433 |
function entities_to_7bit($string) { |
|
434 |
require(WB_PATH.'/framework/convert.php'); |
|
435 |
$string = strtr($string, $conversion_array); |
|
436 |
return($string); |
|
437 |
} |
|
438 |
|
|
341 | 439 |
// Function to convert a page title to a page filename |
342 | 440 |
function page_filename($string) { |
343 |
// First, translate any non-english characters to their english equivalents |
|
344 |
require(WB_PATH.'/framework/convert.php'); |
|
345 |
$string = strtr($string, $conversion_array); |
|
441 |
$string = entities_to_7bit(umlauts_to_entities($string)); |
|
346 | 442 |
// Now replace spaces with page spcacer |
347 | 443 |
$string = str_replace(' ', PAGE_SPACER, $string); |
348 | 444 |
// Now remove all bad characters |
... | ... | |
371 | 467 |
|
372 | 468 |
// Function to convert a desired media filename to a clean filename |
373 | 469 |
function media_filename($string) { |
374 |
// First, translate any non-english characters to their english equivalents |
|
375 |
require(WB_PATH.'/framework/convert.php'); |
|
376 |
$string = strtr($string, $conversion_array); |
|
470 |
$string = entities_to_7bit(umlauts_to_entities($string)); |
|
377 | 471 |
// Now remove all bad characters |
378 | 472 |
$bad = array( |
379 | 473 |
'\'', // ' |
Also available in: Unified diff
Fixed issues with some languages when UTF8 is used.
Removed all htmlentites from the code (revoked changeset [396]) and added new functions instead.
Adapted the search and the highlighting to use the new functions.
With this changes WB can now be used with charset UTF8 for all languages.