Skip to content

Commit

Permalink
Merge branch 'w27_MDL-40399_m25_msarrayshift' of https://github.com/s…
Browse files Browse the repository at this point in the history
…kodak/moodle into MOODLE_25_STABLE
  • Loading branch information
danpoltawski committed Jul 2, 2013
2 parents 0bde9de + fc4523f commit d7e6261
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions lib/dml/mssql_native_moodle_database.php
Expand Up @@ -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;
Expand All @@ -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;
}
Expand Down
6 changes: 3 additions & 3 deletions lib/dml/sqlsrv_native_moodle_database.php
Expand Up @@ -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;
Expand All @@ -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;
}
Expand Down

0 comments on commit d7e6261

Please sign in to comment.