added PCRE check

This commit is contained in:
Roland Gruber 2010-01-02 17:35:13 +00:00
parent b770d71ce2
commit 497ab97997
1 changed files with 5 additions and 0 deletions

View File

@ -87,6 +87,7 @@ for ($i = 0; $i < sizeof($writableDirs); $i++) {
if (ini_get("session.auto_start") == "1") {
$criticalErrors[] = array("ERROR", "Please deactivate session.auto_start in your php.ini. LAM will not work if it is activated.");
}
// check memory limit
$memLimit = ini_get('memory_limit');
if (isset($memLimit) && ($memLimit != '') && (substr(strtoupper($memLimit), strlen($memLimit) - 1) == 'M')) {
if (intval(substr($memLimit, 0, strlen($memLimit) - 1)) < 64) {
@ -94,6 +95,10 @@ if (isset($memLimit) && ($memLimit != '') && (substr(strtoupper($memLimit), strl
"Your current memory limit is $memLimit.");
}
}
// check PCRE regex system
if (!@preg_match('/^\p{L}+$/u', "abc")) {
$criticalErrors[] = array("ERROR", "Your PCRE library has no complete Unicode support. Please upgrade libpcre or compile with \"--enable-unicode-properties\".");
}
// stop login if critical errors occured
if (sizeof($criticalErrors) > 0) {
echo "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">\n\n";