[BUGFIX] Add missing (string) cast in dbal/DatabaseConnection 25/39625/2
authorMorton Jonuschat <m.jonuschat@mojocode.de>
Tue, 19 May 2015 17:25:11 +0000 (19:25 +0200)
committerMarkus Klein <markus.klein@typo3.org>
Tue, 19 May 2015 22:20:55 +0000 (00:20 +0200)
This is a regression fix for #54091.
It has been forgotten to cast the lastQuery to a string before
checking if it's empty

Resolves: #67040
Related: #54091
Releases: master
Change-Id: I6991cad799e686066f8205749baee4aed20a9127
Reviewed-on: http://review.typo3.org/39625
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Stephan GroƟberndt <stephan@grossberndt.de>
Reviewed-by: Wouter Wolters <typo3@wouterwolters.nl>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
typo3/sysext/dbal/Classes/Database/DatabaseConnection.php

index 35e24b8..9bccb0b 100644 (file)
@@ -524,7 +524,7 @@ class DatabaseConnection extends \TYPO3\CMS\Core\Database\DatabaseConnection {
                                        $sqlResult = $this->handlerInstance[$this->lastHandlerKey]->_query($this->lastQuery, FALSE);
                                } else {
                                        $this->handlerInstance[$this->lastHandlerKey]->StartTrans();
-                                       if ($this->lastQuery[0] !== '') {
+                                       if ((string)$this->lastQuery[0] !== '') {
                                                $sqlResult = $this->handlerInstance[$this->lastHandlerKey]->_query($this->lastQuery[0], FALSE);
                                                if ($this->handlerInstance[$this->lastHandlerKey]->hasInsertID) {
                                                        // The table is able to retrieve the ID of the last insert, use it to update the blob below
@@ -684,7 +684,7 @@ class DatabaseConnection extends \TYPO3\CMS\Core\Database\DatabaseConnection {
                                        $sqlResult = $this->handlerInstance[$this->lastHandlerKey]->_query($this->lastQuery, FALSE);
                                } else {
                                        $this->handlerInstance[$this->lastHandlerKey]->StartTrans();
-                                       if ($this->lastQuery[0] !== '') {
+                                       if ((string)$this->lastQuery[0] !== '') {
                                                $sqlResult = $this->handlerInstance[$this->lastHandlerKey]->_query($this->lastQuery[0], FALSE);
                                        }
                                        if (is_array($this->lastQuery[1])) {