[-] Core: fix regular expression patterns for some hosting which don't support unicode

This commit is contained in:
rGaillard
2012-11-16 11:04:27 +00:00
parent 45b0fe885d
commit fc523f368e
2 changed files with 17 additions and 5 deletions
+12
View File
@@ -2247,6 +2247,18 @@ FileETag INode MTime Size
else
return array_unique($array, SORT_REGULAR);
}
/**
* Delete unicode class from regular expression patterns
* @param string $pattern
* @return pattern
*/
public static function cleanNonUnicodeSupport($pattern)
{
if (!defined('PREG_BAD_UTF8_OFFSET'))
return $pattern;
return preg_replace('/\\\[px]\{[a-z]\}{1,2}|(\/[a-z]*)u([a-z]*)$/i', "$1$2", $pattern);
}
}
/**