done a few fixes for newer php-versions

Signed-off-by: Michael Kaufmann (d00p) <d00p@froxlor.org>
This commit is contained in:
Michael Kaufmann (d00p)
2014-09-22 10:17:42 +02:00
parent 74c493f39c
commit 559fb4d4a4
3 changed files with 34 additions and 29 deletions

View File

@@ -850,14 +850,16 @@ class FroxlorInstall {
$content .= $this->_status_message('green', PHP_VERSION); $content .= $this->_status_message('green', PHP_VERSION);
} }
// Check if magic_quotes_runtime is active // Check if magic_quotes_runtime is active | get_magic_quotes_runtime() is always FALSE since 5.4
$content .= $this->_status_message('begin', $this->_lng['requirements']['phpmagic_quotes_runtime']); if (version_compare("5.4.0", PHP_VERSION, "<")) {
if (get_magic_quotes_runtime()) { $content .= $this->_status_message('begin', $this->_lng['requirements']['phpmagic_quotes_runtime']);
// deactivate it if (get_magic_quotes_runtime()) {
set_magic_quotes_runtime(false); // deactivate it
$content .= $this->_status_message('orange', $this->_lng['requirements']['not_true'] . "<br />". $this->_lng['requirements']['phpmagic_quotes_runtime_description']); set_magic_quotes_runtime(false);
} else { $content .= $this->_status_message('orange', $this->_lng['requirements']['not_true'] . "<br />". $this->_lng['requirements']['phpmagic_quotes_runtime_description']);
$content .= $this->_status_message('green', 'off'); } else {
$content .= $this->_status_message('green', 'off');
}
} }
// check for php_pdo and pdo_mysql // check for php_pdo and pdo_mysql

View File

@@ -121,27 +121,30 @@ $idna_convert = new idna_convert_wrapper();
/** /**
* disable magic_quotes_runtime if enabled * disable magic_quotes_runtime if enabled
*/ */
if (get_magic_quotes_runtime()) { // since 5.4 get_magic_quotes_runtime() and get_magic_quotes_gpc() return always FALSE
// deactivate if (version_compare("5.4.0", PHP_VERSION, "<")) {
set_magic_quotes_runtime(false); if (get_magic_quotes_runtime()) {
} // deactivate
set_magic_quotes_runtime(false);
/** }
* Reverse magic_quotes_gpc=on to have clean GPC data again
*/ /**
if (get_magic_quotes_gpc()) { * Reverse magic_quotes_gpc=on to have clean GPC data again
$in = array(&$_GET, &$_POST, &$_COOKIE); */
if (get_magic_quotes_gpc()) {
while (list($k, $v) = each($in)) { $in = array(&$_GET, &$_POST, &$_COOKIE);
foreach ($v as $key => $val) {
if (!is_array($val)) { while (list($k, $v) = each($in)) {
$in[$k][$key] = stripslashes($val); foreach ($v as $key => $val) {
continue; if (!is_array($val)) {
} $in[$k][$key] = stripslashes($val);
$in[] = & $in[$k][$key]; continue;
} }
$in[] = & $in[$k][$key];
}
}
unset($in);
} }
unset($in);
} }
/** /**

View File

@@ -700,7 +700,7 @@ class lighttpd {
Database::pexecute($alias_domains_stmt, array('domainid' => $domain['id'])); Database::pexecute($alias_domains_stmt, array('domainid' => $domain['id']));
while (($alias_domain = $alias_domains_stmt->fetch(PDO::FETCH_ASSOC)) !== false) { while (($alias_domain = $alias_domains_stmt->fetch(PDO::FETCH_ASSOC)) !== false) {
$alias_domain_name = ereg_replace('\.', '\.', $alias_domain['domain']); $alias_domain_name = str_replace('.', '\.', $alias_domain['domain']);
if ($alias_domain['iswildcarddomain'] == '1') { if ($alias_domain['iswildcarddomain'] == '1') {
$server_string[] = '(?:^|\.)' . $alias_domain_name . '$'; $server_string[] = '(?:^|\.)' . $alias_domain_name . '$';