mirror of
https://github.com/kamilwylegala/cakephp2-php8.git
synced 2024-11-15 03:18:26 +00:00
Trim $sql before checking for SELECT
This commit is contained in:
parent
997154565f
commit
9aeea2fcc3
1 changed files with 1 additions and 0 deletions
|
@ -756,6 +756,7 @@ class Sqlserver extends DboSource {
|
|||
*/
|
||||
protected function _execute($sql, $params = array(), $prepareOptions = array()) {
|
||||
$this->_lastAffected = false;
|
||||
$sql = trim($sql);
|
||||
if (strncasecmp($sql, 'SELECT', 6) === 0 || preg_match('/^EXEC(?:UTE)?\s/mi', $sql) > 0) {
|
||||
$prepareOptions += array(PDO::ATTR_CURSOR => PDO::CURSOR_SCROLL);
|
||||
return parent::_execute($sql, $params, $prepareOptions);
|
||||
|
|
Loading…
Reference in a new issue