[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 <markus.klein@typo3.org>
Tested-by: Markus Klein <markus.klein@typo3.org>
Tested-by: TYPO3com <no-reply@typo3.com>
Reviewed-by: Stefan Neufeind <typo3.neufeind@speedpartner.de>
Reviewed-by: Benni Mack <benni@typo3.org>
Tested-by: Benni Mack <benni@typo3.org>
This commit is contained in:
Georg Ringer 2017-01-30 07:42:37 +01:00 committed by Benni Mack
parent 05068ee910
commit c75e9667e6

View file

@ -233,7 +233,7 @@ class FrontendEditPanel
} elseif ($conf['beforeLastTag'] > 0) {
$cBuf = rtrim($content);
$secureCount = 30;
while ($secureCount && substr($cBuf, -1) == '>' && substr($cBuf, -4) != '</a>') {
while ($secureCount && substr($cBuf, -1) === '>' && substr($cBuf, -4) !== '</a>') {
$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) {