[TASK] Remove duplicate calls to substr in InfoPageTyposcriptConfigController 14/50514/2
authorWouter Wolters <typo3@wouterwolters.nl>
Sun, 6 Nov 2016 16:14:03 +0000 (17:14 +0100)
committerTymoteusz Motylewski <t.motylewski@gmail.com>
Mon, 7 Nov 2016 09:52:53 +0000 (10:52 +0100)
substr is called 3 times with the same parameters, use one variable for this.

Resolves: #78583
Releases: master
Change-Id: Idc57e143c26cd190f8047d59f1e36cb745e9aaf8
Reviewed-on: https://review.typo3.org/50514
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Andreas Fernandez <typo3@scripting-base.de>
Tested-by: Andreas Fernandez <typo3@scripting-base.de>
Reviewed-by: Tymoteusz Motylewski <t.motylewski@gmail.com>
Tested-by: Tymoteusz Motylewski <t.motylewski@gmail.com>
typo3/sysext/info_pagetsconfig/Classes/Controller/InfoPageTyposcriptConfigController.php

index 4b86fe6..689edde 100644 (file)
@@ -103,16 +103,16 @@ class InfoPageTyposcriptConfigController extends \TYPO3\CMS\Backend\Module\Abstr
                 $pUids = [];
 
                 foreach ($TSparts as $k => $v) {
-                    if ($k != 'uid_0') {
+                    if ($k !== 'uid_0') {
                         $line = [];
-                        if ($k == 'defaultPageTSconfig') {
+                        if ($k === 'defaultPageTSconfig') {
                             $line['defaultPageTSconfig'] = 1;
                         } else {
-                            $pUids[] = substr($k, 4);
-                            $row = BackendUtility::getRecordWSOL('pages', substr($k, 4));
+                            $editIdList = substr($k, 4);
+                            $pUids[] = $editIdList;
+                            $row = BackendUtility::getRecordWSOL('pages', $editIdList);
 
                             $icon = $this->iconFactory->getIconForRecord('pages', $row, Icon::SIZE_SMALL);
-                            $editIdList = substr($k, 4);
                             $urlParameters = [
                                 'edit' => [
                                     'pages' => [