7 |
return strtr(strtolower($str), "©ÐÈÆ®", "¹ðèæ¾"); |
return strtr(strtolower($str), "©ÐÈÆ®", "¹ðèæ¾"); |
8 |
} |
} |
9 |
|
|
10 |
|
function Letters() { return "ABCÈÆDÐEFGHIJKLMNOPQRS©TUVWXYZ®"; } |
11 |
|
|
12 |
function Slova($alpha_only = false) { |
function Slova($alpha_only = false) { |
13 |
$sl = array("A", "B", "C", "È", "Æ", "D", "Ð", "E", "F", |
$sl = preg_split('//', Letters()); |
14 |
"G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", |
array_pop($sl); // The final element is empty. |
|
"R", "S", "©", "T", "U", "V", "W", "X", "Y", "Z", "®"); |
|
15 |
if (!$alpha_only) array_unshift($sl, "@"); |
if (!$alpha_only) array_unshift($sl, "@"); |
16 |
return $sl; |
return $sl; |
17 |
} |
} |
18 |
|
|
19 |
function MyCompare($a, $b) { |
function MyCompare($a, $b) { |
20 |
$slova = "ABCÈÆDÐEFGHIJKLMNOPQRS©TUVWXYZ®"; |
$slova = Letters(); |
21 |
$weights = "\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32"; |
$weights = "\x14\x15\x16\x17\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F\x30\x31\x32"; |
22 |
return strcasecmp(strtr(MyUpper($a), $slova, $weights), |
return strcasecmp(strtr(MyUpper($a), $slova, $weights), |
23 |
strtr(MyUpper($b), $slova, $weights)); |
strtr(MyUpper($b), $slova, $weights)); |
24 |
} |
} |
25 |
|
|
26 |
function MyEscape($str) { |
function MyEscape($str) { |
27 |
$allowed = array("", "B", "I", "U", "UL", "OL", "LI"); |
return $str; |
28 |
$str = preg_replace("/(\<\/?\s*(\w+)>[^\>]*\>)/e", |
$allowed = array("", "A", "B", "I", "U", "UL", "OL", "LI"); |
29 |
"array_search(MyUpper('\\2'),\$allowed,false)?'\\1':HTMLSpecialChars('\\1')", |
$str = preg_replace("/(^\\s+|\\s+$)/", "", $str); |
30 |
$str); |
$str = preg_replace("/(\\<\\/?\\s*(\\w+)\\b[^\\>]*\\>)/e", "array_search(MyUpper('\\2'),". |
31 |
$str = preg_replace("/(^\s+|\s+$)/", "", $str); |
"\$allowed,false)?'\\1':HTMLSpecialChars('\\1')", $str); |
32 |
|
$str = preg_replace("/(\\<\\s*[aA]\\b)/", '\\1 target=_blank class=more', $str); |
33 |
$str = ereg_replace("\"", """, $str); |
$str = ereg_replace("\"", """, $str); |
34 |
return $str; |
return $str; |
35 |
} |
} |