From c75e9667e6808debf8149087d7ba5adeacc4146f Mon Sep 17 00:00:00 2001 From: Georg Ringer Date: Mon, 30 Jan 2017 07:42:37 +0100 Subject: [PATCH] [TASK] Use strict comparison for strings Change string comparison for string checks. Checks which could lead to false positives like comparing with '0' or '' are excluded. RegEx used to find affected places: (?<=\s)((?:!|=)=)(?=[^=]'[^0-9'\n]+') Resolves: #79540 Resolves: master Change-Id: I9a04bdd9e0e78cc97036560709bb505097bf48f9 Reviewed-on: https://review.typo3.org/51462 Reviewed-by: Markus Klein Tested-by: Markus Klein Tested-by: TYPO3com Reviewed-by: Stefan Neufeind Reviewed-by: Benni Mack Tested-by: Benni Mack --- Classes/FrontendEditPanel.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Classes/FrontendEditPanel.php b/Classes/FrontendEditPanel.php index 9cda050..f41b232 100644 --- a/Classes/FrontendEditPanel.php +++ b/Classes/FrontendEditPanel.php @@ -233,7 +233,7 @@ class FrontendEditPanel } elseif ($conf['beforeLastTag'] > 0) { $cBuf = rtrim($content); $secureCount = 30; - while ($secureCount && substr($cBuf, -1) == '>' && substr($cBuf, -4) != '') { + while ($secureCount && substr($cBuf, -1) === '>' && substr($cBuf, -4) !== '') { $cBuf = rtrim(preg_replace('/<[^<]*>$/', '', $cBuf)); $secureCount--; } @@ -259,12 +259,12 @@ class FrontendEditPanel protected function editPanelLinkWrap($string, $formName, $cmd, $currentRecord = '', $confirm = '', $nPid = '') { $nV = GeneralUtility::_GP('ADMCMD_view') ? 1 : 0; - if ($cmd == 'edit') { + if ($cmd === 'edit') { $rParts = explode(':', $currentRecord); $out = $this->editPanelLinkWrap_doWrap($string, BackendUtility::getModuleUrl('record_edit', ['edit[' . $rParts[0] . '][' . $rParts[1] . ']' => 'edit', 'noView' => $nV, 'feEdit' => 1]), $currentRecord); - } elseif ($cmd == 'new') { + } elseif ($cmd === 'new') { $rParts = explode(':', $currentRecord); - if ($rParts[0] == 'pages') { + if ($rParts[0] === 'pages') { $out = $this->editPanelLinkWrap_doWrap($string, BackendUtility::getModuleUrl('db_new', ['id' => $rParts[1], 'pagesOnly' => 1]), $currentRecord); } else { if (!(int)$nPid) {