Commit c51e2dbe authored by Cédric Anne's avatar Cédric Anne Committed by Johan Cwiklinski

Fix errors on last step of install wizard

parent 307a8080
...@@ -346,8 +346,6 @@ class DBmysqlIterator implements Iterator, Countable { ...@@ -346,8 +346,6 @@ class DBmysqlIterator implements Iterator, Countable {
* @return string * @return string
*/ */
public function analyseCrit ($crit, $bool = "AND") { public function analyseCrit ($crit, $bool = "AND") {
global $DB;
static $operators = ['=', '<', '<=', '>', '>=', '<>', 'LIKE', 'REGEXP', 'NOT LIKE', 'NOT REGEX', '&']; static $operators = ['=', '<', '<=', '>', '>=', '<>', 'LIKE', 'REGEXP', 'NOT LIKE', 'NOT REGEX', '&'];
if (!is_array($crit)) { if (!is_array($crit)) {
...@@ -391,11 +389,11 @@ class DBmysqlIterator implements Iterator, Countable { ...@@ -391,11 +389,11 @@ class DBmysqlIterator implements Iterator, Countable {
if (count($value) == 2 if (count($value) == 2
&& isset($value[0]) && in_array($value[0], $operators, true)) { && isset($value[0]) && in_array($value[0], $operators, true)) {
$ret .= DBmysql::quoteName($name) . " {$value[0]} " . $DB::quoteValue($value[1]); $ret .= DBmysql::quoteName($name) . " {$value[0]} " . DBmysql::quoteValue($value[1]);
} else { } else {
// Array of Values // Array of Values
foreach ($value as $k => $v) { foreach ($value as $k => $v) {
$value[$k] = $DB::quoteValue($v); $value[$k] = DBmysql::quoteValue($v);
} }
$ret .= DBmysql::quoteName($name) . ' IN (' . implode(', ', $value) . ')'; $ret .= DBmysql::quoteName($name) . ' IN (' . implode(', ', $value) . ')';
} }
...@@ -403,7 +401,7 @@ class DBmysqlIterator implements Iterator, Countable { ...@@ -403,7 +401,7 @@ class DBmysqlIterator implements Iterator, Countable {
// NULL condition // NULL condition
$ret .= DBmysql::quoteName($name) . " IS NULL"; $ret .= DBmysql::quoteName($name) . " IS NULL";
} else { } else {
$ret .= DBmysql::quoteName($name) . " = " . $DB::quoteValue($value); $ret .= DBmysql::quoteName($name) . " = " . DBmysql::quoteValue($value);
} }
} }
return $ret; return $ret;
......
...@@ -486,7 +486,7 @@ function step7() { ...@@ -486,7 +486,7 @@ function step7() {
$url_base_api = "$url_base/apirest.php/"; $url_base_api = "$url_base/apirest.php/";
$DB->update( $DB->update(
'glpi_configs', 'glpi_configs',
['value' => $Db->escape($url_base_api)], [ ['value' => $DB->escape($url_base_api)], [
'context' => 'core', 'context' => 'core',
'name' => 'url_base_api' 'name' => 'url_base_api'
] ]
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment