Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'w27_MDL-40399_m25_msarrayshift' of https://github.com/s…

…kodak/moodle into MOODLE_25_STABLE
  • Loading branch information...
commit d7e626156e3ebadba71f493ae379ff936bbfaad0 2 parents 0bde9de + fc4523f
@danpoltawski danpoltawski authored
View
6 lib/dml/mssql_native_moodle_database.php
@@ -625,8 +625,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;
@@ -651,7 +651,7 @@ protected function emulate_bound_params($sql, array $params=null) {
$return .= "N'$param'";
}
- $return .= array_shift($parts);
+ $return .= array_pop($parts);
}
return $return;
}
View
6 lib/dml/sqlsrv_native_moodle_database.php
@@ -709,8 +709,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;
@@ -730,7 +730,7 @@ protected function emulate_bound_params($sql, array $params = null) {
$return .= "N'$param'";
}
- $return .= array_shift($parts);
+ $return .= array_pop($parts);
}
return $return;
}
Please sign in to comment.
Something went wrong with that request. Please try again.