[BUGFIX] Speed up BackendUtility->explodeSoftRefParserList 75/35775/2
authorStephan Großberndt <stephan@grossberndt.de>
Tue, 9 Dec 2014 12:00:31 +0000 (13:00 +0100)
committerBenjamin Mack <benni@typo3.org>
Sun, 4 Jan 2015 15:00:35 +0000 (16:00 +0100)
Due to improper checking for an empty array in
BackendUtility->explodeSoftRefParserList multiple trimExplode-calls per
record are executed. Fixing this check leads to an early return and
speeds up bulk inserting.

Resolves: #63674
Releases: master, 6.2
Change-Id: Id8969c33d8ebb109018159ada6a277ab5bfdd13c
Reviewed-on: http://review.typo3.org/35187
Reviewed-by: Michael Oehlhof <typo3@oehlhof.de>
Reviewed-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Tested-by: Mathias Schreiber <mathias.schreiber@wmdb.de>
Reviewed-by: Benjamin Mack <benni@typo3.org>
Tested-by: Benjamin Mack <benni@typo3.org>
(cherry picked from commit 522fba7db058c0c2783116d9772c2c2a561b6beb)
Reviewed-on: http://review.typo3.org/35775

typo3/sysext/backend/Classes/Utility/BackendUtility.php

index 7ec19f0..184eda5 100644 (file)
@@ -3592,7 +3592,7 @@ class BackendUtility {
         */
        static public function explodeSoftRefParserList($parserList) {
                // Looking for global parsers:
-               if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['softRefParser_GL'])) {
+               if (is_array($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['softRefParser_GL']) && !empty($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['softRefParser_GL'])) {
                        $parserList = implode(',', array_keys($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['GLOBAL']['softRefParser_GL'])) . ',' . $parserList;
                }
                // Return immediately if list is blank: