require php-5.6 for 0.10.0; fixes #606 and remove invalid value NO_AUTO_CREATE_USER in mysql-attributes for mysql8
Signed-off-by: Michael Kaufmann <d00p@froxlor.org>
This commit is contained in:
@@ -127,13 +127,8 @@ abstract class ApiParameter
|
||||
// which class called us
|
||||
$_class = get_called_class();
|
||||
if (empty($trace)) {
|
||||
// check php version for backtrace flags
|
||||
$_traceopts = false;
|
||||
if (version_compare(PHP_VERSION, "5.3.6", ">")) {
|
||||
$_traceopts = DEBUG_BACKTRACE_IGNORE_ARGS;
|
||||
}
|
||||
// get backtrace
|
||||
$trace = debug_backtrace($_traceopts);
|
||||
$trace = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS);
|
||||
}
|
||||
// check class and function
|
||||
$class = $trace[$level]['class'];
|
||||
|
||||
@@ -267,7 +267,14 @@ class Database {
|
||||
// build up connection string
|
||||
$driver = 'mysql';
|
||||
$dsn = $driver.":";
|
||||
$options = array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET names utf8,sql_mode="NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"');
|
||||
$version_server = PDO::getAttribute(PDO::ATTR_SERVER_VERSION);
|
||||
$sql_mode = 'NO_ENGINE_SUBSTITUTION';
|
||||
if (version_compare($version_server, '8.0.11', '<')) {
|
||||
$sql_mode .= ',NO_AUTO_CREATE_USER';
|
||||
}
|
||||
$options = array(
|
||||
PDO::MYSQL_ATTR_INIT_COMMAND => 'SET names utf8,sql_mode="' . $sql_mode . '"'
|
||||
);
|
||||
$attributes = array('ATTR_ERRMODE' => 'ERRMODE_EXCEPTION');
|
||||
|
||||
$dbconf["dsn"] = array(
|
||||
|
||||
@@ -41,8 +41,13 @@ class PowerDNS
|
||||
// build up connection string
|
||||
$driver = 'mysql';
|
||||
$dsn = $driver . ":";
|
||||
$version_server = PDO::getAttribute(PDO::ATTR_SERVER_VERSION);
|
||||
$sql_mode = 'NO_ENGINE_SUBSTITUTION';
|
||||
if (version_compare($version_server, '8.0.11', '<')) {
|
||||
$sql_mode .= ',NO_AUTO_CREATE_USER';
|
||||
}
|
||||
$options = array(
|
||||
PDO::MYSQL_ATTR_INIT_COMMAND => 'SET names utf8,sql_mode="NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION"'
|
||||
PDO::MYSQL_ATTR_INIT_COMMAND => 'SET names utf8,sql_mode="' . $sql_mode . '"'
|
||||
);
|
||||
$attributes = array(
|
||||
'ATTR_ERRMODE' => 'ERRMODE_EXCEPTION'
|
||||
|
||||
30
lib/init.php
30
lib/init.php
@@ -140,36 +140,6 @@ if (isset($_SERVER['HTTPS']) && (strtolower($_SERVER['HTTPS']) != 'off')) {
|
||||
header($hsts_header);
|
||||
}
|
||||
|
||||
/**
|
||||
* disable magic_quotes_runtime if enabled
|
||||
*/
|
||||
// since 5.4 get_magic_quotes_runtime() and get_magic_quotes_gpc() return always FALSE
|
||||
if (version_compare(PHP_VERSION, "5.4.0", "<")) {
|
||||
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()) {
|
||||
$in = array(&$_GET, &$_POST, &$_COOKIE);
|
||||
|
||||
$_in = $in;
|
||||
foreach ($_in as $k => $v) {
|
||||
foreach ($v as $key => $val) {
|
||||
if (!is_array($val)) {
|
||||
$in[$k][$key] = stripslashes($val);
|
||||
continue;
|
||||
}
|
||||
$in[] = & $in[$k][$key];
|
||||
}
|
||||
}
|
||||
unset($in);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* SESSION MANAGEMENT
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user