if (empty($pages))
return str_replace('$1', $s_word, $_msg_notfoundresult);
- ksort($pages);
+ ksort($pages, SORT_STRING);
$retval = '<ul>' . "\n";
foreach (array_keys($pages) as $page) {
}
// Encode page-name
-function encode($key)
+function encode($str)
{
- return ($key == '') ? '' : strtoupper(bin2hex($key));
+ $str = strval($str);
+ return ($str == '') ? '' : strtoupper(bin2hex($str));
// Equal to strtoupper(join('', unpack('H*0', $key)));
// But PHP 4.3.10 says 'Warning: unpack(): Type H: outside of string in ...'
}
// Decode page name
-function decode($key)
+function decode($str)
{
- return pkwk_hex2bin($key);
+ return pkwk_hex2bin($str);
}
// Inversion of bin2hex()
}
} else {
$head = (preg_match('/^([A-Za-z])/', $page, $matches)) ? $matches[1] :
- (preg_match('/^([ -~])/', $page, $matches) ? $symbol : $other);
+ (preg_match('/^([ -~])/', $page) ? $symbol : $other);
}
$list[$head][$page] = $str;
}
// Sugar with default settings
-function htmlsc($string = '', $flags = ENT_QUOTES, $charset = CONTENT_CHARSET)
+function htmlsc($string = '', $flags = ENT_COMPAT, $charset = CONTENT_CHARSET)
{
return htmlspecialchars($string, $flags, $charset); // htmlsc()
}