[TASK] Replace GeneralUtility::inList() with comparison 39/37139/7
authorJo Hasenau <info@cybercraft.de>
Mon, 23 Feb 2015 20:27:06 +0000 (21:27 +0100)
committerMarkus Klein <markus.klein@typo3.org>
Fri, 11 Dec 2015 15:51:09 +0000 (16:51 +0100)
Using direct comparisons instead of GeneralUtility::inList() is faster
and uses less memory.

Releases: master
Resolves: #55626
Change-Id: I0acfe07fbd796ba017dd64d6987139bfb80db898
Reviewed-on: https://review.typo3.org/37139
Reviewed-by: Stephan Großberndt <stephan@grossberndt.de>
Tested-by: Stephan Großberndt <stephan@grossberndt.de>
Reviewed-by: Markus Klein <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
35 files changed:
typo3/sysext/backend/Classes/Form/FormDataProvider/DatabaseRowDateTimeFields.php
typo3/sysext/backend/Classes/View/PageLayoutView.php
typo3/sysext/core/Classes/Configuration/TypoScript/ConditionMatching/AbstractConditionMatcher.php
typo3/sysext/core/Classes/Controller/CommandLineController.php
typo3/sysext/core/Classes/DataHandling/DataHandler.php
typo3/sysext/core/Classes/Database/DatabaseConnection.php
typo3/sysext/core/Classes/Database/SoftReferenceIndex.php
typo3/sysext/core/Classes/Html/HtmlParser.php
typo3/sysext/core/Classes/Html/RteHtmlParser.php
typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php
typo3/sysext/core/Classes/TypoScript/ExtendedTemplateService.php
typo3/sysext/dbal/Classes/Database/DatabaseConnection.php
typo3/sysext/dbal/Classes/Database/SqlCompilers/Adodb.php
typo3/sysext/dbal/Classes/Database/SqlCompilers/Mysql.php
typo3/sysext/dbal/Classes/Database/SqlParser.php
typo3/sysext/felogin/Classes/Controller/FrontendLoginController.php
typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php
typo3/sysext/frontend/Classes/ContentObject/Menu/JavaScriptMenuContentObject.php
typo3/sysext/frontend/Classes/Page/CacheHashCalculator.php
typo3/sysext/impexp/Classes/Controller/ImportExportController.php
typo3/sysext/impexp/Classes/ImportExport.php
typo3/sysext/indexed_search/Classes/Lexer.php
typo3/sysext/lowlevel/Classes/CleanerCommand.php
typo3/sysext/recordlist/Classes/RecordList/AbstractDatabaseRecordList.php
typo3/sysext/rtehtmlarea/Classes/Controller/SpellCheckingController.php
typo3/sysext/saltedpasswords/Classes/Evaluation/Evaluator.php
typo3/sysext/saltedpasswords/Classes/SaltedPasswordService.php
typo3/sysext/saltedpasswords/Classes/Utility/ExtensionManagerConfigurationUtility.php
typo3/sysext/saltedpasswords/Classes/Utility/SaltedPasswordsUtility.php
typo3/sysext/saltedpasswords/Tests/Unit/Evaluation/EvaluatorTest.php
typo3/sysext/setup/Classes/Controller/SetupModuleController.php
typo3/sysext/version/Classes/Controller/VersionModuleController.php
typo3/sysext/version/Classes/DataHandler/CommandMap.php
typo3/sysext/version/Classes/Dependency/ElementEntityProcessor.php
typo3/sysext/wizard_sortpages/Classes/View/SortPagesWizardModuleFunction.php

index 16ceb48..d2bc5ff 100644 (file)
@@ -16,7 +16,6 @@ namespace TYPO3\CMS\Backend\Form\FormDataProvider;
 
 use TYPO3\CMS\Backend\Form\FormDataProviderInterface;
 use TYPO3\CMS\Core\Database\DatabaseConnection;
-use TYPO3\CMS\Core\Utility\GeneralUtility;
 
 /**
  * Migrate date and datetime db field values to timestamp
@@ -34,7 +33,7 @@ class DatabaseRowDateTimeFields implements FormDataProviderInterface
         $dateTimeFormats = $this->getDatabase()->getDateTimeFormats($result['tableName']);
         foreach ($result['processedTca']['columns'] as $column => $columnConfig) {
             if (isset($columnConfig['config']['dbType'])
-                && GeneralUtility::inList('date,datetime', $columnConfig['config']['dbType'])
+                && ($columnConfig['config']['dbType'] === 'date' || $columnConfig['config']['dbType'] === 'datetime')
             ) {
                 if (!empty($result['databaseRow'][$column])
                     &&  $result['databaseRow'][$column] !== $dateTimeFormats[$columnConfig['config']['dbType']]['empty']
@@ -42,7 +41,7 @@ class DatabaseRowDateTimeFields implements FormDataProviderInterface
                     // Create a timestamp from current field data
                     $result['databaseRow'][$column] = strtotime($result['databaseRow'][$column]);
                 } else {
-                    // Set to 0 timespamp
+                    // Set to 0 timestamp
                     $result['databaseRow'][$column] = 0;
                 }
             }
index 9b4f289..8f226d5 100644 (file)
@@ -2191,7 +2191,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
             // Check access and whether the proper extensions are loaded:
             if ($this->getBackendUser()->check('tables_select', $tName)
                 && (isset($this->externalTables[$tName])
-                    || GeneralUtility::inList('fe_users,tt_content', $tName)
+                    || $tName === 'fe_users' || $tName === 'tt_content'
                     || \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded($tName)
                 )
             ) {
@@ -2199,7 +2199,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
                 $c = $this->getDatabase()->exec_SELECTcountRows('uid', $tName, 'pid=' . (int)$id
                     . BackendUtility::deleteClause($tName) . BackendUtility::versioningPlaceholderClause($tName));
                 // If records were found (or if "tt_content" is the table...):
-                if ($c || GeneralUtility::inList('tt_content', $tName)) {
+                if ($c || $tName === 'tt_content') {
                     // Add row to menu:
                     $out .= '
                                        <td><a href="#' . $tName . '" title="' . $this->getLanguageService()->sL($GLOBALS['TCA'][$tName]['ctrl']['title'], true) . '"></a>'
index 560d537..66b8ef0 100644 (file)
@@ -195,13 +195,14 @@ abstract class AbstractConditionMatcher
     /**
      * Evaluates a TypoScript condition given as input, eg. "[applicationContext = Production][...(other condition)...]"
      *
-     * @param string $key The condition to match against its criterias.
+     * @param string $key The condition to match against its criteria.
      * @param string $value
      * @return NULL|bool Result of the evaluation; NULL if condition could not be evaluated
      */
     protected function evaluateConditionCommon($key, $value)
     {
-        if (GeneralUtility::inList('browser,device,version,system,useragent', strtolower($key))) {
+        $lowerKey = strtolower($key);
+        if ($lowerKey === 'browser' || $lowerKey === 'device' || $lowerKey === 'version' || $lowerKey === 'system' || $lowerKey === 'useragent') {
             GeneralUtility::deprecationLog(
                 'Usage of client related conditions (browser, device, version, system, useragent) is deprecated since 7.0.'
             );
index ca9f960..26db402 100644 (file)
@@ -213,7 +213,8 @@ class CommandLineController
     {
         // ONLY makes sense to echo it out since we are awaiting keyboard input - that cannot be silenced
         echo $msg . ' (Yes/No + return): ';
-        return \TYPO3\CMS\Core\Utility\GeneralUtility::inList('y,yes', strtolower($this->cli_keyboardInput()));
+        $input = strtolower($this->cli_keyboardInput());
+        return $input === 'y' || $input === 'yes';
     }
 
     /**
index aedd04a..7ed80fa 100644 (file)
@@ -4712,7 +4712,7 @@ class DataHandler
         $action = $command['action'];
         $ids = $command['ids'];
 
-        if (!$field || !GeneralUtility::inList('localize,synchronize', $action) && empty($ids) || !isset($GLOBALS['TCA'][$table]['columns'][$field]['config'])) {
+        if (!$field || !($action === 'localize' || $action === 'synchronize') && empty($ids) || !isset($GLOBALS['TCA'][$table]['columns'][$field]['config'])) {
             return;
         }
 
index 830d010..459d415 100644 (file)
@@ -1927,10 +1927,7 @@ class DatabaseConnection
         }
         $indices_output = array();
         // Notice: Rows are skipped if there is only one result, or if no conditions are set
-        if (
-            $explain_output[0]['rows'] > 1
-            || GeneralUtility::inList('ALL', $explain_output[0]['type'])
-        ) {
+        if ($explain_output[0]['rows'] > 1 || $explain_output[0]['type'] === 'ALL') {
             // Only enable output if it's really useful
             $debug = true;
             foreach ($explain_tables as $table) {
index f672ebb..a33fb40 100644 (file)
@@ -594,7 +594,8 @@ class SoftReferenceIndex
         list($rootFileDat) = explode('?', rawurldecode($link_param));
         $containsSlash = strstr($rootFileDat, '/');
         $rFD_fI = pathinfo($rootFileDat);
-        if (trim($rootFileDat) && !$containsSlash && (@is_file(PATH_site . $rootFileDat) || GeneralUtility::inList('php,html,htm', strtolower($rFD_fI['extension'])))) {
+        $fileExtension = strtolower($rFD_fI['extension']);
+        if ($fileExtension === 'php' || $fileExtension === 'html' || $fileExtension === 'htm' || trim($rootFileDat) && !$containsSlash && (@is_file(PATH_site . $rootFileDat))) {
             $isLocalFile = 1;
         } elseif ($containsSlash) {
             // Adding this so realurl directories are linked right (non-existing).
index ccc9d23..0292d8c 100644 (file)
@@ -1411,7 +1411,10 @@ class HtmlParser
                 }
                 $newTag = '<' . trim($tagName . ' ' . implode(' ', $outA));
                 // All tags that are standalone (not wrapping, not having endtags) should be ended with '/>'
-                if (GeneralUtility::inList('img,br,hr,meta,link,base,area,input,param,col', $tagName) || substr($value, -2) == '/>') {
+                if (
+                    $tagName === 'img' || $tagName === 'br' || $tagName === 'hr' || $tagName === 'meta' || $tagName === 'link' || $tagName === 'base'
+                    || $tagName === 'area' || $tagName === 'input' || $tagName === 'param' || $tagName === 'col' || substr($value, -2) === '/>'
+                ) {
                     $newTag .= ' />';
                 } else {
                     $newTag .= '>';
index bd6600a..ed86bd7 100644 (file)
@@ -410,7 +410,8 @@ class RteHtmlParser extends \TYPO3\CMS\Core\Html\HtmlParser
                         if ($externalFile) {
                             $pU = parse_url($absoluteUrl);
                             $pI = pathinfo($pU['path']);
-                            if (GeneralUtility::inList('gif,png,jpeg,jpg', strtolower($pI['extension']))) {
+                            $extension = strtolower($pI['extension']);
+                            if ($extension === 'jpg' || $extension === 'jpeg' || $extension === 'gif' || $extension === 'png') {
                                 $fileName = GeneralUtility::shortMD5($absoluteUrl) . '.' . $pI['extension'];
                                 // We insert this image into the user default upload folder
                                 list($table, $field) = explode(':', $this->elRef);
@@ -699,7 +700,8 @@ class RteHtmlParser extends \TYPO3\CMS\Core\Html\HtmlParser
                         // Detects if a file is found in site-root.
                         list($rootFileDat) = explode('?', $link_param);
                         $rFD_fI = pathinfo($rootFileDat);
-                        if (trim($rootFileDat) && !strstr($link_param, '/') && (@is_file((PATH_site . $rootFileDat)) || GeneralUtility::inList('php,html,htm', strtolower($rFD_fI['extension'])))) {
+                        $fileExtension = strtolower($rFD_fI['extension']);
+                        if ($fileExtension === 'php' || $fileExtension === 'html' || $fileExtension === 'htm' || trim($rootFileDat) && !strstr($link_param, '/') && (@is_file((PATH_site . $rootFileDat)))) {
                             $href = $siteUrl . $link_param;
                         } elseif (
                             (
index f5c03f6..467e422 100644 (file)
@@ -1135,7 +1135,7 @@ class GraphicalFunctions
                                 $utf8Chars = $this->singleChars($part['str']);
                                 foreach ($utf8Chars as $utfChar) {
                                     // Find number and evaluate position:
-                                    $uNumber = $this->csConvObj->utf8CharToUnumber($utfChar);
+                                    $uNumber = (int)$this->csConvObj->utf8CharToUnumber($utfChar);
                                     $inRange = 0;
                                     foreach ($ranges as $rangeDef) {
                                         if ($uNumber >= $rangeDef[0] && (!$rangeDef[1] || $uNumber <= $rangeDef[1])) {
@@ -1148,7 +1148,7 @@ class GraphicalFunctions
                                     }
                                     // Initialize first char
                                     // Switch bank:
-                                    if ($inRange != $currentState && !GeneralUtility::inList('32,10,13,9', $uNumber)) {
+                                    if ($inRange != $currentState && $uNumber !== 9 && $uNumber !== 10 && $uNumber !== 13 && $uNumber !== 32) {
                                         // Set result:
                                         if ($bankAccum !== '') {
                                             $newResult[] = array(
index da4ba6a..b8753b4 100644 (file)
@@ -460,7 +460,7 @@ class ExtendedTemplateService extends TemplateService
                 }
                 $label = $key;
                 // Read only...
-                if (GeneralUtility::inList('types,resources,sitetitle', $depth) && $this->bType == 'setup') {
+                if (($depth === 'types' || $depth === 'resources' || $depth === 'sitetitle') && $this->bType === 'setup') {
                     $label = '<span style="color: #666666;">' . $label . '</span>';
                 } else {
                     if ($this->linkObjects) {
@@ -1050,7 +1050,8 @@ class ExtendedTemplateService extends TemplateService
         } else {
             $m = strcspn($type, ' [');
             $retArr['type'] = strtolower(substr($type, 0, $m));
-            if (GeneralUtility::inList('int,options,file,boolean,offset,user', $retArr['type'])) {
+            $types = ['int' => 1, 'options' => 1, 'file' => 1, 'boolean' => 1, 'offset' => 1, 'user' => 1];
+            if (isset($types[$retArr['type']])) {
                 $p = trim(substr($type, $m));
                 $reg = array();
                 preg_match('/\\[(.*)\\]/', $p, $reg);
index 78cb47c..95e46f8 100644 (file)
@@ -1835,7 +1835,8 @@ class DatabaseConnection extends \TYPO3\CMS\Core\Database\DatabaseConnection
                     }
                 } else {
                     // Detecting value type; list or plain:
-                    if (GeneralUtility::inList('NOTIN,IN', strtoupper(str_replace(array(' ', LF, CR, TAB), '', $where_clause[$k]['comparator'])))) {
+                    $comparator = $this->SQLparser->normalizeKeyword($where_clause[$k]['comparator']);
+                    if ($comparator === 'NOTIN' || $comparator === 'IN') {
                         if (isset($v['subquery'])) {
                             $where_clause[$k]['subquery'] = $this->quoteSELECTsubquery($v['subquery']);
                         }
@@ -2611,8 +2612,11 @@ class DatabaseConnection extends \TYPO3\CMS\Core\Database\DatabaseConnection
         }
         // This method is heavily used by Extbase, try to handle it with DBAL-native methods
         $queryParts = $this->SQLparser->parseSQL($query);
-        if (is_array($queryParts) && GeneralUtility::inList('SELECT,UPDATE,INSERT,DELETE', $queryParts['type'])) {
-            return $this->exec_query($queryParts);
+        if (is_array($queryParts)) {
+            $operation = $queryParts['type'];
+            if ($operation === 'SELECT' || $operation === 'UPDATE' || $operation === 'INSERT' || $operation === 'DELETE') {
+                return $this->exec_query($queryParts);
+            }
         }
         $sqlResult = null;
         switch ($this->handlerCfg['_DEFAULT']['type']) {
@@ -3907,7 +3911,7 @@ class DatabaseConnection extends \TYPO3\CMS\Core\Database\DatabaseConnection
                     break;
                 case 'exec_SELECTquery':
                     // Get explain data:
-                    if ($this->conf['debugOptions']['EXPLAIN'] && GeneralUtility::inList('adodb,native', $inData['handlerType'])) {
+                    if ($this->conf['debugOptions']['EXPLAIN'] && ($inData['handlerType'] === 'adodb' || $inData['handlerType'] === 'native')) {
                         $data['EXPLAIN'] = $this->debug_explain($this->lastQuery);
                     }
                     // Check parsing of Query:
index eab44ba..0c62bcb 100644 (file)
@@ -535,7 +535,7 @@ class Adodb extends AbstractCompiler
                                 $output .= ' ' . $v['comparator'];
                                 // Detecting value type; list or plain:
                                 $comparator = SqlParser::normalizeKeyword($v['comparator']);
-                                if (GeneralUtility::inList('NOTIN,IN', $comparator)) {
+                                if ($comparator === 'NOTIN' || $comparator === 'IN') {
                                     if (isset($v['subquery'])) {
                                         $output .= ' (' . $this->compileSELECT($v['subquery']) . ')';
                                     } else {
@@ -582,7 +582,7 @@ class Adodb extends AbstractCompiler
                                             }
                                         }
                                     }
-                                } elseif (GeneralUtility::inList('BETWEEN,NOT BETWEEN', $v['comparator'])) {
+                                } elseif ($comparator === 'BETWEEN' || $comparator === 'NOTBETWEEN') {
                                     $lbound = $v['values'][0];
                                     $ubound = $v['values'][1];
                                     $output .= ' ' . $lbound[1] . $this->compileAddslashes($lbound[0]) . $lbound[1];
index 150cf13..0210f1e 100644 (file)
@@ -14,7 +14,6 @@ namespace TYPO3\CMS\Dbal\Database\SqlCompilers;
  * The TYPO3 project - inspiring people to share!
  */
 
-use TYPO3\CMS\Core\Utility\GeneralUtility;
 use TYPO3\CMS\Dbal\Database\SqlParser;
 
 /**
@@ -278,7 +277,8 @@ class Mysql extends AbstractCompiler
                     if ($v['comparator']) {
                         $output .= ' ' . $v['comparator'];
                         // Detecting value type; list or plain:
-                        if (GeneralUtility::inList('NOTIN,IN', SqlParser::normalizeKeyword($v['comparator']))) {
+                        $comparator = SqlParser::normalizeKeyword($v['comparator']);
+                        if ($comparator === 'NOTIN' || $comparator === 'IN') {
                             if (isset($v['subquery'])) {
                                 $output .= ' (' . $this->compileSELECT($v['subquery']) . ')';
                             } else {
@@ -288,23 +288,21 @@ class Mysql extends AbstractCompiler
                                 }
                                 $output .= ' (' . trim(implode(',', $valueBuffer)) . ')';
                             }
+                        } elseif ($comparator === 'BETWEEN' || $comparator === 'NOTBETWEEN') {
+                            $lbound = $v['values'][0];
+                            $ubound = $v['values'][1];
+                            $output .= ' ' . $lbound[1] . $this->compileAddslashes($lbound[0]) . $lbound[1];
+                            $output .= ' AND ';
+                            $output .= $ubound[1] . $this->compileAddslashes($ubound[0]) . $ubound[1];
                         } else {
-                            if (GeneralUtility::inList('BETWEEN,NOT BETWEEN', $v['comparator'])) {
-                                $lbound = $v['values'][0];
-                                $ubound = $v['values'][1];
-                                $output .= ' ' . $lbound[1] . $this->compileAddslashes($lbound[0]) . $lbound[1];
-                                $output .= ' AND ';
-                                $output .= $ubound[1] . $this->compileAddslashes($ubound[0]) . $ubound[1];
-                            } else {
-                                if (isset($v['value']['operator'])) {
-                                    $values = array();
-                                    foreach ($v['value']['args'] as $fieldDef) {
-                                        $values[] = ($fieldDef['table'] ? $fieldDef['table'] . '.' : '') . $fieldDef['field'];
-                                    }
-                                    $output .= ' ' . $v['value']['operator'] . '(' . implode(',', $values) . ')';
-                                } else {
-                                    $output .= ' ' . $v['value'][1] . $this->compileAddslashes($v['value'][0]) . $v['value'][1];
+                            if (isset($v['value']['operator'])) {
+                                $values = array();
+                                foreach ($v['value']['args'] as $fieldDef) {
+                                    $values[] = ($fieldDef['table'] ? $fieldDef['table'] . '.' : '') . $fieldDef['field'];
                                 }
+                                $output .= ' ' . $v['value']['operator'] . '(' . implode(',', $values) . ')';
+                            } else {
+                                $output .= ' ' . $v['value'][1] . $this->compileAddslashes($v['value'][0]) . $v['value'][1];
                             }
                         }
                     }
index 101b6d4..2cec292 100644 (file)
@@ -650,7 +650,7 @@ class SqlParser
             if ($result['action'] = $this->nextPart($parseString, '^(CHANGE|DROP[[:space:]]+KEY|DROP[[:space:]]+PRIMARY[[:space:]]+KEY|ADD[[:space:]]+KEY|ADD[[:space:]]+PRIMARY[[:space:]]+KEY|ADD[[:space:]]+UNIQUE|DROP|ADD|RENAME|DEFAULT[[:space:]]+CHARACTER[[:space:]]+SET|ENGINE)([[:space:]]+|\\(|=)')) {
                 $actionKey = $this->normalizeKeyword($result['action']);
                 // Getting field:
-                if (GeneralUtility::inList('ADDPRIMARYKEY,DROPPRIMARYKEY,ENGINE', $actionKey) || ($fieldKey = $this->nextPart($parseString, '^([[:alnum:]_]+)[[:space:]]+'))) {
+                if ($actionKey === 'ADDPRIMARYKEY' || $actionKey === 'DROPPRIMARYKEY' || $actionKey === 'ENGINE' || ($fieldKey = $this->nextPart($parseString, '^([[:alnum:]_]+)[[:space:]]+'))) {
                     switch ($actionKey) {
                         case 'ADD':
                             $result['FIELD'] = $fieldKey;
@@ -1352,7 +1352,8 @@ class SqlParser
                             $this->nextPart($parseString, '([)])');
                             $stack[$level][$pnt[$level]]['value'] = $values;
                         } else {
-                            if (GeneralUtility::inList('IN,NOT IN', $stack[$level][$pnt[$level]]['comparator']) && preg_match('/^[(][[:space:]]*SELECT[[:space:]]+/', $parseString)) {
+                            $comparator = $this->normalizeKeyword($stack[$level][$pnt[$level]]['comparator']);
+                            if (($comparator === 'IN' || $comparator == 'NOT IN') && preg_match('/^[(][[:space:]]*SELECT[[:space:]]+/', $parseString)) {
                                 $this->nextPart($parseString, '^([(])');
                                 $stack[$level][$pnt[$level]]['subquery'] = $this->parseSELECT($parseString, $parameterReferences);
                                 // Seek to new position in parseString after parsing of the subquery
@@ -1363,20 +1364,18 @@ class SqlParser
                                 if (!$this->nextPart($parseString, '^([)])')) {
                                     return 'No ) parenthesis at end of subquery';
                                 }
+                            } elseif ($comparator === 'BETWEEN' || $comparator === 'NOT BETWEEN') {
+                                $stack[$level][$pnt[$level]]['values'] = array();
+                                $stack[$level][$pnt[$level]]['values'][0] = $this->getValue($parseString);
+                                if (!$this->nextPart($parseString, '^(AND)')) {
+                                    return $this->parseError('No AND operator found as expected in parseWhereClause()', $parseString);
+                                }
+                                $stack[$level][$pnt[$level]]['values'][1] = $this->getValue($parseString);
                             } else {
-                                if (GeneralUtility::inList('BETWEEN,NOT BETWEEN', $stack[$level][$pnt[$level]]['comparator'])) {
-                                    $stack[$level][$pnt[$level]]['values'] = array();
-                                    $stack[$level][$pnt[$level]]['values'][0] = $this->getValue($parseString);
-                                    if (!$this->nextPart($parseString, '^(AND)')) {
-                                        return $this->parseError('No AND operator found as expected in parseWhereClause()', $parseString);
-                                    }
-                                    $stack[$level][$pnt[$level]]['values'][1] = $this->getValue($parseString);
-                                } else {
-                                    // Finding value for comparator:
-                                    $stack[$level][$pnt[$level]]['value'] = &$this->getValueOrParameter($parseString, $stack[$level][$pnt[$level]]['comparator'], '', $parameterReferences);
-                                    if ($this->parse_error) {
-                                        return $this->parse_error;
-                                    }
+                                // Finding value for comparator:
+                                $stack[$level][$pnt[$level]]['value'] = &$this->getValueOrParameter($parseString, $stack[$level][$pnt[$level]]['comparator'], '', $parameterReferences);
+                                if ($this->parse_error) {
+                                    return $this->parse_error;
                                 }
                             }
                         }
@@ -1539,7 +1538,8 @@ class SqlParser
      * @param string $parseString The parseString
      * @param string $comparator The comparator used before.
      * @param string $mode The mode, e.g., "INDEX
-     * @param mixed The value (string/integer) or parameter (:name/?). Otherwise an array with error message in first key (0)
+     * @param mixed $parameterReferences The value (string/integer) or parameter (:name/?). Otherwise an array with error message in first key (0)
+     * @return mixed
      */
     protected function &getValueOrParameter(&$parseString, $comparator = '', $mode = '', array &$parameterReferences = array())
     {
@@ -1576,7 +1576,8 @@ class SqlParser
     protected function getValue(&$parseString, $comparator = '', $mode = '')
     {
         $value = '';
-        if (GeneralUtility::inList('NOTIN,IN,_LIST', strtoupper(str_replace(array(' ', LF, CR, TAB), '', $comparator)))) {
+        $comparator = $this->normalizeKeyword($comparator);
+        if ($comparator === 'NOTIN' || $comparator === 'IN' || $comparator === '_LIST') {
             // List of values:
             if ($this->nextPart($parseString, '^([(])')) {
                 $listValues = array();
index f53eeee..ddafa75 100644 (file)
@@ -603,13 +603,14 @@ class FrontendLoginController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin
         }
         // The permanent login checkbox should only be shown if permalogin is not deactivated (-1),
         // not forced to be always active (2) and lifetime is greater than 0
+        $permalogin = (int)$GLOBALS['TYPO3_CONF_VARS']['FE']['permalogin'];
         if (
             $this->conf['showPermaLogin']
-            && GeneralUtility::inList('0,1', $GLOBALS['TYPO3_CONF_VARS']['FE']['permalogin'])
+            && ($permalogin === 0 || $permalogin === 1)
             && $GLOBALS['TYPO3_CONF_VARS']['FE']['lifetime'] > 0
         ) {
             $markerArray['###PERMALOGIN###'] = $this->pi_getLL('permalogin', '', true);
-            if ($GLOBALS['TYPO3_CONF_VARS']['FE']['permalogin'] == 1) {
+            if ($permalogin === 1) {
                 $markerArray['###PERMALOGIN_HIDDENFIELD_ATTRIBUTES###'] = 'disabled="disabled"';
                 $markerArray['###PERMALOGIN_CHECKBOX_ATTRIBUTES###'] = 'checked="checked"';
             } else {
index c89ba30..bb9a4ed 100644 (file)
@@ -1621,7 +1621,12 @@ class ContentObjectRenderer
     public function getBorderAttr($borderAttr)
     {
         $tsfe = $this->getTypoScriptFrontendController();
-        if (!GeneralUtility::inList('xhtml_strict,xhtml_11,xhtml_2', $tsfe->xhtmlDoctype) && $tsfe->config['config']['doctype'] != 'html5' && !$tsfe->config['config']['disableImgBorderAttr']) {
+        $docType = $tsfe->xhtmlDoctype;
+        if (
+            $docType !== 'xhtml_strict' && $docType !== 'xhtml_11' && $docType !== 'xhtml_2'
+            && $tsfe->config['config']['doctype'] !== 'html5'
+            && !$tsfe->config['config']['disableImgBorderAttr']
+        ) {
             return $borderAttr;
         }
         return '';
@@ -1821,7 +1826,8 @@ class ContentObjectRenderer
             }
             // Create TARGET-attribute only if the right doctype is used
             $target = '';
-            if (!GeneralUtility::inList('xhtml_strict,xhtml_11,xhtml_2', $this->getTypoScriptFrontendController()->xhtmlDoctype)) {
+            $xhtmlDocType = $this->getTypoScriptFrontendController()->xhtmlDoctype;
+            if ($xhtmlDocType !== 'xhtml_strict' && $xhtmlDocType !== 'xhtml_11' && $xhtmlDocType !== 'xhtml_2') {
                 $target = isset($conf['target.'])
                     ? (string)$this->stdWrap($conf['target'], $conf['target.'])
                     : (string)$conf['target'];
@@ -1881,8 +1887,9 @@ class ContentObjectRenderer
         $tsfe = $this->getTypoScriptFrontendController();
         $incFile = $tsfe->tmpl->getFileName($fName);
         if ($incFile && file_exists($incFile)) {
-            $fileinfo = GeneralUtility::split_fileref($incFile);
-            if (GeneralUtility::inList('jpg,gif,jpeg,png', $fileinfo['fileext'])) {
+            $fileInfo = GeneralUtility::split_fileref($incFile);
+            $extension = $fileInfo['fileext'];
+            if ($extension === 'jpg' || $extension === 'jpeg' || $extension === 'gif' || $extension === 'png') {
                 $imgFile = $incFile;
                 $imgInfo = @getImageSize($imgFile);
                 return '<img src="' . $tsfe->absRefPrefix . $imgFile . '" width="' . (int)$imgInfo[0] . '" height="' . (int)$imgInfo[1] . '"' . $this->getBorderAttr(' border="0"') . ' ' . $addParams . ' />';
@@ -6337,10 +6344,10 @@ class ContentObjectRenderer
     protected function detectLinkTypeFromLinkParameter($linkParameter)
     {
         // Parse URL:
-        $linkParts = parse_url($linkParameter);
+        $scheme = parse_url($linkParameter, PHP_URL_SCHEME);
         // Detecting kind of link:
         // If it's a mail address:
-        if (strpos($linkParameter, '@') > 0 && (!$linkParts['scheme'] || $linkParts['scheme'] === 'mailto')) {
+        if (strpos($linkParameter, '@') > 0 && (!$scheme || $scheme === 'mailto')) {
             return 'mailto';
         }
 
@@ -6355,7 +6362,8 @@ class ContentObjectRenderer
             list($rootFileDat) = explode('?', rawurldecode($linkParameter));
             $containsSlash = strpos($rootFileDat, '/') !== false;
             $rFD_fI = pathinfo($rootFileDat);
-            if (trim($rootFileDat) && !$containsSlash && (@is_file((PATH_site . $rootFileDat)) || GeneralUtility::inList('php,html,htm', strtolower($rFD_fI['extension'])))) {
+            $fileExtension = strtolower($rFD_fI['extension']);
+            if ($fileExtension === 'php' || $fileExtension === 'html' || $fileExtension === 'htm' || trim($rootFileDat) && !$containsSlash && (@is_file((PATH_site . $rootFileDat)))) {
                 $isLocalFile = 1;
             } elseif ($containsSlash) {
                 // Adding this so realurl directories are linked right (non-existing).
@@ -6364,7 +6372,7 @@ class ContentObjectRenderer
         }
 
         // url (external): If doubleSlash or if a '.' comes before a '/'.
-        if ($linkParts['scheme'] || $isLocalFile != 1 && $urlChar && (!$containsSlash || $urlChar < $fileChar)) {
+        if ($scheme || $isLocalFile !== 1 && $urlChar && (!$containsSlash || $urlChar < $fileChar)) {
             return 'url';
 
         // file (internal)
@@ -6778,7 +6786,8 @@ class ContentObjectRenderer
 
         if ($JSwindowParams) {
             // Create TARGET-attribute only if the right doctype is used
-            if (!GeneralUtility::inList('xhtml_strict,xhtml_11,xhtml_2', $tsfe->xhtmlDoctype)) {
+            $xhtmlDocType = $tsfe->xhtmlDoctype;
+            if ($xhtmlDocType !== 'xhtml_strict' && $xhtmlDocType !== 'xhtml_11' && $xhtmlDocType !== 'xhtml_2') {
                 $target = ' target="FEopenLink"';
             } else {
                 $target = '';
@@ -7323,9 +7332,9 @@ class ContentObjectRenderer
         $lines = GeneralUtility::trimExplode(LF, $params, true);
         foreach ($lines as $val) {
             $pair = explode('=', $val, 2);
-            $pair[0] = trim($pair[0]);
-            if (!GeneralUtility::inList('#,/', $pair[0][0])) {
-                $paramArr[$pair[0]] = trim($pair[1]);
+            $key = trim($pair[0]);
+            if ($key[0] !== '#' && $key[0] !== '/') {
+                $paramArr[$key] = trim($pair[1]);
             }
         }
         return $paramArr;
index 9a78070..927f224 100644 (file)
@@ -134,7 +134,7 @@ var ' . $this->JSVarName . $a . '=0;';
             $MP_var = implode(',', $MP_array_sub);
             $MP_params = $MP_var ? '&MP=' . rawurlencode($MP_var) : '';
             // If item is a spacer, $spacer is set
-            $spacer = GeneralUtility::inList($this->spacerIDList, $data['doktype']) ? 1 : 0;
+            $spacer = GeneralUtility::inList($this->spacerIDList, $data['doktype']);
             // If the spacer-function is not enabled, spacers will not enter the $menuArr
             if ($this->mconf['SPC'] || !$spacer) {
                 // Page may not be 'not_in_menu' or 'Backend User Section' + not in banned uid's
index 5961e1e..0cd60cf 100644 (file)
@@ -14,8 +14,6 @@ namespace TYPO3\CMS\Frontend\Page;
  * The TYPO3 project - inspiring people to share!
  */
 
-use TYPO3\CMS\Core\Utility\GeneralUtility;
-
 /**
  * Logic for cHash calculation
  */
@@ -170,7 +168,7 @@ class CacheHashCalculator implements \TYPO3\CMS\Core\SingletonInterface
      */
     protected function isCoreParameter($key)
     {
-        return GeneralUtility::inList('id,type,no_cache,cHash,MP,ftu', $key);
+        return $key === 'id' || $key === 'type' || $key === 'no_cache' || $key === 'cHash' || $key === 'MP' || $key === 'ftu';
     }
 
     /**
@@ -209,6 +207,7 @@ class CacheHashCalculator implements \TYPO3\CMS\Core\SingletonInterface
      * Check whether the given parameter may be used even with an empty value
      *
      * @param $key
+     * @return bool
      */
     protected function isAllowedWithEmptyValue($key)
     {
index 499f003..4211179 100644 (file)
@@ -176,7 +176,8 @@ class ImportExportController extends BaseScriptClass
                 // Finally: If upload went well, set the new file as the import file:
                 if (!empty($this->uploadedFiles[0])) {
                     // Only allowed extensions....
-                    if (GeneralUtility::inList('t3d,xml', $this->uploadedFiles[0]->getExtension())) {
+                    $extension = $this->uploadedFiles[0]->getExtension();
+                    if ($extension === 't3d' || $extension === 'xml') {
                         $inData['file'] = $this->uploadedFiles[0]->getCombinedIdentifier();
                     }
                 }
@@ -1251,7 +1252,8 @@ class ImportExportController extends BaseScriptClass
                 // Thumbnail icon:
                 if (is_array($import->dat['header']['thumbnail'])) {
                     $pI = pathinfo($import->dat['header']['thumbnail']['filename']);
-                    if (GeneralUtility::inList('gif,jpg,png,jpeg', strtolower($pI['extension']))) {
+                    $extension = strtolower($pI['extension']);
+                    if ($extension === 'jpg' || $extension === 'jpeg' || $extension === 'gif' || $extension === 'png') {
                         // Construct filename and write it:
                         $fileName = PATH_site . 'typo3temp/importthumb.' . $pI['extension'];
                         GeneralUtility::writeFile($fileName, $import->dat['header']['thumbnail']['content']);
index 74c3726..9646e09 100644 (file)
@@ -3788,7 +3788,8 @@ class ImportExport
                 $pInfo['type'] = 'softref';
                 $pInfo['_softRefInfo'] = $info;
                 $pInfo['type'] = 'softref';
-                if ($info['error'] && !GeneralUtility::inList('editable,exclude', $this->softrefCfg[$info['subst']['tokenID']]['mode'])) {
+                $mode = $this->softrefCfg[$info['subst']['tokenID']]['mode'];
+                if ($info['error'] && $mode !== 'editable' && $mode !== 'exclude') {
                     $pInfo['msg'] .= $info['error'];
                 }
                 $lines[] = $pInfo;
@@ -4130,7 +4131,8 @@ class ImportExport
      */
     public function includeSoftref($tokenID)
     {
-        return $tokenID && !GeneralUtility::inList('exclude,editable', $this->softrefCfg[$tokenID]['mode']);
+        $mode = $this->softrefCfg[$tokenID]['mode'];
+        return $tokenID && $mode !== 'exclude' && $mode !== 'editable';
     }
 
     /**
index 977083a..345d76d 100644 (file)
@@ -205,7 +205,11 @@ class Lexer
             if ($len) {
                 if ($letter) {
                     // We are in a sequence of words
-                    if (!$cType || $cType_prev == 'cjk' && \TYPO3\CMS\Core\Utility\GeneralUtility::inList('num,alpha', $cType) || $cType == 'cjk' && \TYPO3\CMS\Core\Utility\GeneralUtility::inList('num,alpha', $cType_prev)) {
+                    if (
+                        !$cType
+                        || $cType_prev == 'cjk' && ($cType === 'num' || $cType === 'alpha')
+                        || $cType == 'cjk' && ($cType_prev === 'num' || $cType_prev === 'alpha')
+                    ) {
                         // Check if the non-letter char is NOT a print-join char because then it signifies the end of the word.
                         if (!in_array($cp, $this->lexerConf['printjoins'])) {
                             // If a printjoin start length has been recorded, set that back now so the length is right (filtering out multiple end chars)
index 4e77dbe..f234049 100644 (file)
@@ -164,18 +164,13 @@ NOW Running --AUTOFIX on result. OK?' . ($this->cli_isArg('--dryrun') ? ' (--dry
     {
         // Reference index option:
         $refIndexMode = isset($this->cli_args['--refindex']) ? $this->cli_args['--refindex'][0] : 'check';
-        if (!GeneralUtility::inList('update,ignore,check', $refIndexMode)) {
-            $this->cli_echo('ERROR: Wrong value for --refindex argument.
-', 1);
-            die;
-        }
         switch ($refIndexMode) {
             case 'check':
 
             case 'update':
                 $refIndexObj = GeneralUtility::makeInstance(\TYPO3\CMS\Core\Database\ReferenceIndex::class);
-                list($headerContent, $bodyContent, $errorCount) = $refIndexObj->updateIndex($refIndexMode == 'check', $this->cli_echo());
-                if ($errorCount && $refIndexMode == 'check') {
+                list($headerContent, $bodyContent, $errorCount) = $refIndexObj->updateIndex($refIndexMode === 'check', $this->cli_echo());
+                if ($errorCount && $refIndexMode === 'check') {
                     $ok = false;
                     $this->cli_echo('ERROR: Reference Index Check failed! (run with \'--refindex update\' to fix)
 ', 1);
@@ -188,6 +183,11 @@ NOW Running --AUTOFIX on result. OK?' . ($this->cli_isArg('--dryrun') ? ' (--dry
 ');
                 $ok = true;
                 break;
+            default:
+                $this->cli_echo('ERROR: Wrong value for --refindex argument.
+', 1);
+                die();
+
         }
         return $ok;
     }
index 9a82d11..a5076b4 100644 (file)
@@ -891,8 +891,8 @@ class AbstractDatabaseRecordList extends AbstractRecordList
     public function linkUrlMail($code, $testString)
     {
         // Check for URL:
-        $schema = parse_url($testString);
-        if ($schema['scheme'] && GeneralUtility::inList('http,https,ftp', $schema['scheme'])) {
+        $scheme = parse_url($testString, PHP_URL_SCHEME);
+        if ($scheme === 'http' || $scheme === 'https' || $scheme === 'ftp') {
             return '<a href="' . htmlspecialchars($testString) . '" target="_blank">' . $code . '</a>';
         }
         // Check for email:
index 26371aa..dfb8c9c 100644 (file)
@@ -206,8 +206,6 @@ class SpellCheckingController
         }
         // Setting the pspell suggestion mode
         $this->pspellMode = GeneralUtility::_POST('pspell_mode') ? GeneralUtility::_POST('pspell_mode') : $this->pspellMode;
-        // Now sanitize $this->pspellMode
-        $this->pspellMode = GeneralUtility::inList('ultra,fast,normal,bad-spellers', $this->pspellMode) ? $this->pspellMode : 'normal';
         switch ($this->pspellMode) {
             case 'ultra':
 
@@ -221,6 +219,8 @@ class SpellCheckingController
 
             default:
                 $pspellModeFlag = PSPELL_NORMAL;
+                // sanitize $this->pspellMode
+                $this->pspellMode = 'normal';
         }
         // Setting the charset
         if (GeneralUtility::_POST('pspell_charset')) {
index 741e16e..92668ae 100644 (file)
@@ -53,7 +53,8 @@ class Evaluator
         $isEnabled = $this->mode ? \TYPO3\CMS\Saltedpasswords\Utility\SaltedPasswordsUtility::isUsageEnabled($this->mode) : \TYPO3\CMS\Saltedpasswords\Utility\SaltedPasswordsUtility::isUsageEnabled();
         if ($isEnabled) {
             $isMD5 = preg_match('/[0-9abcdef]{32,32}/', $value);
-            $isDeprecatedSaltedHash = \TYPO3\CMS\Core\Utility\GeneralUtility::inList('C$,M$', substr($value, 0, 2));
+            $hashingMethod = substr($value, 0, 2);
+            $isDeprecatedSaltedHash = ($hashingMethod === 'C$' || $hashingMethod === 'M$');
             /** @var $objInstanceSaltedPW \TYPO3\CMS\Saltedpasswords\Salt\SaltInterface */
             $objInstanceSaltedPW = \TYPO3\CMS\Saltedpasswords\Salt\SaltFactory::getSaltingInstance(null, $this->mode);
             if ($isMD5) {
index 278e98c..ac6b280 100644 (file)
@@ -116,7 +116,7 @@ class SaltedPasswordService extends \TYPO3\CMS\Sv\AbstractAuthenticationService
             $skip = false;
             // Test for wrong salted hashing method
             if ($validPasswd && !(get_class($this->objInstanceSaltedPW) == $defaultHashingClassName) || is_subclass_of($this->objInstanceSaltedPW, $defaultHashingClassName)) {
-                // Instanciate default method class
+                // Instantiate default method class
                 $this->objInstanceSaltedPW = \TYPO3\CMS\Saltedpasswords\Salt\SaltFactory::getSaltingInstance(null);
                 $this->updatePassword((int)$user['uid'], array('password' => $this->objInstanceSaltedPW->getHashedPassword($password)));
             }
@@ -125,11 +125,12 @@ class SaltedPasswordService extends \TYPO3\CMS\Sv\AbstractAuthenticationService
             }
         } elseif (!(int)$this->extConf['forceSalted']) {
             // Stored password is in deprecated salted hashing method
-            if (\TYPO3\CMS\Core\Utility\GeneralUtility::inList('C$,M$', substr($user['password'], 0, 2))) {
-                // Instanciate default method class
+            $hashingMethod = substr($user['password'], 0, 2);
+            if ($hashingMethod === 'C$' || $hashingMethod === 'M$') {
+                // Instantiate default method class
                 $this->objInstanceSaltedPW = \TYPO3\CMS\Saltedpasswords\Salt\SaltFactory::getSaltingInstance(substr($user['password'], 1));
                 // md5
-                if ($user['password'][0] === 'M') {
+                if ($hashingMethod === 'M$') {
                     $validPasswd = $this->objInstanceSaltedPW->checkPassword(md5($password), substr($user['password'], 1));
                 } else {
                     $validPasswd = $this->objInstanceSaltedPW->checkPassword($password, substr($user['password'], 1));
@@ -149,7 +150,7 @@ class SaltedPasswordService extends \TYPO3\CMS\Sv\AbstractAuthenticationService
             }
             // Should we store the new format value in DB?
             if ($validPasswd && (int)$this->extConf['updatePasswd']) {
-                // Instanciate default method class
+                // Instantiate default method class
                 $this->objInstanceSaltedPW = \TYPO3\CMS\Saltedpasswords\Salt\SaltFactory::getSaltingInstance(null);
                 $this->updatePassword((int)$user['uid'], array('password' => $this->objInstanceSaltedPW->getHashedPassword($password)));
             }
index 5b6f19c..68b85cd 100755 (executable)
@@ -282,7 +282,7 @@ class ExtensionManagerConfigurationUtility
         $lang = $this->getLanguageService();
         if ($extConf['enabled']) {
             $loginSecurityLevel = trim($GLOBALS['TYPO3_CONF_VARS']['FE']['loginSecurityLevel']) ?: 'normal';
-            if (!GeneralUtility::inList('normal,rsa', $loginSecurityLevel)) {
+            if ($loginSecurityLevel !== 'normal' && $loginSecurityLevel !== 'rsa') {
                 $this->setErrorLevel('info');
                 $problems[] = '<strong>' . $lang->getLL('ext.saltedpasswords.configuration.label.important') .
                     '</strong><br /> ' .
index 85d93ba..c80358c 100644 (file)
@@ -13,7 +13,6 @@ namespace TYPO3\CMS\Saltedpasswords\Utility;
  *
  * The TYPO3 project - inspiring people to share!
  */
-use TYPO3\CMS\Core\Utility\GeneralUtility;
 
 /**
  * General library class.
@@ -125,7 +124,7 @@ class SaltedPasswordsUtility
         if ($mode === 'BE') {
             return true;
         } elseif ($mode === 'FE' && $extConf['enabled']) {
-            return GeneralUtility::inList('normal,rsa', $securityLevel);
+            return $securityLevel === 'normal' || $securityLevel === 'rsa';
         }
         return false;
     }
index 686e69b..59841d7 100644 (file)
@@ -47,9 +47,10 @@ class EvaluatorTest extends \TYPO3\CMS\Core\Tests\UnitTestCase
         $isSet = null;
         $originalPassword = 'password';
         $saltedPassword = $this->subject->evaluateFieldValue($originalPassword, '', $isSet);
+        $hashingMethod = substr($saltedPassword, 0, 3);
         $this->assertTrue($isSet);
         $this->assertNotEquals($originalPassword, $saltedPassword);
-        $this->assertTrue(GeneralUtility::inList('$1$,$2$,$2a,$P$', substr($saltedPassword, 0, 3)));
+        $this->assertTrue($hashingMethod === '$1$' || $hashingMethod === '$2$' || $hashingMethod === '$2a' || $hashingMethod === '$P$');
     }
 
     /**
index ef9130a..49c3b40 100644 (file)
@@ -893,7 +893,7 @@ class SetupModuleController extends AbstractModule
             // Setting comes from another extension
             $context = $strParts[0];
             $field = $strParts[1];
-        } elseif (!GeneralUtility::inList('language,simuser,reset', $str)) {
+        } elseif ($str !== 'language' && $str !== 'simuser' && $str !== 'reset') {
             $field = 'option_' . $str;
         }
         return BackendUtility::wrapInHelp($context, $field, $label);
index 35772cf..f70b35e 100644 (file)
@@ -299,7 +299,7 @@ class VersionModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClass
                                                                        </tr>
                                                                ';
                     foreach ($diff_1_record as $fN => $fV) {
-                        if ($GLOBALS['TCA'][$this->table]['columns'][$fN] && $GLOBALS['TCA'][$this->table]['columns'][$fN]['config']['type'] !== 'passthrough' && !GeneralUtility::inList('t3ver_label', $fN)) {
+                        if ($GLOBALS['TCA'][$this->table]['columns'][$fN] && $GLOBALS['TCA'][$this->table]['columns'][$fN]['config']['type'] !== 'passthrough' && $fN !== 't3ver_label') {
                             if ((string)$diff_1_record[$fN] !== (string)$diff_2_record[$fN]) {
                                 $diffres = $diffUtility->makeDiffDisplay(
                                     BackendUtility::getProcessedValue($this->table, $fN, $diff_2_record[$fN], 0, 1),
index cb9dcd0..08b1ecd 100644 (file)
@@ -292,7 +292,7 @@ class CommandMap
     {
         $scope = self::SCOPE_WorkspacesSwap;
         $dependency = $this->getDependencyUtility($scope);
-        if (GeneralUtility::inList('any,pages', $this->workspacesSwapMode)) {
+        if ($this->workspacesSwapMode === 'any' || $this->workspacesSwapMode === 'pages') {
             $this->invokeWorkspacesSwapItems('applyWorkspacesSwapBehaviour');
         }
         $this->invokeWorkspacesSwapItems('addWorkspacesSwapElements', array($dependency));
@@ -386,7 +386,7 @@ class CommandMap
     {
         $scope = self::SCOPE_WorkspacesSetStage;
         $dependency = $this->getDependencyUtility($scope);
-        if (GeneralUtility::inList('any,pages', $this->workspacesChangeStageMode)) {
+        if ($this->workspacesChangeStageMode === 'any' || $this->workspacesChangeStageMode === 'pages') {
             $this->invokeWorkspacesSetStageItems('applyWorkspacesSetStageBehaviour');
         }
         $this->invokeWorkspacesSetStageItems('explodeSetStage');
@@ -407,7 +407,7 @@ class CommandMap
         $extendedCommandMap = array();
         $versionIds = GeneralUtility::trimExplode(',', $versionIdList, true);
         $elementList = array($table => $versionIds);
-        if (GeneralUtility::inList('any,pages', $this->workspacesChangeStageMode)) {
+        if ($this->workspacesChangeStageMode === 'any' || $this->workspacesChangeStageMode === 'pages') {
             if (count($versionIds) === 1) {
                 $workspaceRecord = BackendUtility::getRecord($table, $versionIds[0], 't3ver_wsid');
                 $workspaceId = $workspaceRecord['t3ver_wsid'];
index b5ec559..67676d0 100644 (file)
@@ -93,7 +93,8 @@ class ElementEntityProcessor
     public function createNewDependentElementChildReferenceCallback(array $callerArguments, array $targetArgument, ElementEntity $caller, $eventName)
     {
         $fieldConfiguration = BackendUtility::getTcaFieldConfiguration($caller->getTable(), $callerArguments['field']);
-        if (!$fieldConfiguration || ($fieldConfiguration['type'] !== 'flex' && !GeneralUtility::inList('field,list', $this->getDataHandler()->getInlineFieldType($fieldConfiguration)))) {
+        $inlineFieldType = $this->getDataHandler()->getInlineFieldType($fieldConfiguration);
+        if (!$fieldConfiguration || ($fieldConfiguration['type'] !== 'flex' && $inlineFieldType !== 'field' && $inlineFieldType !== 'list')) {
             return ElementEntity::RESPONSE_Skip;
         }
         return null;
@@ -111,7 +112,8 @@ class ElementEntityProcessor
     public function createNewDependentElementParentReferenceCallback(array $callerArguments, array $targetArgument, ElementEntity $caller, $eventName)
     {
         $fieldConfiguration = BackendUtility::getTcaFieldConfiguration($callerArguments['table'], $callerArguments['field']);
-        if (!$fieldConfiguration || ($fieldConfiguration['type'] !== 'flex' && !GeneralUtility::inList('field,list', $this->getDataHandler()->getInlineFieldType($fieldConfiguration)))) {
+        $inlineFieldType = $this->getDataHandler()->getInlineFieldType($fieldConfiguration);
+        if (!$fieldConfiguration || ($fieldConfiguration['type'] !== 'flex' && $inlineFieldType !== 'field' && $inlineFieldType !== 'list')) {
             return ElementEntity::RESPONSE_Skip;
         }
         return null;
index 4593c91..8a13013 100644 (file)
@@ -45,7 +45,7 @@ class SortPagesWizardModuleFunction extends \TYPO3\CMS\Backend\Module\AbstractFu
             $sortByField = GeneralUtility::_GP('sortByField');
             if ($sortByField) {
                 $menuItems = array();
-                if (GeneralUtility::inList('title,subtitle,crdate,tstamp', $sortByField)) {
+                if ($sortByField === 'title' || $sortByField === 'subtitle' || $sortByField === 'crdate' || $sortByField === 'tstamp') {
                     $menuItems = $sys_pages->getMenu($this->pObj->id, 'uid,pid,title', $sortByField, '', false);
                 } elseif ($sortByField === 'REV') {
                     $menuItems = $sys_pages->getMenu($this->pObj->id, 'uid,pid,title', 'sorting', '', false);