[BUGFIX] DatabaseConnection::listQuery wrong usage of strpos() 50/27750/2
authorMarkus Klein <klein.t3@mfc-linz.at>
Thu, 20 Feb 2014 09:36:45 +0000 (10:36 +0100)
committerStefan Neufeind <typo3.neufeind@speedpartner.de>
Thu, 20 Feb 2014 09:48:16 +0000 (10:48 +0100)
In DatabaseConnection::listQuery strpos() is used with wrong
parameter order.

Resolves: #56135
Releases: 6.2, 6.1, 6.0
Change-Id: Iaa18d46442a2aac21a836216cb61ae376bbb2090
Reviewed-on: https://review.typo3.org/27750
Reviewed-by: Stefan Neufeind
Tested-by: Stefan Neufeind
typo3/sysext/core/Classes/Database/DatabaseConnection.php

index d1b462c..0bcc47b 100644 (file)
@@ -667,12 +667,12 @@ class DatabaseConnection {
         * @param string $field Field name
         * @param string $value Value to find in list
         * @param string $table Table in which we are searching (for DBAL detection of quoteStr() method)
-        * @throws \InvalidArgumentException
         * @return string WHERE clause for a query
+        * @throws \InvalidArgumentException
         */
        public function listQuery($field, $value, $table) {
-               $value = (string) $value;
-               if (strpos(',', $value) !== FALSE) {
+               $value = (string)$value;
+               if (strpos($value, ',') !== FALSE) {
                        throw new \InvalidArgumentException('$value must not contain a comma (,) in $this->listQuery() !', 1294585862);
                }
                $pattern = $this->quoteStr($value, $table);