From: <var...@us...> - 2014-10-07 08:27:20
|
Revision: 9207 http://sourceforge.net/p/phpwiki/code/9207 Author: vargenau Date: 2014-10-07 08:27:17 +0000 (Tue, 07 Oct 2014) Log Message: ----------- Remove unused function isUtf8String Modified Paths: -------------- trunk/lib/stdlib.php Modified: trunk/lib/stdlib.php =================================================================== --- trunk/lib/stdlib.php 2014-10-07 08:05:55 UTC (rev 9206) +++ trunk/lib/stdlib.php 2014-10-07 08:27:17 UTC (rev 9207) @@ -63,7 +63,6 @@ glob_match ($glob, $against, $case_sensitive = true) explodePageList ($input, $perm = false) isa ($object, $class) - can ($object, $method) function_usable ($function_name) wikihash ($x) count_all ($arg) @@ -74,7 +73,6 @@ phpwiki_version () isWikiWord ($word) obj2hash ($obj, $exclude = false, $fields = false) - isUtf8String ($s) fixTitleEncoding ($s) url_get_contents ($uri) GenerateId ($name) @@ -1778,24 +1776,6 @@ } /** - * isUtf8String($string) - cheap utf-8 detection - * - * segfaults for strings longer than 10kb! - * Use http://www.phpdiscuss.com/article.php?id=565&group=php.i18n or - * checkTitleEncoding() at http://cvs.sourceforge.net/viewcvs.py/wikipedia/phase3/languages/Language.php - */ -function isUtf8String($s) -{ - $ptrASCII = '[\x00-\x7F]'; - $ptr2Octet = '[\xC2-\xDF][\x80-\xBF]'; - $ptr3Octet = '[\xE0-\xEF][\x80-\xBF]{2}'; - $ptr4Octet = '[\xF0-\xF4][\x80-\xBF]{3}'; - $ptr5Octet = '[\xF8-\xFB][\x80-\xBF]{4}'; - $ptr6Octet = '[\xFC-\xFD][\x80-\xBF]{5}'; - return preg_match("/^($ptrASCII|$ptr2Octet|$ptr3Octet|$ptr4Octet|$ptr5Octet|$ptr6Octet)*$/s", $s); -} - -/** * Check for UTF-8 URLs; Internet Explorer produces these if you * type non-ASCII chars in the URL bar or follow unescaped links. * Requires urldecoded pagename. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |