[BUGFIX] Prevent warning in FAL "Update storage index" scheduler task 51/37051/2
authorNicole Cordes <typo3@cordes.co>
Fri, 20 Feb 2015 08:47:24 +0000 (09:47 +0100)
committerHelmut Hummel <helmut.hummel@typo3.org>
Fri, 20 Feb 2015 14:43:13 +0000 (15:43 +0100)
Due to the use of intval within array_walk a warning is triggered,
because array_walk calls the function with two parameters where intval
only expects one. This patch replaces the array_walk function with
DatabaseConnection::cleanIntArray.

Releases: master, 6.2
Resolves: #65189
Change-Id: Ic487f2da589e1610bd9ac7ec721d48a2735ef980
Reviewed-on: http://review.typo3.org/37051
Reviewed-by: Helmut Hummel <helmut.hummel@typo3.org>
Tested-by: Helmut Hummel <helmut.hummel@typo3.org>
typo3/sysext/core/Classes/Resource/Index/FileIndexRepository.php

index 67622d0..76d301e 100644 (file)
@@ -286,9 +286,7 @@ class FileIndexRepository implements SingletonInterface {
        public function findInStorageAndNotInUidList(\TYPO3\CMS\Core\Resource\ResourceStorage $storage, array $uidList) {
                $where = 'storage = ' . (int)$storage->getUid();
                if (!empty($uidList)) {
-                       array_walk($uidList, 'intval');
-                       $uidList = array_unique($uidList);
-                       $where .= ' AND uid NOT IN (' . implode(',', $uidList) . ')';
+                       $where .= ' AND uid NOT IN (' . implode(',', $this->getDatabaseConnection()->cleanIntArray($uidList)) . ')';
                }
                return $this->getDatabaseConnection()->exec_SELECTgetRows(implode(',', $this->fields), $this->table, $where);
        }
@@ -408,4 +406,4 @@ class FileIndexRepository implements SingletonInterface {
        protected function emitRecordDeletedSignal($fileUid) {
                $this->getSignalSlotDispatcher()->dispatch('TYPO3\\CMS\\Core\\Resource\\Index\\FileIndexRepository', 'recordDeleted', array($fileUid));
        }
-}
\ No newline at end of file
+}