Permalink
Browse files

Merge branch 'w27_MDL-40266_m25_arrayshift' of https://github.com/sko…

…dak/moodle into MOODLE_25_STABLE
  • Loading branch information...
2 parents f129308 + c177689 commit 204383e50d310785d3601106c63ffb2dc7d675e4 @danpoltawski danpoltawski committed Jul 2, 2013
Showing with 3 additions and 3 deletions.
  1. +3 −3 lib/dml/mysqli_native_moodle_database.php
@@ -853,8 +853,8 @@ protected function emulate_bound_params($sql, array $params=null) {
return $sql;
}
// ok, we have verified sql statement with ? and correct number of params
- $parts = explode('?', $sql);
- $return = array_shift($parts);
+ $parts = array_reverse(explode('?', $sql));
+ $return = array_pop($parts);
foreach ($params as $param) {
if (is_bool($param)) {
$return .= (int)$param;
@@ -868,7 +868,7 @@ protected function emulate_bound_params($sql, array $params=null) {
$param = $this->mysqli->real_escape_string($param);
$return .= "'$param'";
}
- $return .= array_shift($parts);
+ $return .= array_pop($parts);
}
return $return;
}

0 comments on commit 204383e

Please sign in to comment.