mirror of
https://github.com/e107inc/e107.git
synced 2025-08-02 20:57:26 +02:00
Bug #3511 - utf8 detection function in lancheck was causing apache to reset on some systems.
This commit is contained in:
@@ -11,9 +11,9 @@
|
|||||||
| GNU General Public License (http://gnu.org).
|
| GNU General Public License (http://gnu.org).
|
||||||
|
|
|
|
||||||
| $Source: /cvs_backup/e107_0.8/e107_admin/lancheck.php,v $
|
| $Source: /cvs_backup/e107_0.8/e107_admin/lancheck.php,v $
|
||||||
| $Revision: 1.1.1.1 $
|
| $Revision: 1.2 $
|
||||||
| $Date: 2006-12-02 04:33:23 $
|
| $Date: 2006-12-22 00:46:14 $
|
||||||
| $Author: mcfly_e107 $
|
| $Author: e107coders $
|
||||||
| With code from Izydor and Lolo.
|
| With code from Izydor and Lolo.
|
||||||
+----------------------------------------------------------------------------+
|
+----------------------------------------------------------------------------+
|
||||||
*/
|
*/
|
||||||
@@ -628,25 +628,19 @@ function fill_phrases_array($data,$type) {
|
|||||||
return $retloc;
|
return $retloc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//--------------------------------------------------------------------
|
||||||
|
|
||||||
function is_utf8($string) {
|
|
||||||
// From http://w3.org/International/questions/qa-forms-utf-8.html
|
function is_utf8($str) {
|
||||||
if(strtolower(CHARSET) != "utf-8" || $string == "")
|
/*
|
||||||
|
* @see http://hsivonen.iki.fi/php-utf8/ validation.php
|
||||||
|
*/
|
||||||
|
if(strtolower(CHARSET) != "utf-8" || $str == "")
|
||||||
{
|
{
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
return preg_match('%^(?:
|
return (preg_match('/^.{1}/us',$str,$ar) == 1);
|
||||||
[\x09\x0A\x0D\x20-\x7E]
|
|
||||||
| [\xC2-\xDF][\x80-\xBF]
|
|
||||||
| \xE0[\xA0-\xBF][\x80-\xBF]
|
|
||||||
| [\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}
|
|
||||||
| \xED[\x80-\x9F][\x80-\xBF]
|
|
||||||
| \xF0[\x90-\xBF][\x80-\xBF]{2}
|
|
||||||
| [\xF1-\xF3][\x80-\xBF]{3}
|
|
||||||
| \xF4[\x80-\x8F][\x80-\xBF]{2}
|
|
||||||
)*$%xs', $string);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user