Skip to content
Browse files

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

…kodak/moodle into MOODLE_25_STABLE
  • Loading branch information...
2 parents 0bde9de + fc4523f commit d7e626156e3ebadba71f493ae379ff936bbfaad0 @danpoltawski danpoltawski committed Jul 2, 2013
Showing with 6 additions and 6 deletions.
  1. +3 −3 lib/dml/mssql_native_moodle_database.php
  2. +3 −3 lib/dml/sqlsrv_native_moodle_database.php
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;
}

0 comments on commit d7e6261

Please sign in to comment.
Something went wrong with that request. Please try again.