[TASK] Replace all strcmp() calls with === 43/25843/30
authorJo Hasenau <info@cybercraft.de>
Sun, 1 Dec 2013 13:34:14 +0000 (14:34 +0100)
committerMarkus Klein <klein.t3@mfc-linz.at>
Thu, 9 Jan 2014 14:09:21 +0000 (15:09 +0100)
This patch replaces about 300 places using strcmp()
in the whole core. There are different contexts for strcmp()
within this set, i.e. checking for strings being '0',
'', not '' and the like.

strcmp() has to stay when it comes to real sorting of strings,
which is a rather rare case, otherwise it can be replaced with
faster alternatives.

The following 'rules' were used for the replacement:

* Use a type cast if you can't be sure about the incoming values.
  We do not need type casts if the types are implicitly defined
  before by another function. i.e. intval(), trim(), substr()
* Use int-cast whenever the values to be compared are numbers only.
* Use string-cast for any other combination. i.e
  (string)$len === '0' when $len can be NULL, which is different
  to (int)$len === 0

Resolves: #54085
Releases: 6.2
Change-Id: I88fb294ae20d8c23ff58d8296fbb37925d5213c8
Reviewed-on: https://review.typo3.org/25843
Reviewed-by: Markus Klein
Tested-by: Markus Klein
84 files changed:
typo3/sysext/backend/Classes/ClickMenu/ClickMenu.php
typo3/sysext/backend/Classes/Controller/ContentElement/NewContentElementController.php
typo3/sysext/backend/Classes/Controller/EditDocumentController.php
typo3/sysext/backend/Classes/Controller/PageLayoutController.php
typo3/sysext/backend/Classes/Controller/ShortcutFrameController.php
typo3/sysext/backend/Classes/Controller/Wizard/AddController.php
typo3/sysext/backend/Classes/Controller/Wizard/FormsController.php
typo3/sysext/backend/Classes/Controller/Wizard/ListController.php
typo3/sysext/backend/Classes/Controller/Wizard/RteController.php
typo3/sysext/backend/Classes/Form/DataPreprocessor.php
typo3/sysext/backend/Classes/Form/Element/InlineElement.php
typo3/sysext/backend/Classes/Form/Element/TreeElement.php
typo3/sysext/backend/Classes/Form/FormEngine.php
typo3/sysext/backend/Classes/Module/BaseScriptClass.php
typo3/sysext/backend/Classes/RecordList/AbstractRecordList.php
typo3/sysext/backend/Classes/RecordList/ElementBrowserRecordList.php
typo3/sysext/backend/Classes/Template/DocumentTemplate.php
typo3/sysext/backend/Classes/Toolbar/ShortcutToolbarItem.php
typo3/sysext/backend/Classes/Tree/View/BrowseTreeView.php
typo3/sysext/backend/Classes/Tree/View/FolderTreeView.php
typo3/sysext/backend/Classes/Tree/View/PagePositionMap.php
typo3/sysext/backend/Classes/Utility/BackendUtility.php
typo3/sysext/backend/Classes/View/PageLayoutView.php
typo3/sysext/backend/Classes/View/PageTreeView.php
typo3/sysext/backend/Classes/View/ThumbnailView.php
typo3/sysext/core/Classes/Authentication/AbstractUserAuthentication.php
typo3/sysext/core/Classes/Authentication/BackendUserAuthentication.php
typo3/sysext/core/Classes/Charset/CharsetConverter.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/QueryView.php
typo3/sysext/core/Classes/Database/ReferenceIndex.php
typo3/sysext/core/Classes/Database/RelationHandler.php
typo3/sysext/core/Classes/Database/SqlParser.php
typo3/sysext/core/Classes/Html/HtmlParser.php
typo3/sysext/core/Classes/Html/RteHtmlParser.php
typo3/sysext/core/Classes/TimeTracker/TimeTracker.php
typo3/sysext/core/Classes/TypoScript/ExtendedTemplateService.php
typo3/sysext/core/Classes/TypoScript/Parser/TypoScriptParser.php
typo3/sysext/core/Classes/TypoScript/TemplateService.php
typo3/sysext/core/Classes/Utility/DiffUtility.php
typo3/sysext/core/Classes/Utility/ExtensionManagementUtility.php
typo3/sysext/core/Classes/Utility/GeneralUtility.php
typo3/sysext/core/Tests/Unit/DataHandling/DataHandlerTest.php
typo3/sysext/cshmanual/Classes/Controller/HelpModuleController.php
typo3/sysext/css_styled_content/Classes/Controller/CssStyledContentController.php
typo3/sysext/extbase/Classes/Utility/ArrayUtility.php
typo3/sysext/extra_page_cm_options/Classes/ExtraPageContextMenuOptions.php
typo3/sysext/filelist/Classes/FileList.php
typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php
typo3/sysext/frontend/Classes/ContentObject/FormContentObject.php
typo3/sysext/frontend/Classes/ContentObject/Menu/AbstractMenuContentObject.php
typo3/sysext/frontend/Classes/Controller/TranslationStatusController.php
typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php
typo3/sysext/frontend/Classes/Page/PageGenerator.php
typo3/sysext/frontend/Classes/Page/PageRepository.php
typo3/sysext/impexp/Classes/Controller/ImportExportController.php
typo3/sysext/impexp/Classes/ImportExport.php
typo3/sysext/impexp/Classes/LocalPageTree.php
typo3/sysext/indexed_search/Classes/Controller/IndexedPagesController.php
typo3/sysext/indexed_search/Classes/Controller/SearchFormController.php
typo3/sysext/indexed_search/Classes/Domain/Repository/IndexSearchRepository.php
typo3/sysext/indexed_search/Classes/Indexer.php
typo3/sysext/install/Classes/Controller/Action/Tool/AllConfiguration.php
typo3/sysext/install/Classes/Service/SqlSchemaMigrationService.php
typo3/sysext/lang/Classes/LanguageService.php
typo3/sysext/lowlevel/Classes/View/DatabaseIntegrityView.php
typo3/sysext/recordlist/Classes/Browser/ElementBrowser.php
typo3/sysext/recordlist/Classes/RecordList/AbstractDatabaseRecordList.php
typo3/sysext/rtehtmlarea/Classes/BrowseLinks.php
typo3/sysext/rtehtmlarea/Classes/Controller/AccessibilityLinkController.php
typo3/sysext/rtehtmlarea/Classes/RteHtmlAreaBase.php
typo3/sysext/saltedpasswords/Classes/SaltedPasswordService.php
typo3/sysext/saltedpasswords/Tests/Unit/Salt/BlowfishSaltTest.php
typo3/sysext/saltedpasswords/Tests/Unit/Salt/Md5SaltTest.php
typo3/sysext/saltedpasswords/Tests/Unit/Salt/PhpassSaltTest.php
typo3/sysext/scheduler/Classes/CronCommand/NormalizeCommand.php
typo3/sysext/sys_action/Classes/ActionList.php
typo3/sysext/version/Classes/ClickMenu/VersionClickMenu.php
typo3/sysext/version/Classes/Controller/VersionModuleController.php
typo3/sysext/version/Classes/Hook/DataHandlerHook.php
typo3/sysext/viewpage/Classes/Controller/ViewModuleController.php
typo3/sysext/workspaces/Classes/ExtDirect/ExtDirectServer.php

index 2a075d1..3a2d721 100644 (file)
@@ -158,9 +158,8 @@ class ClickMenu {
                        @ini_set('display_errors', 0);
                }
                // Deal with Drag&Drop context menus
-               if (strcmp(GeneralUtility::_GP('dragDrop'), '')) {
-                       $CMcontent = $this->printDragDropClickMenu(GeneralUtility::_GP('dragDrop'), GeneralUtility::_GP('srcId'), GeneralUtility::_GP('dstId'));
-                       return $CMcontent;
+               if ((string)GeneralUtility::_GP('dragDrop') !== '') {
+                       return $this->printDragDropClickMenu(GeneralUtility::_GP('dragDrop'), GeneralUtility::_GP('srcId'), GeneralUtility::_GP('dstId'));
                }
                // Can be set differently as well
                $this->iParts[0] = GeneralUtility::_GP('table');
@@ -174,7 +173,7 @@ class ClickMenu {
                if ($GLOBALS['BE_USER']->uc['condensedMode'] || $this->iParts[2] == 2) {
                        $this->alwaysContentFrame = 1;
                }
-               if (strcmp($this->iParts[1], '')) {
+               if (isset($this->iParts[1]) && $this->iParts[1] !== '') {
                        $this->isDBmenu = 1;
                }
                $TSkey = ($this->isDBmenu ? 'page' : 'folder') . ($this->listFrame ? 'List' : 'Tree');
@@ -224,17 +223,18 @@ class ClickMenu {
         * @todo Define visibility
         */
        public function printDBClickMenu($table, $uid) {
+               $uid = intval($uid);
                // Get record:
                $this->rec = BackendUtility::getRecordWSOL($table, $uid);
                $menuItems = array();
                $root = 0;
                $DBmount = FALSE;
                // Rootlevel
-               if ($table == 'pages' && !strcmp($uid, '0')) {
+               if ($table === 'pages' && $uid === 0) {
                        $root = 1;
                }
                // DB mount
-               if ($table == 'pages' && in_array($uid, $GLOBALS['BE_USER']->returnWebmounts())) {
+               if ($table === 'pages' && in_array($uid, $GLOBALS['BE_USER']->returnWebmounts())) {
                        $DBmount = TRUE;
                }
                // Used to hide cut,copy icons for l10n-records
@@ -249,10 +249,10 @@ class ClickMenu {
                        $lCP = $GLOBALS['BE_USER']->calcPerms(BackendUtility::getRecord('pages', $table == 'pages' ? $this->rec['uid'] : $this->rec['pid']));
                        // View
                        if (!in_array('view', $this->disabledItems)) {
-                               if ($table == 'pages') {
+                               if ($table === 'pages') {
                                        $menuItems['view'] = $this->DB_view($uid);
                                }
-                               if ($table == $GLOBALS['TYPO3_CONF_VARS']['SYS']['contentTable']) {
+                               if ($table === $GLOBALS['TYPO3_CONF_VARS']['SYS']['contentTable']) {
                                        $ws_rec = BackendUtility::getRecordWSOL($table, $this->rec['uid']);
                                        $menuItems['view'] = $this->DB_view($ws_rec['pid']);
                                }
@@ -290,7 +290,7 @@ class ClickMenu {
                                        $root ? $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'] : GeneralUtility::fixed_lgd_cs(BackendUtility::getRecordTitle($table, $this->rec), $GLOBALS['BE_USER']->uc['titleLen']),
                                        $this->clipObj->currentMode()
                                );
-                               if ($table == 'pages' && $lCP & 8) {
+                               if ($table === 'pages' && $lCP & 8) {
                                        if ($elFromAllTables) {
                                                $menuItems['pasteinto'] = $this->DB_paste('', $uid, 'into', $elInfo);
                                        }
@@ -330,12 +330,13 @@ class ClickMenu {
         * @todo Define visibility
         */
        public function printNewDBLevel($table, $uid) {
+               $uid = (int)$uid;
                // Setting internal record to the table/uid :
                $this->rec = BackendUtility::getRecordWSOL($table, $uid);
                $menuItems = array();
                $root = 0;
                // Rootlevel
-               if ($table == 'pages' && !strcmp($uid, '0')) {
+               if ($table === 'pages' && $uid === 0) {
                        $root = 1;
                }
                // If record was found, check permissions and get menu items.
@@ -1226,7 +1227,7 @@ class ClickMenu {
                                                                        $p = 1;
                                                                        reset($menuItems);
                                                                        while (TRUE) {
-                                                                               if (!strcmp(key($menuItems), $menuEntry)) {
+                                                                               if ((string)key($menuItems) === $menuEntry) {
                                                                                        $pointer = $p;
                                                                                        $found = TRUE;
                                                                                        break;
@@ -1310,7 +1311,7 @@ class ClickMenu {
         * @todo Define visibility
         */
        public function excludeIcon($iconCode) {
-               return $GLOBALS['BE_USER']->uc['noMenuMode'] && strcmp($GLOBALS['BE_USER']->uc['noMenuMode'], 'icons') ? '' : ' ' . $iconCode;
+               return $GLOBALS['BE_USER']->uc['noMenuMode'] && $GLOBALS['BE_USER']->uc['noMenuMode'] !== 'icons' ? '' : ' ' . $iconCode;
        }
 
        /**
index 0af17f5..63d413a 100644 (file)
@@ -277,7 +277,7 @@ class NewContentElementController {
                                $code = $GLOBALS['LANG']->getLL('sel2', 1) . '<br /><br />';
                                // Load SHARED page-TSconfig settings and retrieve column list from there, if applicable:
                                $modTSconfig_SHARED = BackendUtility::getModTSconfig($this->id, 'mod.SHARED');
-                               $colPosList = strcmp(trim($modTSconfig_SHARED['properties']['colPos_list']), '') ? trim($modTSconfig_SHARED['properties']['colPos_list']) : '1,0,2,3';
+                               $colPosList = trim($modTSconfig_SHARED['properties']['colPos_list']) !== '' ? trim($modTSconfig_SHARED['properties']['colPos_list']) : '1,0,2,3';
                                $colPosList = implode(',', array_unique(GeneralUtility::intExplode(',', $colPosList)));
                                // Removing duplicates, if any
                                // Finally, add the content of the column selector to the content:
@@ -365,7 +365,7 @@ class NewContentElementController {
                        foreach ($wizards as $groupKey => $wizardGroup) {
                                $groupKey = preg_replace('/\\.$/', '', $groupKey);
                                $showItems = GeneralUtility::trimExplode(',', $wizardGroup['show'], TRUE);
-                               $showAll = strcmp($wizardGroup['show'], '*') ? FALSE : TRUE;
+                               $showAll = $wizardGroup['show'] === '*';
                                $groupItems = array();
                                if (is_array($appendWizards[$groupKey . '.']['elements.'])) {
                                        $wizardElements = array_merge((array) $wizardGroup['elements.'], $appendWizards[$groupKey . '.']['elements.']);
index 79f6846..0f43fbf 100644 (file)
@@ -679,14 +679,14 @@ class EditDocumentController {
                        if ($editForm) {
                                $this->firstEl = reset($this->elementsData);
                                // Checking if the currently open document is stored in the list of "open documents" - if not, then add it:
-                               if ((strcmp($this->docDat[1], $this->storeUrlMd5) || !isset($this->docHandler[$this->storeUrlMd5])) && !$this->dontStoreDocumentRef) {
+                               if (($this->docDat[1] !== $this->storeUrlMd5 || !isset($this->docHandler[$this->storeUrlMd5])) && !$this->dontStoreDocumentRef) {
                                        $this->docHandler[$this->storeUrlMd5] = array($this->storeTitle, $this->storeArray, $this->storeUrl, $this->firstEl);
                                        $GLOBALS['BE_USER']->pushModuleData('alt_doc.php', array($this->docHandler, $this->storeUrlMd5));
                                        BackendUtility::setUpdateSignal('OpendocsController::updateNumber', count($this->docHandler));
                                }
                                // Module configuration
                                $this->modTSconfig = $this->viewId ? BackendUtility::getModTSconfig($this->viewId, 'mod.xMOD_alt_doc') : array();
-                               $body .= $this->tceforms->printNeededJSFunctions_top();
+                               $body = $this->tceforms->printNeededJSFunctions_top();
                                $body .= $this->compileForm($editForm);
                                $body .= $this->tceforms->printNeededJSFunctions();
                                $body .= $this->functionMenus();
@@ -1439,7 +1439,7 @@ class EditDocumentController {
         * @todo Define visibility
         */
        public function setDocument($currentDocFromHandlerMD5 = '', $retUrl = 'alt_doc_nodoc.php') {
-               if (!ExtensionManagementUtility::isLoaded('cms') && !strcmp($retUrl, 'alt_doc_nodoc.php')) {
+               if (!ExtensionManagementUtility::isLoaded('cms') && $retUrl === 'alt_doc_nodoc.php') {
                        return;
                }
                if (!$this->modTSconfig['properties']['disableDocSelector'] && is_array($this->docHandler) && count($this->docHandler)) {
index 9ec4e23..afa6c61 100644 (file)
@@ -647,7 +647,7 @@ class PageLayoutController {
                }
                // Selecting all content elements from this language and allowed colPos:
                $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'tt_content', 'pid=' . intval($this->id) . ' AND sys_language_uid=' . intval($this->current_sys_language) . ' AND colPos IN (' . $this->colPosList . ')' . ($this->MOD_SETTINGS['tt_content_showHidden'] ? '' : BackendUtility::BEenableFields('tt_content')) . BackendUtility::deleteClause('tt_content') . BackendUtility::versioningPlaceholderClause('tt_content'), '', 'colPos,sorting');
-               $colPos = '';
+               $colPos = NULL;
                $first = 1;
                // Page is the pid if no record to put this after.
                $prev = $this->id;
@@ -660,7 +660,7 @@ class PageLayoutController {
                                        }
                                        $first = 0;
                                }
-                               if (strcmp($cRow['colPos'], $colPos)) {
+                               if (!isset($colPos) || $cRow['colPos'] !== $colPos) {
                                        $colPos = $cRow['colPos'];
                                        $opt[] = '<option value=""></option>';
                                        $opt[] = '<option value="_EDIT_COL:' . $colPos . '">__' . $GLOBALS['LANG']->sL(BackendUtility::getLabelFromItemlist('tt_content', 'colPos', $colPos), TRUE) . ':__</option>';
@@ -749,7 +749,7 @@ class PageLayoutController {
                        }
                        if (!$recordAccess) {
                                // If no edit access, print error message:
-                               $content .= $this->doc->section($GLOBALS['LANG']->getLL('noAccess'), $GLOBALS['LANG']->getLL('noAccess_msg') . '<br /><br />' . ($GLOBALS['BE_USER']->errorMsg ? 'Reason: ' . $GLOBALS['BE_USER']->errorMsg . '<br /><br />' : ''), 0, 1);
+                               $content = $this->doc->section($GLOBALS['LANG']->getLL('noAccess'), $GLOBALS['LANG']->getLL('noAccess_msg') . '<br /><br />' . ($GLOBALS['BE_USER']->errorMsg ? 'Reason: ' . $GLOBALS['BE_USER']->errorMsg . '<br /><br />' : ''), 0, 1);
                        } elseif (is_array($rec)) {
                                // If the record is an array (which it will always be... :-)
                                // Create instance of TCEforms, setting defaults:
@@ -792,11 +792,11 @@ class PageLayoutController {
                                        $defaultFlashMessageQueue->enqueue($flashMessage);
                                }
                                // Add whole form as a document section:
-                               $content .= $this->doc->section('', $theCode);
+                               $content = $this->doc->section('', $theCode);
                        }
                } else {
                        // If no edit access, print error message:
-                       $content .= $this->doc->section($GLOBALS['LANG']->getLL('noAccess'), $GLOBALS['LANG']->getLL('noAccess_msg') . '<br /><br />', 0, 1);
+                       $content = $this->doc->section($GLOBALS['LANG']->getLL('noAccess'), $GLOBALS['LANG']->getLL('noAccess_msg') . '<br /><br />', 0, 1);
                }
                // Bottom controls (function menus):
                $q_count = $this->getNumberOfHiddenElements();
@@ -900,7 +900,7 @@ class PageLayoutController {
                                        // ... should be impossible that colPos has no array. But this is the fallback should it make any sense:
                                        $colList = array('1', '0', '2', '3');
                                }
-                               if (strcmp($this->colPosList, '')) {
+                               if ($this->colPosList !== '') {
                                        $colList = array_intersect(GeneralUtility::intExplode(',', $this->colPosList), $colList);
                                }
                                // If only one column found, display the single-column view.
index 01e5387..c95cdb9 100644 (file)
@@ -253,10 +253,8 @@ class ShortcutFrameController {
                // Selection-clause for users - so users can deleted only their own shortcuts (except admins)
                $addUSERWhere = !$GLOBALS['BE_USER']->isAdmin() ? ' AND userid=' . intval($GLOBALS['BE_USER']->user['uid']) : '';
                // Deleting shortcuts:
-               if (strcmp($this->deleteCategory, '')) {
-                       if (MathUtility::canBeInterpretedAsInteger($this->deleteCategory)) {
-                               $GLOBALS['TYPO3_DB']->exec_DELETEquery('sys_be_shortcuts', 'sc_group=' . intval($this->deleteCategory) . $addUSERWhere);
-                       }
+               if (MathUtility::canBeInterpretedAsInteger($this->deleteCategory)) {
+                       $GLOBALS['TYPO3_DB']->exec_DELETEquery('sys_be_shortcuts', 'sc_group=' . intval($this->deleteCategory) . $addUSERWhere);
                }
                // If other changes in post-vars:
                if (is_array($_POST)) {
@@ -344,7 +342,7 @@ class ShortcutFrameController {
                $bookmarkGroups = $GLOBALS['BE_USER']->getTSConfigProp('options.bookmarkGroups');
                if (is_array($bookmarkGroups) && count($bookmarkGroups)) {
                        foreach ($bookmarkGroups as $k => $v) {
-                               if (strcmp('', $v) && strcmp('0', $v)) {
+                               if ((int)$v !== 0) {
                                        $this->groupLabels[$k] = (string) $v;
                                } elseif ($GLOBALS['BE_USER']->isAdmin()) {
                                        unset($this->groupLabels[$k]);
@@ -396,9 +394,9 @@ class ShortcutFrameController {
                                $this->editSC_rec = $row;
                        }
                        $sc_group = $row['sc_group'];
-                       if ($sc_group && strcmp($formerGr, $sc_group)) {
+                       if ($sc_group && $formerGr !== $sc_group) {
                                if ($sc_group != -100) {
-                                       if ($this->groupLabels[abs($sc_group)] && strcmp('1', $this->groupLabels[abs($sc_group)])) {
+                                       if ($this->groupLabels[abs($sc_group)] && $this->groupLabels[abs($sc_group)] !== '1') {
                                                $label = $this->groupLabels[abs($sc_group)];
                                        } else {
                                                $label = $GLOBALS['LANG']->getLL('shortcut_group_' . abs($sc_group), TRUE);
@@ -502,6 +500,7 @@ class ShortcutFrameController {
        /**
         * Creates lines for the editing form.
         *
+        *
         * @return void
         * @todo Define visibility
         */
@@ -514,7 +513,7 @@ class ShortcutFrameController {
                        $opt = array();
                        $opt[] = '<option value="0"></option>';
                        foreach ($this->groupLabels as $k => $v) {
-                               if ($v && strcmp('1', $v)) {
+                               if ((int)$v > 1) {
                                        $label = $v;
                                } else {
                                        $label = $GLOBALS['LANG']->getLL('bookmark_group_' . $k, TRUE);
@@ -523,11 +522,11 @@ class ShortcutFrameController {
                                                $label = $GLOBALS['LANG']->getLL('bookmark_group', TRUE) . ' ' . $k;
                                        }
                                }
-                               $opt[] = '<option value="' . $k . '"' . (!strcmp($this->editSC_rec['sc_group'], $k) ? ' selected="selected"' : '') . '>' . $label . '</option>';
+                               $opt[] = '<option value="' . $k . '"' . ((string)$this->editSC_rec['sc_group'] === (string)$k ? ' selected="selected"' : '') . '>' . $label . '</option>';
                        }
                        if ($GLOBALS['BE_USER']->isAdmin()) {
                                foreach ($this->groupLabels as $k => $v) {
-                                       if ($v && strcmp('1', $v)) {
+                                       if (intval($v) > 1) {
                                                $label = $v;
                                        } else {
                                                $label = $GLOBALS['LANG']->getLL('bookmark_group_' . $k, TRUE);
@@ -538,9 +537,9 @@ class ShortcutFrameController {
                                        }
                                        // Add a prefix for global groups
                                        $label = $GLOBALS['LANG']->getLL('bookmark_global', TRUE) . ': ' . $label;
-                                       $opt[] = '<option value="-' . $k . '"' . (!strcmp($this->editSC_rec['sc_group'], ('-' . $k)) ? ' selected="selected"' : '') . '>' . $label . '</option>';
+                                       $opt[] = '<option value="-' . $k . '"' . ((int)$this->editSC_rec['sc_group'] === -((int)$k) ? ' selected="selected"' : '') . '>' . $label . '</option>';
                                }
-                               $opt[] = '<option value="-100"' . (!strcmp($this->editSC_rec['sc_group'], '-100') ? ' selected="selected"' : '') . '>' . $GLOBALS['LANG']->getLL('bookmark_global', TRUE) . ': ' . $GLOBALS['LANG']->getLL('bookmark_all', TRUE) . '</option>';
+                               $opt[] = '<option value="-100"' . ((int)$this->editSC_rec['sc_group'] === -100 ? ' selected="selected"' : '') . '>' . $GLOBALS['LANG']->getLL('bookmark_global', TRUE) . ': ' . $GLOBALS['LANG']->getLL('bookmark_all', TRUE) . '</option>';
                        }
                        // border="0" hspace="2" width="21" height="16" - not XHTML compliant in <input type="image" ...>
                        $manageForm = '
index e915a2b..2d148c0 100644 (file)
@@ -115,7 +115,7 @@ class AddController {
                        $this->pid = intval($this->P['params']['pid']);
                }
                // Return if new record as parent (not possibly/allowed)
-               if (!strcmp($this->pid, '')) {
+               if ($this->pid > 0) {
                        HttpUtility::redirect(GeneralUtility::sanitizeLocalUrl($this->P['returnUrl']));
                }
                // Else proceed:
index 4a4ddba..9c781af 100644 (file)
@@ -738,7 +738,7 @@ class FormsController {
                                                if ($vv['default']) {
                                                        $thisLine[2] = 1;
                                                }
-                                       } elseif (strcmp(trim($vv['default']), '')) {
+                                       } elseif (trim($vv['default']) !== '') {
                                                $thisLine[2] = $vv['default'];
                                        }
                                        if (isset($thisLine[2])) {
@@ -852,7 +852,7 @@ class FormsController {
         */
        public function cleanT($tArr) {
                for ($a = count($tArr); $a > 0; $a--) {
-                       if (strcmp($tArr[$a - 1], '')) {
+                       if ((string)$tArr[$a - 1] !== '') {
                                break;
                        } else {
                                unset($tArr[$a - 1]);
index cfedf24..6b0139e 100644 (file)
@@ -93,7 +93,7 @@ class ListController {
                }
                // Make redirect:
                // If pid is blank OR if id is set, then return...
-               if (!strcmp($this->pid, '') || strcmp($this->id, '')) {
+               if ((string)$this->id !== '') {
                        $redirectUrl = GeneralUtility::sanitizeLocalUrl($this->P['returnUrl']);
                } else {
                        // Otherwise, show the list:
index 8ffc9a2..5d612f3 100644 (file)
@@ -156,7 +156,7 @@ class RteController {
                        $rec['pid'] = $rawRec['pid'];
                        // TSconfig, setting width:
                        $fieldTSConfig = $tceforms->setTSconfig($this->P['table'], $rec, $this->P['field']);
-                       if (strcmp($fieldTSConfig['RTEfullScreenWidth'], '')) {
+                       if ((string)$fieldTSConfig['RTEfullScreenWidth'] !== '') {
                                $width = $fieldTSConfig['RTEfullScreenWidth'];
                        } else {
                                $width = '100%';
index f7db268..589e4ed 100644 (file)
@@ -106,7 +106,7 @@ class DataPreprocessor {
         * @todo Define visibility
         */
        public function fetchRecord($table, $idList, $operation) {
-               if ((string) $idList == 'prev') {
+               if ((string)$idList == 'prev') {
                        $idList = $this->prevPageID;
                }
                if ($GLOBALS['TCA'][$table]) {
@@ -114,7 +114,7 @@ class DataPreprocessor {
                        $ids = GeneralUtility::trimExplode(',', $idList, TRUE);
                        foreach ($ids as $id) {
                                // If ID is not blank:
-                               if (strcmp($id, '')) {
+                               if ((string)$id !== '') {
                                        // For new records to be created, find default values:
                                        if ($operation == 'new') {
                                                // Default values:
@@ -260,11 +260,11 @@ class DataPreprocessor {
                foreach ($copyOfColumns as $field => $fieldConfig) {
                        // Set $data variable for the field, either inputted value from $row - or if not found, the default value as defined in the "config" array
                        if (isset($row[$field])) {
-                               $data = (string) $row[$field];
+                               $data = (string)$row[$field];
                        } elseif (array_key_exists($field, $row) && !empty($fieldConfig['config']['eval']) && GeneralUtility::inList($fieldConfig['config']['eval'], 'null')) {
                                $data = NULL;
                        } else {
-                               $data = (string) $fieldConfig['config']['default'];
+                               $data = (string)$fieldConfig['config']['default'];
                        }
                        $data = $this->renderRecord_SW($data, $fieldConfig, $TSconfig, $table, $row, $field);
                        $totalRecordContent[$field] = $data;
@@ -297,7 +297,7 @@ class DataPreprocessor {
         * @todo Define visibility
         */
        public function renderRecord_SW($data, $fieldConfig, $TSconfig, $table, $row, $field) {
-               switch ((string) $fieldConfig['config']['type']) {
+               switch ((string)$fieldConfig['config']['type']) {
                        case 'group':
                                $data = $this->renderRecord_groupProc($data, $fieldConfig, $TSconfig, $table, $row, $field);
                                break;
@@ -395,7 +395,7 @@ class DataPreprocessor {
                        $fieldConfig['config']['items'] = $this->procesItemArray($fieldConfig['config']['items'], $fieldConfig['config'], $TSconfig[$field], $table, $row, $field);
                        foreach ($fieldConfig['config']['items'] as $pvpv) {
                                foreach ($elements as $eKey => $value) {
-                                       if (!strcmp($value, $pvpv[1])) {
+                                       if ((string)$value === (string)$pvpv[1]) {
                                                $dataAcc[$eKey] = rawurlencode($pvpv[1]) . '|' . rawurlencode($this->sL($pvpv[0]));
                                        }
                                }
@@ -522,7 +522,7 @@ class DataPreprocessor {
                                $dataAcc[] = $theId;
                        } else {
                                foreach ($elements as $eKey => $value) {
-                                       if (!strcmp($theId, $value)) {
+                                       if ((int)$theId === (int)$value) {
                                                $dataAcc[$eKey] = $theId;
                                        }
                                }
@@ -630,12 +630,12 @@ class DataPreprocessor {
         */
        public function selectAddSpecial($dataAcc, $elements, $specialKey) {
                // Special select types:
-               switch ((string) $specialKey) {
+               switch ((string)$specialKey) {
                        case 'tables':
                                $tNames = array_keys($GLOBALS['TCA']);
                                foreach ($tNames as $tableName) {
                                        foreach ($elements as $eKey => $value) {
-                                               if (!strcmp($tableName, $value)) {
+                                               if ((string)$tableName === (string)$value) {
                                                        $dataAcc[$eKey] = rawurlencode($value) . '|' . rawurlencode($this->sL($GLOBALS['TCA'][$value]['ctrl']['title']));
                                                }
                                        }
@@ -646,7 +646,7 @@ class DataPreprocessor {
                                if (is_array($theTypes)) {
                                        foreach ($theTypes as $theTypesArrays) {
                                                foreach ($elements as $eKey => $value) {
-                                                       if (!strcmp($theTypesArrays[1], $value)) {
+                                                       if ((string)$theTypesArrays[1] === (string)$value) {
                                                                $dataAcc[$eKey] = rawurlencode($value) . '|' . rawurlencode($this->sL($theTypesArrays[0]));
                                                        }
                                                }
@@ -658,7 +658,7 @@ class DataPreprocessor {
                                if (is_array($theExcludeFields)) {
                                        foreach ($theExcludeFields as $theExcludeFieldsArrays) {
                                                foreach ($elements as $eKey => $value) {
-                                                       if (!strcmp($theExcludeFieldsArrays[1], $value)) {
+                                                       if ((string)$theExcludeFieldsArrays[1] === (string)$value) {
                                                                $dataAcc[$eKey] = rawurlencode($value) . '|' . rawurlencode(rtrim($theExcludeFieldsArrays[0], ':'));
                                                        }
                                                }
@@ -671,7 +671,7 @@ class DataPreprocessor {
                                        if (is_array($theTypeArrays['items'])) {
                                                foreach ($theTypeArrays['items'] as $itemValue => $itemContent) {
                                                        foreach ($elements as $eKey => $value) {
-                                                               if (!strcmp(($tableFieldKey . ':' . $itemValue . ':' . $itemContent[0]), $value)) {
+                                                               if (($tableFieldKey . ':' . $itemValue . ':' . $itemContent[0]) === (string)$value) {
                                                                        $dataAcc[$eKey] = rawurlencode($value) . '|' . rawurlencode(('[' . $itemContent[2] . '] ' . $itemContent[1]));
                                                                }
                                                        }
@@ -683,7 +683,7 @@ class DataPreprocessor {
                                $theLangs = BackendUtility::getSystemLanguages();
                                foreach ($theLangs as $lCfg) {
                                        foreach ($elements as $eKey => $value) {
-                                               if (!strcmp($lCfg[1], $value)) {
+                                               if ((string)$lCfg[1] === (string)$value) {
                                                        $dataAcc[$eKey] = rawurlencode($value) . '|' . rawurlencode($lCfg[0]);
                                                }
                                        }
@@ -697,7 +697,7 @@ class DataPreprocessor {
                                                        // Traverse items:
                                                        foreach ($coValue['items'] as $itemKey => $itemCfg) {
                                                                foreach ($elements as $eKey => $value) {
-                                                                       if (!strcmp(($coKey . ':' . $itemKey), $value)) {
+                                                                       if (($coKey . ':' . $itemKey) === (string)$value) {
                                                                                $dataAcc[$eKey] = rawurlencode($value) . '|' . rawurlencode($this->sL($itemCfg[0]));
                                                                        }
                                                                }
@@ -724,7 +724,7 @@ class DataPreprocessor {
                                                }
                                                // Add modules own label now:
                                                $label .= $GLOBALS['LANG']->moduleLabels['tabs'][$value . '_tab'];
-                                               if (!strcmp($theModName, $value)) {
+                                               if ((string)$theModName === (string)$value) {
                                                        $dataAcc[$eKey] = rawurlencode($value) . '|' . rawurlencode($label);
                                                }
                                        }
@@ -785,7 +785,7 @@ class DataPreprocessor {
                                        $dataAcc[] = rawurlencode($theId) . '|' . rawurlencode(GeneralUtility::fixed_lgd_cs(($lPrefix . strip_tags($recordList[$theId])), $GLOBALS['BE_USER']->uc['titleLen']));
                                } else {
                                        foreach ($elements as $eKey => $value) {
-                                               if (!strcmp($theId, $value)) {
+                                               if ((int)$theId === (int)$value) {
                                                        $dataAcc[$eKey] = rawurlencode($theId) . '|' . rawurlencode(GeneralUtility::fixed_lgd_cs(($lPrefix . strip_tags($recordList[$theId])), $GLOBALS['BE_USER']->uc['titleLen']));
                                                }
                                        }
index 32efb1c..07cc6d3 100644 (file)
@@ -565,7 +565,7 @@ class InlineElement {
                                $recTitle = BackendUtility::getRecordTitle($itemParts[0], $recTemp, FALSE);
                        }
                        $recTitle = BackendUtility::getRecordTitlePrep($recTitle);
-                       if (!strcmp(trim($recTitle), '')) {
+                       if (trim($recTitle) === '') {
                                $recTitle = BackendUtility::getNoRecordTitle(TRUE);
                        }
                } else {
@@ -1548,7 +1548,7 @@ class InlineElement {
                        $removeItems = GeneralUtility::trimExplode(',', $PA['fieldTSConfig']['removeItems'], TRUE);
                        foreach ($selItems as $tk => $p) {
                                // Checking languages and authMode:
-                               $languageDeny = $tcaTableCtrl['languageField'] && !strcmp($tcaTableCtrl['languageField'], $field) && !$GLOBALS['BE_USER']->checkLanguageAccess($p[1]);
+                               $languageDeny = $tcaTableCtrl['languageField'] && (string)$tcaTableCtrl['languageField'] === $field && !$GLOBALS['BE_USER']->checkLanguageAccess($p[1]);
                                $authModeDeny = $config['form_type'] == 'select' && $config['authMode'] && !$GLOBALS['BE_USER']->checkAuthMode($table, $field, $p[1], $config['authMode']);
                                if (in_array($p[1], $removeItems) || $languageDeny || $authModeDeny) {
                                        unset($selItems[$tk]);
index 71728c5..bd9b8bb 100644 (file)
@@ -141,9 +141,9 @@ class TreeElement {
                // Create a JavaScript code line which will ask the user to save/update the form due to changing the element.
                // This is used for eg. "type" fields and others configured with "requestUpdate"
                if (
-                       $GLOBALS['TCA'][$table]['ctrl']['type']
-                       && !strcmp($field, $GLOBALS['TCA'][$table]['ctrl']['type'])
-                       || $GLOBALS['TCA'][$table]['ctrl']['requestUpdate']
+                       !empty($GLOBALS['TCA'][$table]['ctrl']['type'])
+                       && $field === $GLOBALS['TCA'][$table]['ctrl']['type']
+                       || !empty($GLOBALS['TCA'][$table]['ctrl']['requestUpdate'])
                        && GeneralUtility::inList(str_replace(' ', '', $GLOBALS['TCA'][$table]['ctrl']['requestUpdate']), $field)
                ) {
                        if ($GLOBALS['BE_USER']->jsConfirmation(1)) {
index 569fad3..d574b5c 100644 (file)
@@ -674,7 +674,7 @@ class FormEngine {
                                        foreach ($fields as $fieldInfo) {
                                                $parts = explode(';', $fieldInfo);
                                                $theField = trim($parts[0]);
-                                               if (!in_array($theField, $excludeElements) && !strcmp($theField, $theFieldToReturn)) {
+                                               if (!in_array($theField, $excludeElements) && (string)$theField === (string)$theFieldToReturn) {
                                                        if ($GLOBALS['TCA'][$table]['columns'][$theField]) {
                                                                $sField = $this->getSingleField($table, $theField, $row, $parts[1], 1, $parts[3], $parts[2]);
                                                                return $sField['ITEM'];
@@ -762,16 +762,16 @@ class FormEngine {
                                                $parts = explode(';', $fieldInfo);
                                                // Getting the style information out:
                                                $color_style_parts = GeneralUtility::trimExplode('-', $parts[4]);
-                                               if (strcmp($color_style_parts[0], '')) {
+                                               if ($color_style_parts[0] !== '') {
                                                        $this->setColorScheme($GLOBALS['TBE_STYLES']['colorschemes'][intval($color_style_parts[0])]);
                                                }
-                                               if (strcmp($color_style_parts[1], '')) {
+                                               if ($color_style_parts[1] !== '') {
                                                        $this->fieldStyle = $GLOBALS['TBE_STYLES']['styleschemes'][intval($color_style_parts[1])];
                                                        if (!isset($this->fieldStyle)) {
                                                                $this->fieldStyle = $GLOBALS['TBE_STYLES']['styleschemes'][0];
                                                        }
                                                }
-                                               if (strcmp($color_style_parts[2], '')) {
+                                               if ($color_style_parts[2] !== '') {
                                                        $this->wrapBorder($out_array[$out_sheet], $out_pointer);
                                                        $this->borderStyle = $GLOBALS['TBE_STYLES']['borderschemes'][intval($color_style_parts[2])];
                                                        if (!isset($this->borderStyle)) {
@@ -1036,7 +1036,7 @@ class FormEngine {
                        && $PA['fieldConf']['config']['form_type'] != 'passthrough'
                        && ($this->RTEenabled || !$PA['fieldConf']['config']['showIfRTE'])
                        && $displayConditionResult
-                       && (!$GLOBALS['TCA'][$table]['ctrl']['languageField'] || $PA['fieldConf']['l10n_display'] || strcmp($PA['fieldConf']['l10n_mode'], 'exclude') || $row[$GLOBALS['TCA'][$table]['ctrl']['languageField']] <= 0)
+                       && (!$GLOBALS['TCA'][$table]['ctrl']['languageField'] || $PA['fieldConf']['l10n_display'] || ($PA['fieldConf']['l10n_mode'] !== 'exclude') || $row[$GLOBALS['TCA'][$table]['ctrl']['languageField']] <= 0)
                        && (!$GLOBALS['TCA'][$table]['ctrl']['languageField'] || !$this->localizationMode || $this->localizationMode === $PA['fieldConf']['l10n_cat'])
                ) {
                        // Fetching the TSconfig for the current table/field. This includes the $row which means that
@@ -1067,9 +1067,9 @@ class FormEngine {
                                }
                                // Create a JavaScript code line which will ask the user to save/update the form due to changing the element. This is used for eg. "type" fields and others configured with "requestUpdate"
                                if (
-                                       $GLOBALS['TCA'][$table]['ctrl']['type']
-                                       && !strcmp($field, $typeField)
-                                       || $GLOBALS['TCA'][$table]['ctrl']['requestUpdate']
+                                       !empty($GLOBALS['TCA'][$table]['ctrl']['type'])
+                                       && $field === $typeField
+                                       || !empty($GLOBALS['TCA'][$table]['ctrl']['requestUpdate'])
                                        && GeneralUtility::inList(str_replace(' ', '', $GLOBALS['TCA'][$table]['ctrl']['requestUpdate']), $field)
                                ) {
                                        if ($GLOBALS['BE_USER']->jsConfirmation(1)) {
@@ -1715,7 +1715,7 @@ TBE_EDITOR.customEvalFunctions[\'' . $evalData . '\'] = function(value) {
                        $p = $selItems[$c];
                        $rID = $PA['itemFormElID'] . '_' . $c;
                        $rOnClick = implode('', $PA['fieldChangeFunc']);
-                       $rChecked = !strcmp($p[1], $PA['itemFormElValue']) ? ' checked="checked"' : '';
+                       $rChecked = (string)$p[1] === (string)$PA['itemFormElValue'] ? ' checked="checked"' : '';
                        $item .= '<input type="radio"' . $this->insertDefStyle('radio') . ' name="' . $PA['itemFormElName'] . '" value="' . htmlspecialchars($p[1]) . '" onclick="' . htmlspecialchars($rOnClick) . '"' . $rChecked . $PA['onFocus'] . $disabled . ' id="' . $rID . '" />
                                        <label for="' . $rID . '">' . htmlspecialchars($p[0]) . '</label>
                                        <br />';
@@ -1752,13 +1752,13 @@ TBE_EDITOR.customEvalFunctions[\'' . $evalData . '\'] = function(value) {
                // If a SINGLE selector box...
                if ($maxitems <= 1 && $config['renderMode'] !== 'tree') {
                        $item = $this->getSingleField_typeSelect_single($table, $field, $row, $PA, $config, $selItems, $nMV_label);
-               } elseif (!strcmp($config['renderMode'], 'checkbox')) {
+               } elseif ($config['renderMode'] === 'checkbox') {
                        // Checkbox renderMode
                        $item = $this->getSingleField_typeSelect_checkbox($table, $field, $row, $PA, $config, $selItems, $nMV_label);
-               } elseif (!strcmp($config['renderMode'], 'singlebox')) {
+               } elseif ($config['renderMode'] === 'singlebox') {
                        // Single selector box renderMode
                        $item = $this->getSingleField_typeSelect_singlebox($table, $field, $row, $PA, $config, $selItems, $nMV_label);
-               } elseif (!strcmp($config['renderMode'], 'tree')) {
+               } elseif ($config['renderMode'] === 'tree') {
                        // Tree renderMode
                        $treeClass = GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Form\\Element\\TreeElement', $this);
                        $item = $treeClass->renderField($table, $field, $row, $PA, $config, $selItems, $nMV_label);
@@ -1823,8 +1823,8 @@ TBE_EDITOR.customEvalFunctions[\'' . $evalData . '\'] = function(value) {
                        // Checking languages and authMode:
                        $languageDeny = FALSE;
                        if (
-                               $GLOBALS['TCA'][$table]['ctrl']['languageField']
-                               && !strcmp($GLOBALS['TCA'][$table]['ctrl']['languageField'], $fieldName)
+                               !empty($GLOBALS['TCA'][$table]['ctrl']['languageField'])
+                               && $GLOBALS['TCA'][$table]['ctrl']['languageField'] === $fieldName
                                && !$GLOBALS['BE_USER']->checkLanguageAccess($selectItem[1])
                        ) {
                                $languageDeny = TRUE;
@@ -1918,7 +1918,7 @@ TBE_EDITOR.customEvalFunctions[\'' . $evalData . '\'] = function(value) {
                $optGroupOpen = FALSE;
                $classesForSelectTag = array();
                foreach ($selItems as $p) {
-                       $sM = !strcmp($PA['itemFormElValue'], $p[1]) ? ' selected="selected"' : '';
+                       $sM = (string)$PA['itemFormElValue'] === (string)$p[1] ? ' selected="selected"' : '';
                        if ($sM) {
                                $sI = $c;
                                $noMatchingValue = 0;
@@ -1936,7 +1936,7 @@ TBE_EDITOR.customEvalFunctions[\'' . $evalData . '\'] = function(value) {
                        }
                        // Compiling the <option> tag:
                        if (!($p[1] != $PA['itemFormElValue'] && is_array($uniqueIds) && in_array($p[1], $uniqueIds))) {
-                               if (!strcmp($p[1], '--div--')) {
+                               if ($p[1] === '--div--') {
                                        $optGroupStart[0] = $p[0];
                                        if ($config['iconsInOptionTags']) {
                                                $optGroupStart[1] = $this->optgroupTagStyle($p[2]);
@@ -2057,7 +2057,7 @@ TBE_EDITOR.customEvalFunctions[\'' . $evalData . '\'] = function(value) {
                        $unSetAll = array();
                        foreach ($selItems as $p) {
                                // Non-selectable element:
-                               if (!strcmp($p[1], '--div--')) {
+                               if ($p[1] === '--div--') {
                                        $selIcon = '';
                                        if (isset($p[2]) && $p[2] != 'empty-emtpy') {
                                                $selIcon = $this->getIconHtml($p[2]);
@@ -2194,7 +2194,7 @@ TBE_EDITOR.customEvalFunctions[\'' . $evalData . '\'] = function(value) {
                        }
                        // Non-selectable element:
                        $nonSel = '';
-                       if (!strcmp($p[1], '--div--')) {
+                       if ((string) $p[1] === '--div--') {
                                $nonSel = ' onclick="this.selected=0;" class="c-divider"';
                        }
                        // Icon style for option tag:
@@ -2581,7 +2581,7 @@ TBE_EDITOR.customEvalFunctions[\'' . $evalData . '\'] = function(value) {
                        // If the element is of the internal type "db":
                        // Creating string showing allowed types:
                        $tempFT = GeneralUtility::trimExplode(',', $allowed, TRUE);
-                       if (!strcmp(trim($tempFT[0]), '*')) {
+                       if (trim($tempFT[0]) === '*') {
                                $onlySingleTableAllowed = FALSE;
                                $info .= '<span class="nobr">' . htmlspecialchars($this->getLL('l_allTables')) . '</span><br />';
                        } elseif ($tempFT) {
@@ -2708,7 +2708,7 @@ TBE_EDITOR.customEvalFunctions[\'' . $evalData . '\'] = function(value) {
                        $width = ceil($cols * $this->form_rowsToStylewidth);
                        // Overflow:auto crashes mozilla here. Title tag is useful when text is longer than the div box (overflow:hidden).
                        $item = '
-                               <div style="overflow:hidden; width:' . $width . 'px;" class="t3-tceforms-fieldReadOnly" title="' . $itemValue . '">' . '<span class="nobr">' . (strcmp($itemValue, '') ? $itemValue : '&nbsp;') . '</span>' . IconUtility::getSpriteIcon('status-status-readonly') . '</div>';
+                               <div style="overflow:hidden; width:' . $width . 'px;" class="t3-tceforms-fieldReadOnly" title="' . $itemValue . '">' . '<span class="nobr">' . ((string)$itemValue !== '' ? $itemValue : '&nbsp;') . '</span>' . IconUtility::getSpriteIcon('status-status-readonly') . '</div>';
                }
                return $item;
        }
@@ -3118,7 +3118,10 @@ TBE_EDITOR.customEvalFunctions[\'' . $evalData . '\'] = function(value) {
                                                                                'rows' => 2
                                                                        );
                                                                }
-                                                               if ($fakePA['fieldConf']['onChange'] == 'reload' || $GLOBALS['TCA'][$table]['ctrl']['type'] && !strcmp($key, $GLOBALS['TCA'][$table]['ctrl']['type']) || $GLOBALS['TCA'][$table]['ctrl']['requestUpdate'] && GeneralUtility::inList($GLOBALS['TCA'][$table]['ctrl']['requestUpdate'], $key)) {
+                                                               if ($fakePA['fieldConf']['onChange'] === 'reload'
+                                                                       || !empty($GLOBALS['TCA'][$table]['ctrl']['type']) && (string)$key === $GLOBALS['TCA'][$table]['ctrl']['type']
+                                                                       || !empty($GLOBALS['TCA'][$table]['ctrl']['requestUpdate']) && GeneralUtility::inList($GLOBALS['TCA'][$table]['ctrl']['requestUpdate'], $key)
+                                                               ) {
                                                                        if ($GLOBALS['BE_USER']->jsConfirmation(1)) {
                                                                                $alertMsgOnChange = 'if (confirm(TBE_EDITOR.labels.onChangeAlert) && TBE_EDITOR.checkSubmit(-1)){ TBE_EDITOR.submitForm() };';
                                                                        } else {
@@ -3351,7 +3354,7 @@ TBE_EDITOR.customEvalFunctions[\'' . $evalData . '\'] = function(value) {
                                $typeNum = $this->getLanguageOverlayRawValue($table, $row, $field, $typeFieldConfig);
                        }
                }
-               if (!strcmp($typeNum, '')) {
+               if (empty($typeNum)) {
                        // If that value is an empty string, set it to "0" (zero)
                        $typeNum = 0;
                }
@@ -3681,7 +3684,7 @@ TBE_EDITOR.customEvalFunctions[\'' . $evalData . '\'] = function(value) {
        public function getLanguageOverlayRawValue($table, $row, $field, $fieldConf) {
                $value = $row[$field];
                if (is_array($this->defaultLanguageData[$table . ':' . $row['uid']])) {
-                       if ($fieldConf['l10n_mode'] == 'exclude' || $fieldConf['l10n_mode'] == 'mergeIfNotBlank' && strcmp(trim($this->defaultLanguageData[$table . ':' . $row['uid']][$field]), '')) {
+                       if ($fieldConf['l10n_mode'] == 'exclude' || $fieldConf['l10n_mode'] == 'mergeIfNotBlank' && trim($this->defaultLanguageData[$table . ':' . $row['uid']][$field]) !== '') {
                                $value = $this->defaultLanguageData[$table . ':' . $row['uid']][$field];
                        }
                }
@@ -3742,7 +3745,7 @@ TBE_EDITOR.customEvalFunctions[\'' . $evalData . '\'] = function(value) {
                        );
                        // There must be diff-data:
                        if (isset($dLVal['old'][$field])) {
-                               if (strcmp($dLVal['old'][$field], $dLVal['new'][$field])) {
+                               if ((string)$dLVal['old'][$field] !== (string)$dLVal['new'][$field]) {
                                        // Create diff-result:
                                        $t3lib_diff_Obj = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Utility\\DiffUtility');
                                        $diffres = $t3lib_diff_Obj->makeDiffDisplay(BackendUtility::getProcessedValue($table, $field, $dLVal['old'][$field], 0, 1), BackendUtility::getProcessedValue($table, $field, $dLVal['new'][$field], 0, 1));
@@ -3764,7 +3767,9 @@ TBE_EDITOR.customEvalFunctions[\'' . $evalData . '\'] = function(value) {
         */
        public function renderVDEFDiff($vArray, $vDEFkey) {
                $item = NULL;
-               if ($GLOBALS['TYPO3_CONF_VARS']['BE']['flexFormXMLincludeDiffBase'] && isset($vArray[$vDEFkey . '.vDEFbase']) && strcmp($vArray[$vDEFkey . '.vDEFbase'], $vArray['vDEF'])) {
+               if ($GLOBALS['TYPO3_CONF_VARS']['BE']['flexFormXMLincludeDiffBase'] && isset($vArray[$vDEFkey . '.vDEFbase'])
+                       && (string)$vArray[$vDEFkey . '.vDEFbase'] !== (string)$vArray['vDEF']
+               ) {
                        // Create diff-result:
                        $t3lib_diff_Obj = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Utility\\DiffUtility');
                        $diffres = $t3lib_diff_Obj->makeDiffDisplay($vArray[$vDEFkey . '.vDEFbase'], $vArray['vDEF']);
@@ -4016,7 +4021,7 @@ TBE_EDITOR.customEvalFunctions[\'' . $evalData . '\'] = function(value) {
                                case 'db':
                                        $allowedTables = GeneralUtility::trimExplode(',', $allowed, TRUE);
                                        // All tables allowed for relation:
-                                       if (!strcmp(trim($allowedTables[0]), '*')) {
+                                       if (trim($allowedTables[0]) === '*') {
                                                $output = $this->clipObj->elFromTable('');
                                        } else {
                                                // Only some tables, filter them:
@@ -4127,7 +4132,7 @@ TBE_EDITOR.customEvalFunctions[\'' . $evalData . '\'] = function(value) {
                                                                $params['md5ID'] = $md5ID;
                                                                $params['returnUrl'] = $this->thisReturnUrl();
                                                                // Resolving script filename and setting URL.
-                                                               if (!strcmp(substr($wConf['script'], 0, 4), 'EXT:')) {
+                                                               if (substr($wConf['script'], 0, 4) === 'EXT:') {
                                                                        $wScript = GeneralUtility::getFileAbsFileName($wConf['script']);
                                                                        if ($wScript) {
                                                                                $wScript = '../' . \TYPO3\CMS\Core\Utility\PathUtility::stripPathSitePrefix($wScript);
@@ -4237,7 +4242,7 @@ TBE_EDITOR.customEvalFunctions[\'' . $evalData . '\'] = function(value) {
                                                $color = $PA['itemFormElValue'] ? ' bgcolor="' . htmlspecialchars($PA['itemFormElValue']) . '"' : '';
                                                $outArr[] = '<table border="0" cellpadding="0" cellspacing="0" id="' . $md5ID . '"' . $color . ' style="' . htmlspecialchars($wConf['tableStyle']) . '">
                                                                        <tr>
-                                                                               <td>' . $colorBoxLinks[0] . '<img ' . IconUtility::skinImg($this->backPath, (strlen(trim($color)) == 0 || strcmp(trim($color), '0') == 0 ? 'gfx/colorpicker_empty.png' : 'gfx/colorpicker.png'), ('width="' . $dX . '" height="' . $dY . '"' . BackendUtility::titleAltAttrib(trim(($iTitle . ' ' . $PA['itemFormElValue']))) . ' border="0"')) . '>' . $colorBoxLinks[1] . '</td>
+                                                                               <td>' . $colorBoxLinks[0] . '<img ' . IconUtility::skinImg($this->backPath, ($color === '' ? 'gfx/colorpicker_empty.png' : 'gfx/colorpicker.png'), ('width="' . $dX . '" height="' . $dY . '"' . BackendUtility::titleAltAttrib(trim(($iTitle . ' ' . $PA['itemFormElValue']))) . ' border="0"')) . '>' . $colorBoxLinks[1] . '</td>
                                                                        </tr>
                                                                </table>';
                                        }
@@ -4263,11 +4268,11 @@ TBE_EDITOR.customEvalFunctions[\'' . $evalData . '\'] = function(value) {
                                } else {
                                        $outStr = implode('', $outArr);
                                }
-                               if (!strcmp($wizConf['_POSITION'], 'left')) {
+                               if ($wizConf['_POSITION'] === 'left') {
                                        $outStr = '<tr><td' . $vAlign . '>' . $outStr . '</td><td' . $vAlign . '>' . $item . '</td></tr>';
-                               } elseif (!strcmp($wizConf['_POSITION'], 'top')) {
+                               } elseif ($wizConf['_POSITION'] === 'top') {
                                        $outStr = '<tr><td>' . $outStr . '</td></tr><tr><td>' . $item . '</td></tr>';
-                               } elseif (!strcmp($wizConf['_POSITION'], 'bottom')) {
+                               } elseif ($wizConf['_POSITION'] === 'bottom') {
                                        $outStr = '<tr><td>' . $item . '</td></tr><tr><td>' . $outStr . '</td></tr>';
                                } else {
                                        $outStr = '<tr><td' . $vAlign . '>' . $item . '</td><td' . $vAlign . '>' . $outStr . '</td></tr>';
index f745b11..b8cdd26 100644 (file)
@@ -293,7 +293,7 @@ class BaseScriptClass {
         * @todo Define visibility
         */
        public function getExternalItemConfig($modName, $menuKey, $value = '') {
-               return strcmp($value, '') ? $GLOBALS['TBE_MODULES_EXT'][$modName]['MOD_MENU'][$menuKey][$value] : $GLOBALS['TBE_MODULES_EXT'][$modName]['MOD_MENU'][$menuKey];
+               return (string)$value !== '' ? $GLOBALS['TBE_MODULES_EXT'][$modName]['MOD_MENU'][$menuKey][$value] : $GLOBALS['TBE_MODULES_EXT'][$modName]['MOD_MENU'][$menuKey];
        }
 
        /**
index 6798d01..5fbf9ef 100644 (file)
@@ -340,7 +340,7 @@ abstract class AbstractRecordList {
         * @todo Define visibility
         */
        public function listURL($altId = '') {
-               return $this->script . '?id=' . (strcmp($altId, '') ? $altId : $this->id);
+               return $this->script . '?id=' . ($altId !== '' ? $altId : $this->id);
        }
 
        /**
index b4c1401..f6d30d7 100644 (file)
@@ -80,7 +80,7 @@ class ElementBrowserRecordList extends \TYPO3\CMS\Recordlist\RecordList\Database
         * @todo Define visibility
         */
        public function listURL($altId = '', $table = -1, $exclList = '') {
-               return $this->thisScript . '?id=' . (strcmp($altId, '') ? $altId : $this->id) . '&table=' . rawurlencode(($table == -1 ? $this->table : $table)) . ($this->thumbs ? '&imagemode=' . $this->thumbs : '') . ($this->searchString ? '&search_field=' . rawurlencode($this->searchString) : '') . ($this->searchLevels ? '&search_levels=' . rawurlencode($this->searchLevels) : '') . ((!$exclList || !GeneralUtility::inList($exclList, 'sortField')) && $this->sortField ? '&sortField=' . rawurlencode($this->sortField) : '') . ((!$exclList || !GeneralUtility::inList($exclList, 'sortRev')) && $this->sortRev ? '&sortRev=' . rawurlencode($this->sortRev) : '') . $this->ext_addP();
+               return $this->thisScript . '?id=' . ($altId !== '' ? $altId : $this->id) . '&table=' . rawurlencode(($table == -1 ? $this->table : $table)) . ($this->thumbs ? '&imagemode=' . $this->thumbs : '') . ($this->searchString ? '&search_field=' . rawurlencode($this->searchString) : '') . ($this->searchLevels ? '&search_levels=' . rawurlencode($this->searchLevels) : '') . ((!$exclList || !GeneralUtility::inList($exclList, 'sortField')) && $this->sortField ? '&sortField=' . rawurlencode($this->sortField) : '') . ((!$exclList || !GeneralUtility::inList($exclList, 'sortRev')) && $this->sortRev ? '&sortRev=' . rawurlencode($this->sortRev) : '') . $this->ext_addP();
        }
 
        /**
index 38f90c7..307e739 100644 (file)
@@ -599,7 +599,7 @@ class DocumentTemplate {
                if (preg_match('/typo3\\/mod\\.php$/', $pathInfo['path']) && isset($GLOBALS['TBE_MODULES']['_PATHS'][$modName])) {
                        $storeUrl = '&M=' . $modName . $storeUrl;
                }
-               if (!strcmp($motherModName, '1')) {
+               if ($motherModName === '1') {
                        $mMN = '&motherModName=\'+top.currentModuleLoaded+\'';
                } elseif ($motherModName) {
                        $mMN = '&motherModName=' . rawurlencode($motherModName);
@@ -1261,7 +1261,7 @@ class DocumentTemplate {
                                        // for EXT:myskin/stylesheets/ syntax
                                        if (substr($stylesheetDir, 0, 4) === 'EXT:') {
                                                list($extKey, $path) = explode('/', substr($stylesheetDir, 4), 2);
-                                               if (strcmp($extKey, '') && ExtensionManagementUtility::isLoaded($extKey) && strcmp($path, '')) {
+                                               if (!empty($extKey) && ExtensionManagementUtility::isLoaded($extKey) && !empty($path)) {
                                                        $stylesheetDirectories[] = ExtensionManagementUtility::extRelPath($extKey) . $path;
                                                }
                                        } else {
@@ -1630,7 +1630,7 @@ class DocumentTemplate {
                        }
                        $menuDef = array();
                        foreach ($menuItems as $value => $label) {
-                               $menuDef[$value]['isActive'] = !strcmp($currentValue, $value);
+                               $menuDef[$value]['isActive'] = (string)$currentValue === (string)$value;
                                $menuDef[$value]['label'] = GeneralUtility::deHSCentities(htmlspecialchars($label));
                                $menuDef[$value]['url'] = $script . '?' . $mainParams . $addparams . '&' . $elementName . '=' . $value;
                        }
@@ -1730,7 +1730,7 @@ class DocumentTemplate {
                                } else {
                                        $onclick = 'this.blur(); DTM_activate("' . $id . '","' . $index . '", ' . ($toggle < 0 ? 1 : 0) . '); return false;';
                                }
-                               $isEmpty = !(strcmp(trim($def['content']), '') || strcmp(trim($def['icon']), ''));
+                               $isEmpty = trim($def['content']) === '' && trim($def['icon']) === '';
                                // "Removes" empty tabs
                                if ($isEmpty && $dividers2tabs == 1) {
                                        continue;
index a9dac9d..40e7b45 100644 (file)
@@ -269,7 +269,7 @@ class ShortcutToolbarItem implements \TYPO3\CMS\Backend\Toolbar\ToolbarItemHookI
                                }
                        }
                        $shortcutGroup = $row['sc_group'];
-                       if ($shortcutGroup && strcmp($lastGroup, $shortcutGroup) && $shortcutGroup != -100) {
+                       if ($shortcutGroup && (string)$lastGroup !== (string)$shortcutGroup && $shortcutGroup != -100) {
                                $shortcut['groupLabel'] = $this->getShortcutGroupLabel($shortcutGroup);
                        }
                        if ($row['description']) {
@@ -333,8 +333,8 @@ class ShortcutToolbarItem implements \TYPO3\CMS\Backend\Toolbar\ToolbarItemHookI
                $bookmarkGroups = $GLOBALS['BE_USER']->getTSConfigProp('options.bookmarkGroups');
                if (is_array($bookmarkGroups) && count($bookmarkGroups)) {
                        foreach ($bookmarkGroups as $groupId => $label) {
-                               if (strcmp('', $label) && strcmp('0', $label)) {
-                                       $this->shortcutGroups[$groupId] = (string) $label;
+                               if (!empty($label)) {
+                                       $this->shortcutGroups[$groupId] = (string)$label;
                                } elseif ($GLOBALS['BE_USER']->isAdmin()) {
                                        unset($this->shortcutGroups[$groupId]);
                                }
index 4c3eff9..cd856b2 100644 (file)
@@ -100,7 +100,7 @@ class BrowseTreeView extends \TYPO3\CMS\Backend\Tree\View\AbstractTreeView {
                // Wrap icon in click-menu link.
                if (!$this->ext_IconMode) {
                        $theIcon = $GLOBALS['TBE_TEMPLATE']->wrapClickMenuOnIcon($theIcon, $this->treeName, $this->getId($row), 0);
-               } elseif (!strcmp($this->ext_IconMode, 'titlelink')) {
+               } elseif ($this->ext_IconMode === 'titlelink') {
                        $aOnClick = 'return jumpTo(\'' . $this->getJumpToParam($row) . '\',this,\'' . $this->domIdPrefix . $this->getId($row) . '\',' . $this->bank . ');';
                        $theIcon = '<a href="#" onclick="' . htmlspecialchars($aOnClick) . '">' . $theIcon . '</a>';
                }
index a26e00b..d836c61 100644 (file)
@@ -138,7 +138,7 @@ class FolderTreeView extends \TYPO3\CMS\Backend\Tree\View\AbstractTreeView {
                        if ($folderObject->getStorage()->hasFolder('/')) {
                                $theFolderIcon = $GLOBALS['TBE_TEMPLATE']->wrapClickMenuOnIcon($theFolderIcon, $folderObject->getCombinedIdentifier(), '', 0);
                        }
-               } elseif (!strcmp($this->ext_IconMode, 'titlelink')) {
+               } elseif ($this->ext_IconMode === 'titlelink') {
                        $aOnClick = 'return jumpTo(\'' . $this->getJumpToParam($folderObject) . '\',this,\'' . $this->domIdPrefix . $this->getId($folderObject) . '\',' . $this->bank . ');';
                        $theFolderIcon = '<a href="#" onclick="' . htmlspecialchars($aOnClick) . '">' . $theFolderIcon . '</a>';
                }
index f037e21..04016ca 100644 (file)
@@ -373,7 +373,7 @@ class PagePositionMap {
                $colPosArray = GeneralUtility::trimExplode(',', $colPosList, TRUE);
                $lines = array();
                foreach ($colPosArray as $kk => $vv) {
-                       $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'tt_content', 'pid=' . intval($pid) . ($showHidden ? '' : BackendUtility::BEenableFields('tt_content')) . ' AND colPos=' . intval($vv) . (strcmp($this->cur_sys_language, '') ? ' AND sys_language_uid=' . intval($this->cur_sys_language) : '') . BackendUtility::deleteClause('tt_content') . BackendUtility::versioningPlaceholderClause('tt_content'), '', 'sorting');
+                       $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'tt_content', 'pid=' . intval($pid) . ($showHidden ? '' : BackendUtility::BEenableFields('tt_content')) . ' AND colPos=' . intval($vv) . ((string)$this->cur_sys_language !== '' ? ' AND sys_language_uid=' . intval($this->cur_sys_language) : '') . BackendUtility::deleteClause('tt_content') . BackendUtility::versioningPlaceholderClause('tt_content'), '', 'sorting');
                        $lines[$vv] = array();
                        $lines[$vv][] = $this->insertPositionIcon('', $vv, $kk, $moveUid, $pid);
                        while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
index c48e04b..fe61fb7 100644 (file)
@@ -556,7 +556,7 @@ class BackendUtility {
                                                        // Check for items:
                                                        foreach ($fCfg['items'] as $iVal) {
                                                                // Values '' is not controlled by this setting.
-                                                               if (strcmp($iVal[1], '')) {
+                                                               if ((string)$iVal[1] !== '') {
                                                                        // Find iMode
                                                                        $iMode = '';
                                                                        switch ((string) $fCfg['authMode']) {
@@ -567,9 +567,9 @@ class BackendUtility {
                                                                                        $iMode = 'DENY';
                                                                                        break;
                                                                                case 'individual':
-                                                                                       if (!strcmp($iVal[4], 'EXPL_ALLOW')) {
+                                                                                       if ($iVal[4] === 'EXPL_ALLOW') {
                                                                                                $iMode = 'ALLOW';
-                                                                                       } elseif (!strcmp($iVal[4], 'EXPL_DENY')) {
+                                                                                       } elseif ($iVal[4] === 'EXPL_DENY') {
                                                                                                $iMode = 'DENY';
                                                                                        }
                                                                                        break;
@@ -792,7 +792,7 @@ class BackendUtility {
                                $typeNum = $row[$field];
                        }
                        // If that value is an empty string, set it to "0" (zero)
-                       if (!strcmp($typeNum, '')) {
+                       if (empty($typeNum)) {
                                $typeNum = 0;
                        }
                }
@@ -1204,7 +1204,7 @@ class BackendUtility {
                        $set = array();
                        foreach ($pageTS as $f => $v) {
                                $f = $TSconfPrefix . $f;
-                               if (!isset($impParams[$f]) && trim($v) || strcmp(trim($impParams[$f]), trim($v))) {
+                               if (!isset($impParams[$f]) && trim($v) || trim($impParams[$f]) !== trim($v)) {
                                        $set[$f] = trim($v);
                                }
                        }
@@ -1811,7 +1811,7 @@ class BackendUtility {
                        // Traverse the items-array...
                        foreach ($GLOBALS['TCA'][$table]['columns'][$col]['config']['items'] as $k => $v) {
                                // ... and return the first found label where the value was equal to $key
-                               if (!strcmp($v[1], $key)) {
+                               if ((string)$v[1] === (string)$key) {
                                        return $v[0];
                                }
                        }
@@ -1926,7 +1926,7 @@ class BackendUtility {
                        } else {
                                // No userFunc: Build label
                                $t = self::getProcessedValue($table, $GLOBALS['TCA'][$table]['ctrl']['label'], $row[$GLOBALS['TCA'][$table]['ctrl']['label']], 0, 0, FALSE, $row['uid'], $forceResult);
-                               if ($GLOBALS['TCA'][$table]['ctrl']['label_alt'] && ($GLOBALS['TCA'][$table]['ctrl']['label_alt_force'] || !strcmp($t, ''))) {
+                               if ($GLOBALS['TCA'][$table]['ctrl']['label_alt'] && ($GLOBALS['TCA'][$table]['ctrl']['label_alt_force'] || (string)$t === '')) {
                                        $altFields = GeneralUtility::trimExplode(',', $GLOBALS['TCA'][$table]['ctrl']['label_alt'], TRUE);
                                        $tA = array();
                                        if (!empty($t)) {
@@ -1934,7 +1934,7 @@ class BackendUtility {
                                        }
                                        foreach ($altFields as $fN) {
                                                $t = trim(strip_tags($row[$fN]));
-                                               if (strcmp($t, '')) {
+                                               if ((string)$t !== '') {
                                                        $t = self::getProcessedValue($table, $fN, $t, 0, 0, FALSE, $row['uid']);
                                                        if (!$GLOBALS['TCA'][$table]['ctrl']['label_alt_force']) {
                                                                break;
@@ -1952,7 +1952,7 @@ class BackendUtility {
                                if ($prep) {
                                        $t = self::getRecordTitlePrep($t);
                                }
-                               if (!strcmp(trim($t), '')) {
+                               if (trim($t) === '') {
                                        $t = self::getNoRecordTitle($prep);
                                }
                        }
@@ -2736,7 +2736,7 @@ class BackendUtility {
                }
                $options = array();
                foreach ($menuItems as $value => $label) {
-                       $options[] = '<option value="' . htmlspecialchars($value) . '"' . (!strcmp($currentValue, $value) ? ' selected="selected"' : '') . '>' . GeneralUtility::deHSCentities(htmlspecialchars($label)) . '</option>';
+                       $options[] = '<option value="' . htmlspecialchars($value) . '"' . ((string)$currentValue === (string)$value ? ' selected="selected"' : '') . '>' . GeneralUtility::deHSCentities(htmlspecialchars($label)) . '</option>';
                }
                if (count($options)) {
                        $onChange = 'jumpToUrl(\'' . $script . '?' . $mainParams . $addparams . '&' . $elementName . '=\'+this.options[this.selectedIndex].value,this);';
@@ -2943,12 +2943,12 @@ class BackendUtility {
                                        if (is_array($CHANGED_SETTINGS) && isset($CHANGED_SETTINGS[$key])) {
                                                if (is_array($CHANGED_SETTINGS[$key])) {
                                                        $serializedSettings = serialize($CHANGED_SETTINGS[$key]);
-                                                       if (strcmp($settings[$key], $serializedSettings)) {
+                                                       if ((string)$settings[$key] !== $serializedSettings) {
                                                                $settings[$key] = $serializedSettings;
                                                                $changed = 1;
                                                        }
                                                } else {
-                                                       if (strcmp($settings[$key], $CHANGED_SETTINGS[$key])) {
+                                                       if ((string)$settings[$key] !== (string)$CHANGED_SETTINGS[$key]) {
                                                                $settings[$key] = $CHANGED_SETTINGS[$key];
                                                                $changed = 1;
                                                        }
@@ -3254,7 +3254,7 @@ class BackendUtility {
                                                $fieldN = substr($key, 0, -1);
                                                $res[$fieldN] = $val;
                                                unset($res[$fieldN]['types.']);
-                                               if (strcmp($typeVal, '') && is_array($val['types.'][$typeVal . '.'])) {
+                                               if ((string)$typeVal !== '' && is_array($val['types.'][$typeVal . '.'])) {
                                                        \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($res[$fieldN], $val['types.'][$typeVal . '.']);
                                                }
                                        }
@@ -3660,7 +3660,7 @@ class BackendUtility {
                                        }
                                }
                                // If ID of current online version is found, look up the PID value of that:
-                               if ($oid && ($ignoreWorkspaceMatch || !strcmp((int) $wsid, $GLOBALS['BE_USER']->workspace))) {
+                               if ($oid && ($ignoreWorkspaceMatch || (int)$wsid === (int)$GLOBALS['BE_USER']->workspace)) {
                                        $oidRec = self::getRecord($table, $oid, 'pid');
                                        if (is_array($oidRec)) {
                                                $rr['_ORIG_pid'] = $rr['pid'];
index 5485366..e11858d 100644 (file)
@@ -1351,7 +1351,7 @@ class PageLayoutView extends \TYPO3\CMS\Recordlist\RecordList\AbstractDatabaseRe
                                                        $hookOut .= GeneralUtility::callUserFunction($_funcRef, $_params, $this);
                                                }
                                        }
-                                       if (strcmp($hookOut, '')) {
+                                       if ((string)$hookOut !== '') {
                                                $out .= $hookOut;
                                        } elseif (!empty($row['list_type'])) {
                                                $label = BackendUtility::getLabelFromItemlist('tt_content', 'list_type', $row['list_type']);
index 957827e..aa64510 100644 (file)
@@ -92,7 +92,7 @@ class PageTreeView extends \TYPO3\CMS\Backend\Tree\View\BrowseTreeView {
                // Wrap icon in click-menu link.
                if (!$this->ext_IconMode) {
                        $thePageIcon = $GLOBALS['TBE_TEMPLATE']->wrapClickMenuOnIcon($thePageIcon, 'pages', $row['uid'], 0, '&bank=' . $this->bank);
-               } elseif (!strcmp($this->ext_IconMode, 'titlelink')) {
+               } elseif ($this->ext_IconMode === 'titlelink') {
                        $aOnClick = 'return jumpTo(\'' . $this->getJumpToParam($row) . '\',this,\'' . $this->treeName . '\');';
                        $thePageIcon = '<a href="#" onclick="' . htmlspecialchars($aOnClick) . '">' . $thePageIcon . '</a>';
                }
index 381ccd6..80bcea0 100644 (file)
@@ -162,8 +162,7 @@ class ThumbnailView {
                        if ($mTime) {
                                // Always use the absolute path for this check!
                                $check = basename($relativeFilePath) . ':' . $mTime . ':' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['encryptionKey'];
-                               $md5_real = GeneralUtility::shortMD5($check);
-                               if (!strcmp($md5_real, $md5sum)) {
+                               if (GeneralUtility::shortMD5($check) === (string)$md5sum) {
                                        $OK = TRUE;
                                }
                        }
index 3228199..3dcd6d7 100644 (file)
@@ -565,7 +565,7 @@ abstract class AbstractUserAuthentication {
                        $cookies = GeneralUtility::trimExplode(';', $_SERVER['HTTP_COOKIE']);
                        foreach ($cookies as $cookie) {
                                list($name, $value) = GeneralUtility::trimExplode('=', $cookie);
-                               if (strcmp(trim($name), $cookieName) == 0) {
+                               if (trim($name) === (string)$cookieName) {
                                        // Use the last one
                                        $cookieValue = urldecode($value);
                                }
index 6709c63..a16b2d1 100644 (file)
@@ -632,7 +632,7 @@ class BackendUserAuthentication extends \TYPO3\CMS\Core\Authentication\AbstractU
                        return TRUE;
                }
                // Allow all blank values:
-               if (!strcmp($value, '')) {
+               if ((string)$value === '') {
                        return TRUE;
                }
                // Certain characters are not allowed in the value
@@ -659,8 +659,8 @@ class BackendUserAuthentication extends \TYPO3\CMS\Core\Authentication\AbstractU
                                        $items = $GLOBALS['TCA'][$table]['columns'][$field]['config']['items'];
                                        if (is_array($items)) {
                                                foreach ($items as $iCfg) {
-                                                       if (!strcmp($iCfg[1], $value) && $iCfg[4]) {
-                                                               switch ((string) $iCfg[4]) {
+                                                       if ((string)$iCfg[1] === (string)$value && $iCfg[4]) {
+                                                               switch ((string)$iCfg[4]) {
                                                                        case 'EXPL_ALLOW':
                                                                                if (!GeneralUtility::inList($this->groupData['explicit_allowdeny'], ($testValue . ':ALLOW'))) {
                                                                                        $out = FALSE;
@@ -691,7 +691,7 @@ class BackendUserAuthentication extends \TYPO3\CMS\Core\Authentication\AbstractU
         */
        public function checkLanguageAccess($langValue) {
                // The users language list must be non-blank - otherwise all languages are allowed.
-               if (strcmp(trim($this->groupData['allowed_languages']), '')) {
+               if (trim($this->groupData['allowed_languages']) !== '') {
                        $langValue = intval($langValue);
                        // Language must either be explicitly allowed OR the lang Value be "-1" (all languages)
                        if ($langValue != -1 && !$this->check('allowed_languages', $langValue)) {
@@ -789,7 +789,7 @@ class BackendUserAuthentication extends \TYPO3\CMS\Core\Authentication\AbstractU
                        if (is_array($GLOBALS['TCA'][$table]['columns'])) {
                                foreach ($GLOBALS['TCA'][$table]['columns'] as $fieldName => $fieldValue) {
                                        if (isset($idOrRow[$fieldName])) {
-                                               if ($fieldValue['config']['type'] == 'select' && $fieldValue['config']['authMode'] && !strcmp($fieldValue['config']['authMode_enforce'], 'strict')) {
+                                               if ($fieldValue['config']['type'] === 'select' && $fieldValue['config']['authMode'] && $fieldValue['config']['authMode_enforce'] === 'strict') {
                                                        if (!$this->checkAuthMode($table, $fieldName, $idOrRow[$fieldName], $fieldValue['config']['authMode'])) {
                                                                $this->errorMsg = 'ERROR: authMode "' . $fieldValue['config']['authMode'] . '" failed for field "' . $fieldName . '" with value "' . $idOrRow[$fieldName] . '" evaluated';
                                                                return FALSE;
@@ -1408,7 +1408,7 @@ class BackendUserAuthentication extends \TYPO3\CMS\Core\Authentication\AbstractU
                                // Setting workspace permissions:
                                $this->dataLists['workspace_perms'] |= $row['workspace_perms'];
                                // If this function is processing the users OWN group-list (not subgroups) AND if the ->firstMainGroup is not set, then the ->firstMainGroup will be set.
-                               if (!strcmp($idList, '') && !$this->firstMainGroup) {
+                               if ((string)$idList !== '' && !$this->firstMainGroup) {
                                        $this->firstMainGroup = $uid;
                                }
                        }
@@ -1984,7 +1984,7 @@ class BackendUserAuthentication extends \TYPO3\CMS\Core\Authentication\AbstractU
                // Unset access cache:
                unset($this->checkWorkspaceCurrent_cache);
                // If ID is different from the stored one, change it:
-               if (strcmp($this->workspace, $this->user['workspace_id'])) {
+               if ((int)$this->workspace !== (int)$this->user['workspace_id']) {
                        $this->user['workspace_id'] = $this->workspace;
                        $GLOBALS['TYPO3_DB']->exec_UPDATEquery('be_users', 'uid=' . intval($this->user['uid']), array('workspace_id' => $this->user['workspace_id']));
                        $this->simplelog('User changed workspace to "' . $this->workspace . '"');
index 706de8a..bb73692 100644 (file)
@@ -1918,7 +1918,7 @@ class CharsetConverter {
         * @todo Define visibility
         */
        public function utf8_substr($str, $start, $len = NULL) {
-               if (!strcmp($len, '0')) {
+               if ((string)$len === '0') {
                        return '';
                }
                $byte_start = $this->utf8_char2byte_pos($str, $start);
index 425b485..fd5e0de 100644 (file)
@@ -375,7 +375,7 @@ abstract class AbstractConditionMatcher {
                                if ($this->isUserLoggedIn()) {
                                        $values = GeneralUtility::trimExplode(',', $value, TRUE);
                                        foreach ($values as $test) {
-                                               if ($test == '*' || !strcmp($this->getUserId(), $test)) {
+                                               if ($test == '*' || (string)$this->getUserId() === (string)$test) {
                                                        return TRUE;
                                                }
                                        }
@@ -387,10 +387,8 @@ abstract class AbstractConditionMatcher {
                                if ($keyParts[1]) {
                                        $page = $this->getPage();
                                        $property = $keyParts[1];
-                                       if (!empty($page) && isset($page[$property])) {
-                                               if (strcmp($page[$property], $value) === 0) {
-                                                       return TRUE;
-                                               }
+                                       if (!empty($page) && isset($page[$property]) && (string)$page[$property] === (string)$value) {
+                                               return TRUE;
                                        }
                                }
                                break;
index 7d57f17..e8ddff6 100644 (file)
@@ -93,10 +93,10 @@ class CommandLineController {
         * @todo Define visibility
         */
        public function cli_getArgArray($option, $argv) {
-               while (count($argv) && strcmp($argv[0], $option)) {
+               while (count($argv) && (string)$argv[0] !== (string)$option) {
                        array_shift($argv);
                }
-               if (!strcmp($argv[0], $option)) {
+               if ((string)$argv[0] === (string)$option) {
                        array_shift($argv);
                        return count($argv) ? $argv : array('');
                }
index 78a6de0..eec2391 100644 (file)
@@ -1268,7 +1268,7 @@ class DataHandler {
                                $shadowCols .= ',' . $GLOBALS['TCA'][$table]['ctrl']['label'];
                                $shadowColumns = array_unique(GeneralUtility::trimExplode(',', $shadowCols, TRUE));
                                foreach ($shadowColumns as $fieldName) {
-                                       if (strcmp($justStoredRecord[$fieldName], $liveRec[$fieldName]) && isset($GLOBALS['TCA'][$table]['columns'][$fieldName]) && $fieldName !== 'uid' && $fieldName !== 'pid') {
+                                       if ((string)$justStoredRecord[$fieldName] !== (string)$liveRec[$fieldName] && isset($GLOBALS['TCA'][$table]['columns'][$fieldName]) && $fieldName !== 'uid' && $fieldName !== 'pid') {
                                                $newRecord[$fieldName] = $justStoredRecord[$fieldName];
                                        }
                                }
@@ -1332,7 +1332,7 @@ class DataHandler {
                        if (!in_array(($table . '-' . $field), $this->exclude_array) && !$this->data_disableFields[$table][$id][$field]) {
                                // The field must be editable.
                                // Checking if a value for language can be changed:
-                               $languageDeny = $GLOBALS['TCA'][$table]['ctrl']['languageField'] && !strcmp($GLOBALS['TCA'][$table]['ctrl']['languageField'], $field) && !$this->BE_USER->checkLanguageAccess($fieldValue);
+                               $languageDeny = $GLOBALS['TCA'][$table]['ctrl']['languageField'] && (string)$GLOBALS['TCA'][$table]['ctrl']['languageField'] === (string)$field && !$this->BE_USER->checkLanguageAccess($fieldValue);
                                if (!$languageDeny) {
                                        // Stripping slashes - will probably be removed the day $this->stripslashes_values is removed as an option...
                                        if ($this->stripslashes_values) {
@@ -1721,7 +1721,7 @@ class DataHandler {
                list($table, $id, $curValue, $status, $realPid, $recFID) = $PP;
                if (is_array($tcaFieldConf['items'])) {
                        foreach ($tcaFieldConf['items'] as $set) {
-                               if (!strcmp($set[1], $value)) {
+                               if ((string)$set[1] === (string)$value) {
                                        $res['value'] = $value;
                                        break;
                                }
@@ -2721,7 +2721,7 @@ class DataHandler {
                                                        if (substr($vKey, -9) != '.vDEFbase') {
                                                                if ($this->clear_flexFormData_vDEFbase) {
                                                                        $dataValues[$key][$vKey . '.vDEFbase'] = '';
-                                                               } elseif ($this->updateModeL10NdiffData && $GLOBALS['TYPO3_CONF_VARS']['BE']['flexFormXMLincludeDiffBase'] && $vKey !== 'vDEF' && (strcmp($dataValues[$key][$vKey], $dataValues_current[$key][$vKey]) || !isset($dataValues_current[$key][($vKey . '.vDEFbase')]) || $this->updateModeL10NdiffData === 'FORCE_FFUPD')) {
+                                                               } elseif ($this->updateModeL10NdiffData && $GLOBALS['TYPO3_CONF_VARS']['BE']['flexFormXMLincludeDiffBase'] && $vKey !== 'vDEF' && ((string)$dataValues[$key][$vKey] !== (string)$dataValues_current[$key][$vKey] || !isset($dataValues_current[$key][($vKey . '.vDEFbase')]) || $this->updateModeL10NdiffData === 'FORCE_FFUPD')) {
                                                                        // Now, check if a vDEF value is submitted in the input data, if so we expect this has been processed prior to this operation (normally the case since those fields are higher in the form) and we can use that:
                                                                        if (isset($dataValues[$key]['vDEF'])) {
                                                                                $diffValue = $dataValues[$key]['vDEF'];
@@ -5913,7 +5913,7 @@ class DataHandler {
                                foreach ($fieldArray as $key => $value) {
                                        if ($this->checkStoredRecords_loose && !$value && !$row[$key]) {
 
-                                       } elseif (strcmp($value, $row[$key])) {
+                                       } elseif ((string)$value !== (string)$row[$key]) {
                                                $errorString[] = $key;
                                        }
                                }
@@ -6144,19 +6144,19 @@ class DataHandler {
         * @todo Define visibility
         */
        public function setTSconfigPermissions($fieldArray, $TSConfig_p) {
-               if (strcmp($TSConfig_p['userid'], '')) {
-                       $fieldArray['perms_userid'] = intval($TSConfig_p['userid']);
+               if ((string)$TSConfig_p['userid'] !== '') {
+                       $fieldArray['perms_userid'] = (int)$TSConfig_p['userid'];
                }
-               if (strcmp($TSConfig_p['groupid'], '')) {
-                       $fieldArray['perms_groupid'] = intval($TSConfig_p['groupid']);
+               if ((string)$TSConfig_p['groupid'] !== '') {
+                       $fieldArray['perms_groupid'] = (int)$TSConfig_p['groupid'];
                }
-               if (strcmp($TSConfig_p['user'], '')) {
+               if ((string)$TSConfig_p['user'] !== '') {
                        $fieldArray['perms_user'] = \TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($TSConfig_p['user']) ? $TSConfig_p['user'] : $this->assemblePermissions($TSConfig_p['user']);
                }
-               if (strcmp($TSConfig_p['group'], '')) {
+               if ((string)$TSConfig_p['group'] !== '') {
                        $fieldArray['perms_group'] = \TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($TSConfig_p['group']) ? $TSConfig_p['group'] : $this->assemblePermissions($TSConfig_p['group']);
                }
-               if (strcmp($TSConfig_p['everybody'], '')) {
+               if ((string)$TSConfig_p['everybody'] !== '') {
                        $fieldArray['perms_everybody'] = \TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($TSConfig_p['everybody']) ? $TSConfig_p['everybody'] : $this->assemblePermissions($TSConfig_p['everybody']);
                }
                return $fieldArray;
@@ -6301,10 +6301,7 @@ class DataHandler {
                // No NULL values are allowed, this is the regular behaviour.
                // Thus, check whether strings are the same or whether integer values are empty ("0" or "").
                if (!$allowNull) {
-                       $result = (
-                               !strcmp($submittedValue, $storedValue)
-                               || $storedType == 'int' && $storedValue == 0 && !strcmp($submittedValue, '')
-                       );
+                       $result = (string)$submittedValue === (string)$storedValue || $storedType === 'int' && (int)$storedValue === (int)$submittedValue;
                // Null values are allowed, but currently there's a real (not NULL) value.
                // Thus, ensure no NULL value was submitted and fallback to the regular behaviour.
                } elseif ($storedValue !== NULL) {
@@ -6552,7 +6549,7 @@ class DataHandler {
                                        $evalCodesArray = GeneralUtility::trimExplode(',', $conf['config']['eval'], TRUE);
                                        if (in_array('uniqueInPid', $evalCodesArray)) {
                                                $newV = $this->getUnique($table, $field, $curData[$field], $uid, $curData['pid']);
-                                               if (strcmp($newV, $curData[$field])) {
+                                               if ((string)$newV !== (string)$curData[$field]) {
                                                        $newData[$field] = $newV;
                                                }
                                        }
index aff6ac2..f44b63f 100644 (file)
@@ -91,11 +91,10 @@ class QueryView {
        public function makeStoreControl() {
                // Load/Save
                $storeArray = $this->initStoreArray();
-               $cur = '';
                // Store Array:
                $opt = array();
                foreach ($storeArray as $k => $v) {
-                       $opt[] = '<option value="' . $k . '"' . (!strcmp($cur, $v) ? ' selected' : '') . '>' . htmlspecialchars($v) . '</option>';
+                       $opt[] = '<option value="' . $k . '">' . htmlspecialchars($v) . '</option>';
                }
                // Actions:
                if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('sys_action') && $GLOBALS['BE_USER']->isAdmin()) {
@@ -103,7 +102,7 @@ class QueryView {
                        if ($GLOBALS['TYPO3_DB']->sql_num_rows($res)) {
                                $opt[] = '<option value="0">__Save to Action:__</option>';
                                while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
-                                       $opt[] = '<option value="-' . $row['uid'] . '"' . (!strcmp($cur, ('-' . $row['uid'])) ? ' selected' : '') . '>' . htmlspecialchars(($row['title'] . ' [' . $row['uid'] . ']')) . '</option>';
+                                       $opt[] = '<option value="-' . $row['uid'] . '">' . htmlspecialchars(($row['title'] . ' [' . $row['uid'] . ']')) . '</option>';
                                }
                        }
                        $GLOBALS['TYPO3_DB']->sql_free_result($res);
index 6966c9c..1e1a2b1 100644 (file)
@@ -205,7 +205,7 @@ class ReferenceIndex {
                                }
                                // Word indexing:
                                foreach ($GLOBALS['TCA'][$table]['columns'] as $field => $conf) {
-                                       if (GeneralUtility::inList('input,text', $conf['config']['type']) && strcmp($record[$field], '') && !\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($record[$field])) {
+                                       if (GeneralUtility::inList('input,text', $conf['config']['type']) && (string)$record[$field] !== '' && !\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($record[$field])) {
                                                $this->words_strings[$field] = $record[$field];
                                        }
                                }
@@ -405,7 +405,7 @@ class ReferenceIndex {
                                                        }
                                                }
                                        }
-                                       if (is_array($outRow[$field]['softrefs']) && count($outRow[$field]['softrefs']) && strcmp($value, $softRefValue) && strstr($softRefValue, '{softref:')) {
+                                       if (is_array($outRow[$field]['softrefs']) && count($outRow[$field]['softrefs']) && (string)$value !== (string)$softRefValue && strstr($softRefValue, '{softref:')) {
                                                $outRow[$field]['softrefs']['tokenizedContent'] = $softRefValue;
                                        }
                                }
@@ -457,7 +457,7 @@ class ReferenceIndex {
                                        }
                                }
                        }
-                       if (count($this->temp_flexRelations['softrefs']) && strcmp($dataValue, $softRefValue)) {
+                       if (count($this->temp_flexRelations['softrefs']) && (string)$dataValue !== (string)$softRefValue) {
                                $this->temp_flexRelations['softrefs'][$structurePath]['tokenizedContent'] = $softRefValue;
                        }
                }
@@ -692,7 +692,7 @@ class ReferenceIndex {
         * @todo Define visibility
         */
        public function setReferenceValue_dbRels($refRec, $itemArray, $newValue, &$dataArray, $flexpointer = '') {
-               if (!strcmp($itemArray[$refRec['sorting']]['id'], $refRec['ref_uid']) && !strcmp($itemArray[$refRec['sorting']]['table'], $refRec['ref_table'])) {
+               if ((int)$itemArray[$refRec['sorting']]['id'] === (int)$refRec['ref_uid'] && (string)$itemArray[$refRec['sorting']]['table'] === (string)$refRec['ref_table']) {
                        // Setting or removing value:
                        // Remove value:
                        if ($newValue === NULL) {
@@ -730,7 +730,8 @@ class ReferenceIndex {
         * @todo Define visibility
         */
        public function setReferenceValue_fileRels($refRec, $itemArray, $newValue, &$dataArray, $flexpointer = '') {
-               if (!strcmp(\TYPO3\CMS\Core\Utility\PathUtility::stripPathSitePrefix($itemArray[$refRec['sorting']]['ID_absFile']), $refRec['ref_string']) && !strcmp('_FILE', $refRec['ref_table'])) {
+               $ID_absFile = \TYPO3\CMS\Core\Utility\PathUtility::stripPathSitePrefix($itemArray[$refRec['sorting']]['ID_absFile']);
+               if ($ID_absFile === (string)$refRec['ref_string'] && $refRec['ref_table'] === '_FILE') {
                        // Setting or removing value:
                        // Remove value:
                        if ($newValue === NULL) {
index e565b2f..2d1ed23 100644 (file)
@@ -259,7 +259,7 @@ class RelationHandler {
                }
                // SECTION:     normal MM relations
                // If the table list is "*" then all tables are used in the list:
-               if (!strcmp(trim($tablelist), '*')) {
+               if (trim($tablelist) === '*') {
                        $tablelist = implode(',', array_keys($GLOBALS['TCA']));
                }
                // The tables are traversed and internal arrays are initialized:
@@ -913,9 +913,9 @@ class RelationHandler {
                                $theID = strrev($parts[0]);
                                $theTable = strrev($parts[1]);
                                if (MathUtility::canBeInterpretedAsInteger($theID)
-                                       && (!$theTable || !strcmp($theTable, $fTable) || !strcmp($theTable, $nfTable))
+                                       && (!$theTable || $theTable === (string)$fTable || $theTable === (string)$nfTable)
                                ) {
-                                       $valueArray[$key] = $theTable && strcmp($theTable, $fTable) ? $theID * -1 : $theID;
+                                       $valueArray[$key] = $theTable && $theTable !== (string)$fTable ? $theID * -1 : $theID;
                                }
                        }
                }
index 60b93ce..4023bfc 100644 (file)
@@ -1965,7 +1965,7 @@ class SqlParser {
        }
 
        /**
-        * Compare two query strins by stripping away whitespace.
+        * Compare two query strings by stripping away whitespace.
         *
         * @param string $str SQL String 1
         * @param string $newStr SQL string 2
@@ -1987,10 +1987,11 @@ class SqlParser {
                $str1 = str_replace($search, $replace, $str1);
                $str2 = str_replace($search, $replace, $str2);
 
-               if (strcmp(str_replace(array(' ', TAB, CR, LF), '', $this->trimSQL($str1)), str_replace(array(' ', TAB, CR, LF), '', $this->trimSQL($str2)))) {
+               $search = array(' ', TAB, CR, LF);
+               if (str_replace($search, '', $this->trimSQL($str1)) !== str_replace($search, '', $this->trimSQL($str2))) {
                        return array(
-                               str_replace(array(' ', TAB, CR, LF), ' ', $str),
-                               str_replace(array(' ', TAB, CR, LF), ' ', $newStr),
+                               str_replace($search, ' ', $str),
+                               str_replace($search, ' ', $newStr),
                        );
                }
        }
index d0f1c5c..1987350 100644 (file)
@@ -768,13 +768,13 @@ class HtmlParser {
                                                        // If NOT an endtag, do attribute processing (added dec. 2003)
                                                        if (!$endTag) {
                                                                // Override attributes
-                                                               if (strcmp($tags[$tagName]['overrideAttribs'], '')) {
+                                                               if ((string)$tags[$tagName]['overrideAttribs'] !== '') {
                                                                        $tagParts[1] = $tags[$tagName]['overrideAttribs'];
                                                                }
                                                                // Allowed tags
-                                                               if (strcmp($tags[$tagName]['allowedAttribs'], '')) {
+                                                               if ((string)$tags[$tagName]['allowedAttribs'] !== '') {
                                                                        // No attribs allowed
-                                                                       if (!strcmp($tags[$tagName]['allowedAttribs'], '0')) {
+                                                                       if ((string)$tags[$tagName]['allowedAttribs'] === '0') {
                                                                                $tagParts[1] = '';
                                                                        } elseif (trim($tagParts[1])) {
                                                                                $tagAttrib = $this->get_tag_attributes($tagParts[1]);
@@ -803,7 +803,7 @@ class HtmlParser {
                                                                                if (isset($params['unset']) && !empty($params['unset'])) {
                                                                                        unset($tagAttrib[0][$attr]);
                                                                                }
-                                                                               if (strcmp($params['default'], '') && !isset($tagAttrib[0][$attr])) {
+                                                                               if (!isset($tagAttrib[0][$attr]) && (string)$params['default'] !== '') {
                                                                                        $tagAttrib[0][$attr] = $params['default'];
                                                                                }
                                                                                if ($params['always'] || isset($tagAttrib[0][$attr])) {
@@ -848,10 +848,10 @@ class HtmlParser {
                                                                                                        }
                                                                                                }
                                                                                        }
-                                                                                       if ($params['removeIfFalse'] && $params['removeIfFalse'] != 'blank' && !$tagAttrib[0][$attr] || $params['removeIfFalse'] == 'blank' && !strcmp($tagAttrib[0][$attr], '')) {
+                                                                                       if ($params['removeIfFalse'] && $params['removeIfFalse'] != 'blank' && !$tagAttrib[0][$attr] || $params['removeIfFalse'] == 'blank' && (string)$tagAttrib[0][$attr] === '') {
                                                                                                unset($tagAttrib[0][$attr]);
                                                                                        }
-                                                                                       if (strcmp($params['removeIfEquals'], '') && !strcmp($this->caseShift($tagAttrib[0][$attr], $params['casesensitiveComp']), $this->caseShift($params['removeIfEquals'], $params['casesensitiveComp']))) {
+                                                                                       if ((string)$params['removeIfEquals'] !== '' && $this->caseShift($tagAttrib[0][$attr], $params['casesensitiveComp']) === $this->caseShift($params['removeIfEquals'], $params['casesensitiveComp'])) {
                                                                                                unset($tagAttrib[0][$attr]);
                                                                                        }
                                                                                        if ($params['prefixLocalAnchors']) {
@@ -908,9 +908,9 @@ class HtmlParser {
                                                                                $correctTag = 1;
                                                                                if ($tags[$tagName]['nesting'] == 'global') {
                                                                                        $lastEl = end($tagStack);
-                                                                                       if (strcmp($tagName, $lastEl)) {
+                                                                                       if ($tagName !== $lastEl) {
                                                                                                if (in_array($tagName, $tagStack)) {
-                                                                                                       while (count($tagStack) && strcmp($tagName, $lastEl)) {
+                                                                                                       while (count($tagStack) && $tagName !== $lastEl) {
                                                                                                                $elPos = end($tagRegister[$lastEl]);
                                                                                                                unset($newContent[$elPos]);
                                                                                                                array_pop($tagRegister[$lastEl]);
@@ -948,7 +948,7 @@ class HtmlParser {
                                                }
                                        } elseif ($keepAll) {
                                                // This is if the tag was not defined in the array for processing:
-                                               if (!strcmp($keepAll, 'protect')) {
+                                               if ($keepAll === 'protect') {
                                                        $lt = '&lt;';
                                                        $gt = '&gt;';
                                                } else {
@@ -1184,7 +1184,7 @@ class HtmlParser {
                // bypass the first
                while (list($k, $tok) = each($contentParts)) {
                        $firstChar = substr($tok, 0, 1);
-                       if (strcmp(trim($firstChar), '')) {
+                       if (trim($firstChar) !== '') {
                                $subparts = explode('&gt;', $tok, 2);
                                $tagEnd = strlen($subparts[0]);
                                if (strlen($tok) != $tagEnd) {
@@ -1192,7 +1192,7 @@ class HtmlParser {
                                        $tagContent = substr($tok, $endTag, $tagEnd - $endTag);
                                        $tagParts = preg_split('/\\s+/s', $tagContent, 2);
                                        $tagName = strtolower($tagParts[0]);
-                                       if (!strcmp($tagList, '') || in_array($tagName, $tagsArray)) {
+                                       if ((string)$tagList === '' || in_array($tagName, $tagsArray)) {
                                                $contentParts[$k] = '<' . $subparts[0] . '>' . $subparts[1];
                                        } else {
                                                $contentParts[$k] = '&lt;' . $tok;
@@ -1279,12 +1279,12 @@ class HtmlParser {
                foreach ($tagAttrib as $k => $v) {
                        if ($xhtmlClean) {
                                $attr = strtolower($k);
-                               if (strcmp($v, '') || isset($meta[$k]['dashType'])) {
+                               if ((string)$v !== '' || isset($meta[$k]['dashType'])) {
                                        $attr .= '="' . htmlspecialchars($v) . '"';
                                }
                        } else {
                                $attr = $meta[$k]['origTag'] ? $meta[$k]['origTag'] : $k;
-                               if (strcmp($v, '') || isset($meta[$k]['dashType'])) {
+                               if ((string)$v !== '' || isset($meta[$k]['dashType'])) {
                                        $dash = $meta[$k]['dashType'] ? $meta[$k]['dashType'] : (\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($v) ? '' : '"');
                                        $attr .= '=' . $dash . $v . $dash;
                                }
@@ -1344,10 +1344,10 @@ class HtmlParser {
                if (is_array($TSconfig['tags.'])) {
                        foreach ($TSconfig['tags.'] as $key => $tagC) {
                                if (!is_array($tagC) && $key == strtolower($key)) {
-                                       if (!strcmp($tagC, '0')) {
+                                       if ((string)$tagC === '0') {
                                                unset($keepTags[$key]);
                                        }
-                                       if (!strcmp($tagC, '1') && !isset($keepTags[$key])) {
+                                       if ((string)$tagC === '1' && !isset($keepTags[$key])) {
                                                $keepTags[$key] = 1;
                                        }
                                }
@@ -1367,10 +1367,10 @@ class HtmlParser {
                                                                }
                                                                $keepTags[$key]['fixAttrib'][$atName] = array_merge($keepTags[$key]['fixAttrib'][$atName], $atConfig);
                                                                // Candidate for \TYPO3\CMS\Core\Utility\GeneralUtility::array_merge() if integer-keys will some day make trouble...
-                                                               if (strcmp($keepTags[$key]['fixAttrib'][$atName]['range'], '')) {
+                                                               if ((string)$keepTags[$key]['fixAttrib'][$atName]['range'] !== '') {
                                                                        $keepTags[$key]['fixAttrib'][$atName]['range'] = GeneralUtility::trimExplode(',', $keepTags[$key]['fixAttrib'][$atName]['range']);
                                                                }
-                                                               if (strcmp($keepTags[$key]['fixAttrib'][$atName]['list'], '')) {
+                                                               if ((string)$keepTags[$key]['fixAttrib'][$atName]['list'] !== '') {
                                                                        $keepTags[$key]['fixAttrib'][$atName]['list'] = GeneralUtility::trimExplode(',', $keepTags[$key]['fixAttrib'][$atName]['list']);
                                                                }
                                                        }
@@ -1509,11 +1509,11 @@ class HtmlParser {
                                $tagName = strtolower($tagName);
                                // Process attributes
                                $tagAttrib = $this->get_tag_attributes($tagP);
-                               if (!strcmp($tagName, 'img') && !isset($tagAttrib[0]['alt'])) {
+                               if ($tagName === 'img' && !isset($tagAttrib[0]['alt'])) {
                                        $tagAttrib[0]['alt'] = '';
                                }
                                // Set alt attribute for all images (not XHTML though...)
-                               if (!strcmp($tagName, 'script') && !isset($tagAttrib[0]['type'])) {
+                               if ($tagName === 'script' && !isset($tagAttrib[0]['type'])) {
                                        $tagAttrib[0]['type'] = 'text/javascript';
                                }
                                // Set type attribute for all script-tags
index cc0dd8e..00b8dcf 100644 (file)
@@ -213,7 +213,7 @@ class RteHtmlParser extends \TYPO3\CMS\Core\Html\HtmlParser {
                // Get parameters for rte_transformation:
                $p = ($this->rte_p = BackendUtility::getSpecConfParametersFromArray($specConf['rte_transform']['parameters']));
                // Setting modes:
-               if (strcmp($this->procOptions['overruleMode'], '')) {
+               if ((string)$this->procOptions['overruleMode'] !== '') {
                        $modes = array_unique(GeneralUtility::trimExplode(',', $this->procOptions['overruleMode']));
                } else {
                        $modes = array_unique(GeneralUtility::trimExplode('-', $p['mode']));
@@ -803,7 +803,7 @@ class RteHtmlParser extends \TYPO3\CMS\Core\Html\HtmlParser {
                                                        $link_params_parts = explode('#', $idPart);
                                                        $idPart = trim($link_params_parts[0]);
                                                        $sectionMark = trim($link_params_parts[1]);
-                                                       if (!strcmp($idPart, '')) {
+                                                       if ((string)$idPart === '') {
                                                                $idPart = $this->recPid;
                                                        }
                                                        // If no id or alias is given, set it to class record pid
@@ -920,7 +920,7 @@ class RteHtmlParser extends \TYPO3\CMS\Core\Html\HtmlParser {
                $cc = 0;
                $aC = count($blockSplit);
                // Avoid superfluous linebreaks by transform_db after ending headListTag
-               while ($aC && !strcmp(trim($blockSplit[($aC - 1)]), '')) {
+               while ($aC && trim($blockSplit[($aC - 1)]) === '') {
                        unset($blockSplit[$aC - 1]);
                        $aC = count($blockSplit);
                }
@@ -1019,7 +1019,7 @@ class RteHtmlParser extends \TYPO3\CMS\Core\Html\HtmlParser {
                                }
                        } else {
                                // NON-block:
-                               if (strcmp(trim($blockSplit[$k]), '')) {
+                               if (trim($blockSplit[$k]) !== '') {
                                        $blockSplit[$k] = preg_replace('/<hr\\/>/', '<hr />', $blockSplit[$k]);
                                        // Remove linebreaks preceding hr tags
                                        $blockSplit[$k] = preg_replace('/[' . LF . CR . ']+<(hr)(\\s[^>\\/]*)?[[:space:]]*\\/?>/', '<$1$2/>', $blockSplit[$k]);
@@ -1148,7 +1148,7 @@ class RteHtmlParser extends \TYPO3\CMS\Core\Html\HtmlParser {
                                        }
                                }
                                // If $blockSplit[$k] is blank then unset the line, unless the line only contained linebreaks
-                               if (!strcmp($blockSplit[$k], '') && !$onlyLineBreaks) {
+                               if ((string)$blockSplit[$k] === '' && !$onlyLineBreaks) {
                                        unset($blockSplit[$k]);
                                } else {
                                        $blockSplit[$k] = $this->setDivTags($blockSplit[$k], $this->procOptions['useDIVasParagraphTagForRTE'] ? 'div' : 'p');
@@ -1231,7 +1231,7 @@ class RteHtmlParser extends \TYPO3\CMS\Core\Html\HtmlParser {
                if (!is_array($this->getKeepTags_cache[$direction]) || $tagList) {
                        // Setting up allowed tags:
                        // If the $tagList input var is set, this will take precedence
-                       if (strcmp($tagList, '')) {
+                       if ((string)$tagList !== '') {
                                $keepTags = array_flip(GeneralUtility::trimExplode(',', $tagList, TRUE));
                        } else {
                                // Default is to get allowed/denied tags from internal array of processing options:
@@ -1403,13 +1403,13 @@ class RteHtmlParser extends \TYPO3\CMS\Core\Html\HtmlParser {
                                                        }
                                                }
                                                // ALIGN attribute:
-                                               if (!$this->procOptions['skipAlign'] && strcmp(trim($attribs[0]['align']), '') && strtolower($attribs[0]['align']) != 'left') {
+                                               if (!$this->procOptions['skipAlign'] && trim($attribs[0]['align']) !== '' && strtolower($attribs[0]['align']) != 'left') {
                                                        // Set to value, but not 'left'
                                                        $newAttribs['align'] = strtolower($attribs[0]['align']);
                                                }
                                                // CLASS attribute:
                                                // Set to whatever value
-                                               if (!$this->procOptions['skipClass'] && strcmp(trim($attribs[0]['class']), '')) {
+                                               if (!$this->procOptions['skipClass'] && trim($attribs[0]['class']) !== '') {
                                                        if (!count($this->allowedClasses) || in_array($attribs[0]['class'], $this->allowedClasses)) {
                                                                $newAttribs['class'] = $attribs[0]['class'];
                                                        } else {
@@ -1428,11 +1428,11 @@ class RteHtmlParser extends \TYPO3\CMS\Core\Html\HtmlParser {
                                                // Remove any line break char (10 or 13)
                                                $subLines[$sk] = preg_replace('/' . LF . '|' . CR . '/', '', $subLines[$sk]);
                                                // If there are any attributes or if we are supposed to remap the tag, then do so:
-                                               if (count($newAttribs) && strcmp($remapParagraphTag, '1')) {
-                                                       if ($remapParagraphTag == 'P') {
+                                               if (count($newAttribs) && $remapParagraphTag !== '1') {
+                                                       if ($remapParagraphTag === 'P') {
                                                                $tagName = 'p';
                                                        }
-                                                       if ($remapParagraphTag == 'DIV') {
+                                                       if ($remapParagraphTag === 'DIV') {
                                                                $tagName = 'div';
                                                        }
                                                        $subLines[$sk] = '<' . trim(($tagName . ' ' . $this->compileTagAttribs($newAttribs))) . '>' . $subLines[$sk] . '</' . $tagName . '>';
@@ -1455,7 +1455,7 @@ class RteHtmlParser extends \TYPO3\CMS\Core\Html\HtmlParser {
                                $divSplit[$k] = preg_replace('/<(hr)(\\s[^>\\/]*)?[[:space:]]*\\/?>/i', LF . '<$1$2/>' . LF, $divSplit[$k]);
                                $divSplit[$k] = preg_replace('/' . LF . LF . '/i', LF, $divSplit[$k]);
                                $divSplit[$k] = preg_replace('/(^' . LF . ')|(' . LF . '$)/i', '', $divSplit[$k]);
-                               if (!strcmp($divSplit[$k], '')) {
+                               if ((string)$divSplit[$k] === '') {
                                        unset($divSplit[$k]);
                                }
                        }
@@ -1487,7 +1487,7 @@ class RteHtmlParser extends \TYPO3\CMS\Core\Html\HtmlParser {
                foreach ($parts as $k => $v) {
                        // Processing of line content:
                        // If the line is blank, set it to &nbsp;
-                       if (!strcmp(trim($parts[$k]), '')) {
+                       if (trim($parts[$k]) === '') {
                                $parts[$k] = '&nbsp;';
                        } else {
                                // Clean the line content:
@@ -1699,10 +1699,10 @@ class RteHtmlParser extends \TYPO3\CMS\Core\Html\HtmlParser {
                                // If the script path seems to match or is empty (FE-EDIT)
                                // New processing order 100502
                                $uP = parse_url($info['relUrl']);
-                               if (!strcmp(('#' . $siteUrl_parts['fragment']), $info['relUrl'])) {
+                               if ($info['relUrl'] === '#' . $siteUrl_parts['fragment']) {
                                        $info['url'] = $info['relUrl'];
                                        $info['type'] = 'anchor';
-                               } elseif (!trim($uP['path']) || !strcmp($uP['path'], 'index.php')) {
+                               } elseif (!trim($uP['path']) || $uP['path'] === 'index.php') {
                                        // URL is a page (id parameter)
                                        $pp = preg_split('/^id=/', $uP['query']);
                                        $pp[1] = preg_replace('/&id=[^&]*/', '', $pp[1]);
index 7c4119b..da5e586 100644 (file)
@@ -377,7 +377,7 @@ class TimeTracker {
                        if ($flag_queries && is_array($data['selectQuery'])) {
                                $msgArr[] = \TYPO3\CMS\Core\Utility\DebugUtility::viewArray($data['selectQuery']);
                        }
-                       if ($flag_content && strcmp($data['content'], '')) {
+                       if ($flag_content && (string)$data['content'] !== '') {
                                $maxlen = 120;
                                // Break lines which are too longer than $maxlen chars (can happen if content contains long paths...)
                                if (preg_match_all('/(\\S{' . $maxlen . ',})/', $data['content'], $reg)) {
index e1cd01a..50bd8fb 100644 (file)
@@ -352,14 +352,14 @@ class ExtendedTemplateService extends \TYPO3\CMS\Core\TypoScript\TemplateService
         */
        public function ext_getSetup($theSetup, $theKey) {
                $parts = explode('.', $theKey, 2);
-               if (strcmp($parts[0], '') && is_array($theSetup[$parts[0] . '.'])) {
-                       if (strcmp(trim($parts[1]), '')) {
+               if ((string)$parts[0] !== '' && is_array($theSetup[$parts[0] . '.'])) {
+                       if (trim($parts[1]) !== '') {
                                return $this->ext_getSetup($theSetup[$parts[0] . '.'], trim($parts[1]));
                        } else {
                                return array($theSetup[$parts[0] . '.'], $theSetup[$parts[0]]);
                        }
                } else {
-                       if (strcmp(trim($theKey), '')) {
+                       if (trim($theKey) !== '') {
                                return array(array(), $theSetup[$theKey]);
                        } else {
                                return array($theSetup, '');
@@ -675,7 +675,7 @@ class ExtendedTemplateService extends \TYPO3\CMS\Core\TypoScript\TemplateService
                                                        <td align="center">' . ($row['clConf'] ? \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('status-status-checked') : '') . '&nbsp;&nbsp;' . '</td>
                                                        <td align="center">' . ($row['clConst'] ? \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('status-status-checked') : '') . '&nbsp;&nbsp;' . '</td>
                                                        <td align="center">' . ($row['pid'] ? $row['pid'] : '') . '</td>
-                                                       <td align="center">' . (strcmp($RL, '') ? $RL : '') . '</td>
+                                                       <td align="center">' . ((string)$RL !== '' ? $RL : '') . '</td>
                                                        <td>' . ($row['next'] ? '&nbsp;' . $row['next'] . '&nbsp;&nbsp;' : '') . '</td>
                                                </tr>';
                        if ($deeper) {
@@ -1546,7 +1546,7 @@ class ExtendedTemplateService extends \TYPO3\CMS\Core\TypoScript\TemplateService
                                                                }
                                                                break;
                                                }
-                                               if ($this->ext_printAll || strcmp($theConstants[$key]['value'], $var)) {
+                                               if ($this->ext_printAll || (string)$theConstants[$key]['value'] !== (string)$var) {
                                                        // Put value in, if changed.
                                                        $this->ext_putValueInConf($key, $var);
                                                }
index 98e9385..e4be696 100644 (file)
@@ -506,7 +506,7 @@ class TypoScriptParser {
                                $newValue = str_replace($fromStr, $toStr, $currentValue);
                                break;
                        case 'addToList':
-                               $newValue = (strcmp('', $currentValue) ? $currentValue . ',' : '') . trim($modifierArgument);
+                               $newValue = ((string)$currentValue !== '' ? $currentValue . ',' : '') . trim($modifierArgument);
                                break;
                        case 'removeFromList':
                                $existingElements = GeneralUtility::trimExplode(',', $currentValue);
@@ -819,7 +819,7 @@ class TypoScriptParser {
                $absfilename = GeneralUtility::getFileAbsFileName($absfilename);
 
                $newString .= LF . '### <INCLUDE_TYPOSCRIPT: source="FILE:' . $filename . '"' . $optionalProperties . '> BEGIN:' . LF;
-               if (strcmp($filename, '')) {
+               if ((string)$filename !== '') {
                        // Must exist and must not contain '..' and must be relative
                        // Check for allowed files
                        if (!GeneralUtility::verifyFilenameAgainstDenyPattern($absfilename)) {
@@ -1164,7 +1164,7 @@ class TypoScriptParser {
                                $lineC .= $this->highLightStyles['error'][0] . '<strong> - ERROR:</strong> ' . htmlspecialchars(implode(';', $errA[$rawP])) . $this->highLightStyles['error'][1];
                        }
                        if ($highlightBlockMode && $this->highLightData_bracelevel[$rawP]) {
-                               $lineC = str_pad('', $this->highLightData_bracelevel[$rawP] * 2, ' ', STR_PAD_LEFT) . '<span style="' . $this->highLightBlockStyles . ($this->highLightBlockStyles_basecolor ? 'background-color: ' . GeneralUtility::modifyHTMLColorAll($this->highLightBlockStyles_basecolor, -$this->highLightData_bracelevel[$rawP] * 16) : '') . '">' . (strcmp($lineC, '') ? $lineC : '&nbsp;') . '</span>';
+                               $lineC = str_pad('', $this->highLightData_bracelevel[$rawP] * 2, ' ', STR_PAD_LEFT) . '<span style="' . $this->highLightBlockStyles . ($this->highLightBlockStyles_basecolor ? 'background-color: ' . GeneralUtility::modifyHTMLColorAll($this->highLightBlockStyles_basecolor, -$this->highLightData_bracelevel[$rawP] * 16) : '') . '">' . ($lineC !== '' ? $lineC : '&nbsp;') . '</span>';
                        }
                        if (is_array($lineNumDat)) {
                                $lineNum = $rawP + $lineNumDat[0];
index 95f71c9..98f0ee8 100644 (file)
@@ -439,11 +439,11 @@ class TemplateService {
                        if ($GLOBALS['TSFE']->all) {
                                $cc = $GLOBALS['TSFE']->all;
                                // The two rowSums must NOT be different from each other - which they will be if start/endtime or hidden has changed!
-                               if (strcmp(serialize($this->rowSum), serialize($cc['rowSum']))) {
+                               if (serialize($this->rowSum) !== serialize($cc['rowSum'])) {
                                        unset($cc);
                                } else {
                                        // If $TSFE->all contains valid data, we don't need to update cache_pagesection (because this data was fetched from there already)
-                                       if (!strcmp(serialize($this->rootLine), serialize($cc['rootLine']))) {
+                                       if (serialize($this->rootLine) === serialize($cc['rootLine'])) {
                                                $isCached = TRUE;
                                        }
                                        // When the data is serialized below (ROWSUM hash), it must not contain the rootline by concept. So this must be removed (and added again later)...
@@ -782,7 +782,7 @@ class TemplateService {
                        foreach ($include_static_fileArr as $ISF_file) {
                                if (substr($ISF_file, 0, 4) == 'EXT:') {
                                        list($ISF_extKey, $ISF_localPath) = explode('/', substr($ISF_file, 4), 2);
-                                       if (strcmp($ISF_extKey, '') && \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded($ISF_extKey) && strcmp($ISF_localPath, '')) {
+                                       if ((string)$ISF_extKey !== '' && \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded($ISF_extKey) && (string)$ISF_localPath !== '') {
                                                $ISF_localPath = rtrim($ISF_localPath, '/') . '/';
                                                $ISF_filePath = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($ISF_extKey) . $ISF_localPath;
                                                if (@is_dir($ISF_filePath)) {
@@ -1240,7 +1240,7 @@ class TemplateService {
                if (isset($this->fileCache[$hash])) {
                        return $this->fileCache[$hash];
                }
-               if (!strcmp(substr($file, 0, 4), 'EXT:')) {
+               if (substr($file, 0, 4) === 'EXT:') {
                        $newFile = '';
                        list($extKey, $script) = explode('/', substr($file, 4), 2);
                        if ($extKey && \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded($extKey)) {
@@ -1473,7 +1473,7 @@ class TemplateService {
                if (!\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($typeOverride) && intval($GLOBALS['TSFE']->config['config']['forceTypeValue'])) {
                        $typeOverride = intval($GLOBALS['TSFE']->config['config']['forceTypeValue']);
                }
-               if (strcmp($typeOverride, '')) {
+               if ((string)$typeOverride !== '') {
                        $typeNum = $typeOverride;
                }
                // Override...
index 5321930..63e144c 100644 (file)
@@ -114,7 +114,7 @@ class DiffUtility {
                                                $outString .= '<' . $wrapTag . ' class="diff-g">' . htmlspecialchars(implode(' ', $diffResArray[($a + 1)]['new'])) . '</' . $wrapTag . '> ';
                                        }
                                        $chInfParts = explode(',', $diffResArray[$a + 1]['changeInfo']);
-                                       if (!strcmp($chInfParts[0], ($a + 1))) {
+                                       if ((string)$chInfParts[0] === (string)($a + 1)) {
                                                $newLine = intval($chInfParts[1]) - 1;
                                                if ($newLine > $a) {
                                                        $a = $newLine;
index fcec966..ee4b1e6 100644 (file)
@@ -816,7 +816,7 @@ class ExtensionManagementUtility {
                                                $pointer = 0;
                                                $found = FALSE;
                                                foreach ($mods as $k => $m) {
-                                                       if (!strcmp($m, $modRef)) {
+                                                       if ($m === $modRef) {
                                                                $pointer = strtolower($place) == 'after' ? $k + 1 : $k;
                                                                $found = TRUE;
                                                        }
@@ -1186,7 +1186,7 @@ class ExtensionManagementUtility {
                }
                if (is_array($GLOBALS['TCA']['tt_content']['columns']) && is_array($GLOBALS['TCA']['tt_content']['columns'][$type]['config']['items'])) {
                        foreach ($GLOBALS['TCA']['tt_content']['columns'][$type]['config']['items'] as $k => $v) {
-                               if (!strcmp($v[1], $itemArray[1])) {
+                               if ((string)$v[1] === (string)$itemArray[1]) {
                                        $GLOBALS['TCA']['tt_content']['columns'][$type]['config']['items'][$k] = $itemArray;
                                        return;
                                }
index 69a0511..becf568 100644 (file)
@@ -406,7 +406,7 @@ class GeneralUtility {
                                        $firstpart = substr($binnet, 0, $mask);
                                        $binip = str_pad(decbin($lip), 32, '0', STR_PAD_LEFT);
                                        $firstip = substr($binip, 0, $mask);
-                                       $yes = strcmp($firstpart, $firstip) == 0;
+                                       $yes = $firstpart === $firstip;
                                } else {
                                        // "192.168.*.*"
                                        $IPparts = explode('.', $test);
@@ -1427,7 +1427,7 @@ class GeneralUtility {
         */
        static public function inArray(array $in_array, $item) {
                foreach ($in_array as $val) {
-                       if (!is_array($val) && !strcmp($val, $item)) {
+                       if (!is_array($val) && (string)$val === (string)$item) {
                                return TRUE;
                        }
                }
@@ -1509,7 +1509,7 @@ class GeneralUtility {
                foreach ($array as $k => $v) {
                        if (is_array($v)) {
                                $array[$k] = self::removeArrayEntryByValue($v, $cmpValue);
-                       } elseif (!strcmp($v, $cmpValue)) {
+                       } elseif ((string)$v === (string)$cmpValue) {
                                unset($array[$k]);
                        }
                }
@@ -1580,7 +1580,7 @@ class GeneralUtility {
                        if (is_array($AVal)) {
                                $str = self::implodeArrayForUrl($thisKeyName, $AVal, $str, $skipBlank, $rawurlencodeParamName);
                        } else {
-                               if (!$skipBlank || strcmp($AVal, '')) {
+                               if (!$skipBlank || (string)$AVal !== '') {
                                        $str .= '&' . ($rawurlencodeParamName ? rawurlencode($thisKeyName) : $thisKeyName) . '=' . rawurlencode($AVal);
                                }
                        }
@@ -1872,13 +1872,13 @@ class GeneralUtility {
                $tag_tmp = trim(rtrim($tag_tmp, '>'));
                $value = array();
                // Compared with empty string instead , 030102
-               while (strcmp($tag_tmp, '')) {
+               while ($tag_tmp !== '') {
                        $firstChar = substr($tag_tmp, 0, 1);
-                       if (!strcmp($firstChar, '"') || !strcmp($firstChar, '\'')) {
+                       if ($firstChar === '"' || $firstChar === '\'') {
                                $reg = explode($firstChar, $tag_tmp, 3);
                                $value[] = $reg[1];
                                $tag_tmp = trim($reg[2]);
-                       } elseif (!strcmp($firstChar, '=')) {
+                       } elseif ($firstChar === '=') {
                                $value[] = '=';
                                // Removes = chars.
                                $tag_tmp = trim(substr($tag_tmp, 1));
@@ -1913,7 +1913,7 @@ class GeneralUtility {
                }
                $list = array();
                foreach ($arr as $p => $v) {
-                       if (strcmp($v, '') || $dontOmitBlankAttribs) {
+                       if ((string)$v !== '' || $dontOmitBlankAttribs) {
                                $list[] = $p . '="' . $v . '"';
                        }
                }
@@ -2082,7 +2082,7 @@ class GeneralUtility {
                                // Use tag based on parent tag name:
                                $attr .= ' index="' . htmlspecialchars($tagName) . '"';
                                $tagName = (string) $options['parentTagMap'][$stackData['parentTagName']];
-                       } elseif (!strcmp(intval($tagName), $tagName)) {
+                       } elseif (MathUtility::canBeInterpretedAsInteger($tagName)) {
                                // If integer...;
                                if ($options['useNindex']) {
                                        // If numeric key, prefix "n"
@@ -2232,7 +2232,7 @@ class GeneralUtility {
                        // Test for numeric tag, encoded on the form "nXXX":
                        $testNtag = substr($tagName, 1);
                        // Closing tag.
-                       $tagName = substr($tagName, 0, 1) == 'n' && !strcmp(intval($testNtag), $testNtag) ? intval($testNtag) : $tagName;
+                       $tagName = substr($tagName, 0, 1) == 'n' && MathUtility::canBeInterpretedAsInteger($testNtag) ? (int)$testNtag : $tagName;
                        // Test for alternative index value:
                        if (strlen($val['attributes']['index'])) {
                                $tagName = $val['attributes']['index'];
@@ -3353,14 +3353,14 @@ Connection: close
                                $SFN_A = explode('/', strrev($SFN));
                                $acc = array();
                                foreach ($SN_A as $kk => $vv) {
-                                       if (!strcmp($SFN_A[$kk], $vv)) {
+                                       if ((string)$SFN_A[$kk] === (string)$vv) {
                                                $acc[] = $vv;
                                        } else {
                                                break;
                                        }
                                }
                                $commonEnd = strrev(implode('/', $acc));
-                               if (strcmp($commonEnd, '')) {
+                               if ((string)$commonEnd !== '') {
                                        $DR = substr($SFN, 0, -(strlen($commonEnd) + 1));
                                }
                                $retVal = $DR;
@@ -3413,7 +3413,7 @@ Connection: close
                                if (self::cmpIP(self::getIndpEnv('REMOTE_ADDR'), $proxySSL)) {
                                        $retVal = TRUE;
                                } else {
-                                       $retVal = $_SERVER['SSL_SESSION_ID'] || !strcasecmp($_SERVER['HTTPS'], 'on') || !strcmp($_SERVER['HTTPS'], '1') ? TRUE : FALSE;
+                                       $retVal = $_SERVER['SSL_SESSION_ID'] || strtolower($_SERVER['HTTPS']) === 'on' || (string)$_SERVER['HTTPS'] === '1' ? TRUE : FALSE;
                                }
                                break;
                        case '_ARRAY':
@@ -3580,7 +3580,7 @@ Connection: close
         * @return string Returns the absolute filename of $filename IF valid, otherwise blank string.
         */
        static public function getFileAbsFileName($filename, $onlyRelative = TRUE, $relToTYPO3_mainDir = FALSE) {
-               if (!strcmp($filename, '')) {
+               if ((string)$filename === '') {
                        return '';
                }
                if ($relToTYPO3_mainDir) {
@@ -3595,7 +3595,7 @@ Connection: close
                if (substr($filename, 0, 4) == 'EXT:') {
                        list($extKey, $local) = explode('/', substr($filename, 4), 2);
                        $filename = '';
-                       if (strcmp($extKey, '') && \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded($extKey) && strcmp($local, '')) {
+                       if ((string)$extKey !== '' && \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded($extKey) && (string)$local !== '') {
                                $filename = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extPath($extKey) . $local;
                        }
                } elseif (!self::isAbsPath($filename)) {
@@ -3605,7 +3605,7 @@ Connection: close
                        // absolute, but set to blank if not allowed
                        $filename = '';
                }
-               if (strcmp($filename, '') && self::validPathStr($filename)) {
+               if ((string)$filename !== '' && self::validPathStr($filename)) {
                        // checks backpath.
                        return $filename;
                }
@@ -3668,7 +3668,7 @@ Connection: close
                if (preg_match('/[[:cntrl:]]/', $filename)) {
                        return FALSE;
                }
-               if (strcmp($filename, '') && strcmp($GLOBALS['TYPO3_CONF_VARS']['BE']['fileDenyPattern'], '')) {
+               if ((string)$filename !== '' && (string)$GLOBALS['TYPO3_CONF_VARS']['BE']['fileDenyPattern'] !== '') {
                        $result = preg_match('/' . $GLOBALS['TYPO3_CONF_VARS']['BE']['fileDenyPattern'] . '/i', $filename);
                        if ($result) {
                                return FALSE;
index 5e1b05d..1549b7c 100644 (file)
@@ -415,6 +415,14 @@ class DataHandlerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                                TRUE,
                                '', '0', 'int', FALSE
                        ),
+                       'integer value "" vs. 0' => array(
+                               TRUE,
+                               '', 0, 'int', FALSE
+                       ),
+                       'integer value "0" vs. 0' => array(
+                               TRUE,
+                               '0', 0, 'int', FALSE
+                       ),
                        'integer value 1 vs. 1' => array(
                                TRUE,
                                1, 1, 'int', FALSE
@@ -423,6 +431,14 @@ class DataHandlerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                                TRUE,
                                1, '1', 'int', FALSE
                        ),
+                       'integer value "1" vs. "1"' => array(
+                               TRUE,
+                               '1', '1', 'int', FALSE
+                       ),
+                       'integer value "1" vs. 1' => array(
+                               TRUE,
+                               '1', 1, 'int', FALSE
+                       ),
                        'integer value "0" vs. "1"' => array(
                                FALSE,
                                '0', '1', 'int', FALSE
@@ -477,10 +493,26 @@ class DataHandlerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                                TRUE,
                                '', '0', 'int', TRUE
                        ),
+                       'integer with allowed null value "" vs. 0' => array(
+                               TRUE,
+                               '', 0, 'int', TRUE
+                       ),
+                       'integer with allowed null value "0" vs. 0' => array(
+                               TRUE,
+                               '0', 0, 'int', TRUE
+                       ),
                        'integer with allowed null value 1 vs. 1' => array(
                                TRUE,
                                1, 1, 'int', TRUE
                        ),
+                       'integer with allowed null value "1" vs. "1"' => array(
+                               TRUE,
+                               '1', '1', 'int', TRUE
+                       ),
+                       'integer with allowed null value "1" vs. 1' => array(
+                               TRUE,
+                               '1', 1, 'int', TRUE
+                       ),
                        'integer with allowed null value 1 vs. "1"' => array(
                                TRUE,
                                1, '1', 'int', TRUE
@@ -505,6 +537,10 @@ class DataHandlerTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                                FALSE,
                                NULL, '0', 'int', TRUE
                        ),
+                       'integer with allowed null value null vs. 0' => array(
+                               FALSE,
+                               NULL, 0, 'int', TRUE
+                       ),
                        'integer with allowed null value "0" vs. null' => array(
                                FALSE,
                                '0', NULL, 'int', TRUE
index a49b395..c588085 100644 (file)
@@ -377,7 +377,7 @@ class HelpModuleController {
                        $parts[0] = '';
                        // Traverse table columns as listed in TCA_DESCR
                        foreach ($GLOBALS['TCA_DESCR'][$key]['columns'] as $field => $_) {
-                               $fieldValue = isset($GLOBALS['TCA'][$key]) && strcmp($field, '') ? $GLOBALS['TCA'][$key]['columns'][$field] : array();
+                               $fieldValue = isset($GLOBALS['TCA'][$key]) && (string)$field !== '' ? $GLOBALS['TCA'][$key]['columns'][$field] : array();
                                if (is_array($fieldValue) && (!$this->limitAccess || !$fieldValue['exclude'] || $GLOBALS['BE_USER']->check('non_exclude_fields', $table . ':' . $field))) {
                                        if (!$field) {
                                                // Header
index c04bab6..2981db9 100644 (file)
@@ -82,7 +82,7 @@ class CssStyledContentController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlug
                        // Get bodytext field content, returning blank if empty:
                        $field = isset($conf['field']) && trim($conf['field']) ? trim($conf['field']) : 'bodytext';
                        $content = trim($this->cObj->data[$field]);
-                       if (!strcmp($content, '')) {
+                       if ($content === '') {
                                return '';
                        }
                        // Split into single lines:
@@ -119,7 +119,7 @@ class CssStyledContentController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlug
                        // Get bodytext field content
                        $field = isset($conf['field']) && trim($conf['field']) ? trim($conf['field']) : 'bodytext';
                        $content = trim($this->cObj->data[$field]);
-                       if (!strcmp($content, '')) {
+                       if ($content === '') {
                                return '';
                        }
                        // get flexform values
@@ -158,7 +158,7 @@ class CssStyledContentController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlug
                                $cells = str_getcsv($v, $delimiter, $quotedInput);
                                $newCells = array();
                                for ($a = 0; $a < $cols; $a++) {
-                                       if (!strcmp(trim($cells[$a]), '')) {
+                                       if (trim($cells[$a]) === '') {
                                                $cells[$a] = '&nbsp;';
                                        }
                                        $cellAttribs = $noStyles ? '' : ($a > 0 && $cols - 1 == $a ? ' class="td-last td-' . $a . '"' : ' class="td-' . $a . '"');
index eb44605..6b6f10f 100644 (file)
@@ -63,7 +63,7 @@ class ArrayUtility {
                $chunksArr = explode($delimiter, $string);
                $newChunksArr = array();
                foreach ($chunksArr as $value) {
-                       if ($onlyNonEmptyValues === FALSE || strcmp('', trim($value))) {
+                       if ($onlyNonEmptyValues === FALSE || trim($value) !== '') {
                                $newChunksArr[] = trim($value);
                        }
                }
index ff28b3a..aeb4ee6 100644 (file)
@@ -77,7 +77,7 @@ class ExtraPageContextMenuOptions {
                        $deleteFound = FALSE;
                        foreach ($menuItems as $key => $value) {
                                $c++;
-                               if (!strcmp($key, 'delete')) {
+                               if ($key === 'delete') {
                                        $deleteFound = TRUE;
                                        break;
                                }
index 0ae1f92..739273e 100644 (file)
@@ -529,7 +529,7 @@ class FileList extends \TYPO3\CMS\Backend\RecordList\AbstractRecordList {
                $href = $this->backPath . $this->script . '&id=' . rawurlencode($folderObject->getCombinedIdentifier());
                $onclick = ' onclick="' . htmlspecialchars(('top.content.nav_frame.hilight_row("file","folder' . GeneralUtility::md5int($folderObject->getCombinedIdentifier()) . '_"+top.fsMod.currentBank)')) . '"';
                // Sometimes $code contains plain HTML tags. In such a case the string should not be modified!
-               if (!strcmp($title, strip_tags($title))) {
+               if ((string)$title === strip_tags($title)) {
                        return '<a href="' . htmlspecialchars($href) . '"' . $onclick . ' title="' . htmlspecialchars($title) . '">' . GeneralUtility::fixed_lgd_cs($title, $this->fixedL) . '</a>';
                } else {
                        return '<a href="' . htmlspecialchars($href) . '"' . $onclick . '>' . $title . '</a>';
index bc1d620..3a5a90e 100644 (file)
@@ -1278,7 +1278,7 @@ class ContentObjectRenderer {
         */
        public function getSlidePids($pidList, $pidConf) {
                $pidList = isset($pidConf) ? trim($this->stdWrap($pidList, $pidConf)) : trim($pidList);
-               if (!strcmp($pidList, '')) {
+               if ($pidList === '') {
                        $pidList = 'this';
                }
                if (trim($pidList)) {
@@ -4223,11 +4223,11 @@ class ContentObjectRenderer {
                        // adds/overrides attributes
                        foreach ($conf as $pkey => $val) {
                                if (substr($pkey, -1) != '.' && substr($pkey, 0, 1) != '_') {
-                                       $tmpVal = isset($conf[$pkey . '.']) ? $this->stdWrap($conf[$pkey], $conf[$pkey . '.']) : $conf[$pkey];
+                                       $tmpVal = isset($conf[$pkey . '.']) ? $this->stdWrap($conf[$pkey], $conf[$pkey . '.']) : (string)$val;
                                        if ($lowerCaseAttributes) {
                                                $pkey = strtolower($pkey);
                                        }
-                                       if (strcmp($tmpVal, '')) {
+                                       if ($tmpVal !== '') {
                                                $attribs[$pkey] = $tmpVal;
                                        }
                                }
@@ -4688,7 +4688,7 @@ class ContentObjectRenderer {
                        $conf = $temp_conf['parseFunc.'];
                }
                // Process:
-               if (strcmp($conf['externalBlocks'], '')) {
+               if ((string)$conf['externalBlocks'] !== '') {
                        $tags = strtolower(implode(',', GeneralUtility::trimExplode(',', $conf['externalBlocks'])));
                        $htmlParser = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Html\\HtmlParser');
                        $parts = $htmlParser->splitIntoBlock($tags, $theValue);
@@ -5005,7 +5005,7 @@ class ContentObjectRenderer {
                $encapTags = GeneralUtility::trimExplode(',', strtolower($conf['encapsTagList']), TRUE);
                $nonWrappedTag = $conf['nonWrappedTag'];
                $defaultAlign = isset($conf['defaultAlign.']) ? trim($this->stdWrap($conf['defaultAlign'], $conf['defaultAlign.'])) : trim($conf['defaultAlign']);
-               if (!strcmp('', $theValue)) {
+               if ((string)$theValue === '') {
                        return '';
                }
                foreach ($lParts as $k => $l) {
@@ -5054,7 +5054,7 @@ class ContentObjectRenderer {
                                        foreach ($conf['addAttributes.'][$uTagName . '.'] as $kk => $vv) {
                                                if (!is_array($vv)) {
                                                        if ((string) $conf['addAttributes.'][($uTagName . '.')][($kk . '.')]['setOnly'] == 'blank') {
-                                                               if (!strcmp($attrib[$kk], '')) {
+                                                               if ((string)$attrib[$kk] === '') {
                                                                        $attrib[$kk] = $vv;
                                                                }
                                                        } elseif ((string) $conf['addAttributes.'][($uTagName . '.')][($kk . '.')]['setOnly'] == 'exists') {
@@ -5364,7 +5364,7 @@ class ContentObjectRenderer {
                } else {
                        $sections = GeneralUtility::trimExplode('//', $field, TRUE);
                        foreach ($sections as $k) {
-                               if (strcmp($this->data[$k], '')) {
+                               if ((string)$this->data[$k] !== '') {
                                        return $this->data[$k];
                                }
                        }
@@ -5698,7 +5698,7 @@ class ContentObjectRenderer {
                                // Traverse the items-array...
                                foreach ($GLOBALS['TCA'][$table]['columns'][$field]['config']['items'] as $item) {
                                        // ... and return the first found label where the value was equal to $key
-                                       if (!strcmp($item[1], trim($value))) {
+                                       if ((string)$item[1] === trim($value)) {
                                                $output[] = $GLOBALS['TSFE']->sL($item[0]);
                                        }
                                }
@@ -5745,7 +5745,7 @@ class ContentObjectRenderer {
                        $link_paramA = GeneralUtility::unQuoteFilenames($link_param, TRUE);
                        // Check for link-handler keyword:
                        list($linkHandlerKeyword, $linkHandlerValue) = explode(':', trim($link_paramA[0]), 2);
-                       if ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['typolinkLinkHandler'][$linkHandlerKeyword] && strcmp($linkHandlerValue, '')) {
+                       if ($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['typolinkLinkHandler'][$linkHandlerKeyword] && (string)$linkHandlerValue !== '') {
                                $linkHandlerObj = GeneralUtility::getUserObj($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['typolinkLinkHandler'][$linkHandlerKeyword]);
                                if (method_exists($linkHandlerObj, 'main')) {
                                        return $linkHandlerObj->main($linktxt, $conf, $linkHandlerKeyword, $linkHandlerValue, $link_param, $this);
@@ -5937,7 +5937,7 @@ class ContentObjectRenderer {
                                        // Link-data del
                                        $link_param = trim($link_params_parts[0]);
                                        // If no id or alias is given
-                                       if (!strcmp($link_param, '')) {
+                                       if ($link_param === '') {
                                                $link_param = $GLOBALS['TSFE']->id;
                                        }
                                        if ($link_params_parts[1] && !$sectionMark) {
@@ -6339,7 +6339,7 @@ class ContentObjectRenderer {
                // MountPoints:
                if ($GLOBALS['TYPO3_CONF_VARS']['FE']['enable_mount_pids'] && $GLOBALS['TSFE']->MP) {
                        // Same page as current.
-                       if (!strcmp($GLOBALS['TSFE']->id, $pageId)) {
+                       if ((int)$GLOBALS['TSFE']->id === (int)$pageId) {
                                $MP = $GLOBALS['TSFE']->MP;
                        } else {
                                // ... otherwise find closest meeting point:
@@ -6391,7 +6391,7 @@ class ContentObjectRenderer {
         * @todo Define visibility
         */
        public function getMailTo($mailAddress, $linktxt, $initP = '?') {
-               if (!strcmp($linktxt, '')) {
+               if ((string)$linktxt === '') {
                        $linktxt = $mailAddress;
                }
                $mailToUrl = 'mailto:' . $mailAddress;
@@ -7189,7 +7189,7 @@ class ContentObjectRenderer {
                                }
                        }
                        // If $feEditSelf is set, fe_users may always edit them selves...
-                       if ($feEditSelf && $table == 'fe_users' && !strcmp($feUserRow['uid'], $row['uid'])) {
+                       if ($feEditSelf && $table == 'fe_users' && (int)$feUserRow['uid'] === (int)$row['uid']) {
                                $ok = 1;
                        }
                        // Points to the field (integer) that holds the fe_group-id of the creator fe_user's first group
@@ -7626,7 +7626,7 @@ class ContentObjectRenderer {
                                $conf['pidInList'] = implode(',', $expandedPidList);
                        }
                }
-               if (!strcmp($conf['pidInList'], '')) {
+               if ((string)$conf['pidInList'] === '') {
                        $conf['pidInList'] = 'this';
                }
                $queryParts = $this->getWhere($table, $conf, TRUE);
index 799968b..02054c8 100644 (file)
@@ -92,7 +92,7 @@ class FormContentObject extends \TYPO3\CMS\Frontend\ContentObject\AbstractConten
                                                if (is_array($singleKeyArray['valueArray.'])) {
                                                        $temp_accumulated = array();
                                                        foreach ($singleKeyArray['valueArray.'] as $singleKey => $singleKey_valueArray) {
-                                                               if (is_array($singleKey_valueArray) && !strcmp((intval($singleKey) . '.'), $singleKey)) {
+                                                               if (is_array($singleKey_valueArray) && (int)$singleKey . '.' === (string)$singleKey) {
                                                                        $temp_valueArray = array();
                                                                        $valueArrayLabel = isset($singleKey_valueArray['label.']) ? $this->cObj->stdWrap($singleKey_valueArray['label'], $singleKey_valueArray['label.']) : $singleKey_valueArray['label'];
                                                                        list($temp_valueArray[0]) = explode('=', $valueArrayLabel);
@@ -193,7 +193,7 @@ class FormContentObject extends \TYPO3\CMS\Frontend\ContentObject\AbstractConten
                                        } else {
                                                $addParams = isset($conf['params.']) ? trim($this->cObj->stdWrap($conf['params'], $conf['params.'])) : trim($conf['params']);
                                        }
-                                       if (strcmp('', $addParams)) {
+                                       if ((string)$addParams !== '') {
                                                $addParams = ' ' . $addParams;
                                        }
                                } else {
@@ -354,7 +354,7 @@ class FormContentObject extends \TYPO3\CMS\Frontend\ContentObject\AbstractConten
                                                        } else {
                                                                $radioLabelIdAttribute = '';
                                                        }
-                                                       $optionParts .= '<input type="radio" name="' . $confData['fieldname'] . '"' . $radioLabelIdAttribute . ' value="' . $items[$a][1] . '"' . (!strcmp($items[$a][1], $default) ? ' checked="checked"' : '') . $addParams . ' />';
+                                                       $optionParts .= '<input type="radio" name="' . $confData['fieldname'] . '"' . $radioLabelIdAttribute . ' value="' . $items[$a][1] . '"' . ((string)$items[$a][1] === (string)$default ? ' checked="checked"' : '') . $addParams . ' />';
                                                        if ($accessibility) {
                                                                $label = isset($conf['radioWrap.']) ? $this->cObj->stdWrap(trim($items[$a][0]), $conf['radioWrap.']) : trim($items[$a][0]);
                                                                $optionParts .= '<label for="' . $radioId . '">' . $label . '</label>';
index ed395b9..67c8ba6 100644 (file)
@@ -851,7 +851,7 @@ class AbstractMenuContentObject {
                        // Fill in the menuArr with elements that should go into the menu:
                        $this->menuArr = array();
                        foreach ($temp as $data) {
-                               $spacer = GeneralUtility::inList($this->spacerIDList, $data['doktype']) || !strcmp($data['ITEM_STATE'], 'SPC') ? 1 : 0;
+                               $spacer = GeneralUtility::inList($this->spacerIDList, $data['doktype']) || $data['ITEM_STATE'] === 'SPC' ? 1 : 0;
                                // if item is a spacer, $spacer is set
                                if ($this->filterMenuPages($data, $banUidArray, $spacer)) {
                                        $c_b++;
@@ -1479,7 +1479,7 @@ class AbstractMenuContentObject {
         */
        public function isCurrent($uid, $MPvar = '') {
                $testUid = $uid . ($MPvar ? ':' . $MPvar : '');
-               if ($uid && !strcmp(end($this->rL_uidRegister), ('ITEM:' . $testUid))) {
+               if ($uid && end($this->rL_uidRegister) === 'ITEM:' . $testUid) {
                        return TRUE;
                }
        }
@@ -1548,7 +1548,7 @@ class AbstractMenuContentObject {
                $natVal = 0;
                // If any value is set for ITEM_STATE the normal evaluation is discarded
                if ($this->menuArr[$key]['ITEM_STATE']) {
-                       if (!strcmp($this->menuArr[$key]['ITEM_STATE'], $kind)) {
+                       if ((string)$this->menuArr[$key]['ITEM_STATE'] === (string)$kind) {
                                $natVal = 1;
                        }
                } else {
@@ -1646,7 +1646,7 @@ class AbstractMenuContentObject {
         * @todo Define visibility
         */
        public function getPageTitle($title, $nav_title) {
-               return strcmp(trim($nav_title), '') ? $nav_title : $title;
+               return trim($nav_title) !== '' ? $nav_title : $title;
        }
 
        /**
index b819e09..9f1c106 100644 (file)
@@ -127,7 +127,7 @@ class TranslationStatusController extends \TYPO3\CMS\Backend\Module\AbstractFunc
                        $tCells = array();
                        $langRecUids[0][] = $data['row']['uid'];
                        // Page icons / titles etc.
-                       $tCells[] = '<td' . ($data['row']['_CSSCLASS'] ? ' class="' . $data['row']['_CSSCLASS'] . '"' : '') . '>' . $data['HTML'] . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($data['row']['title'], $titleLen)) . (strcmp($data['row']['nav_title'], '') ? ' [Nav: <em>' . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($data['row']['nav_title'], $titleLen)) . '</em>]' : '') . '</td>';
+                       $tCells[] = '<td' . ($data['row']['_CSSCLASS'] ? ' class="' . $data['row']['_CSSCLASS'] . '"' : '') . '>' . $data['HTML'] . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($data['row']['title'], $titleLen)) . ((string)$data['row']['nav_title'] !== '' ? ' [Nav: <em>' . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($data['row']['nav_title'], $titleLen)) . '</em>]' : '') . '</td>';
                        // DEFAULT language:
                        // "View page" link is created:
                        $viewPageLink = '<a href="#" onclick="' . htmlspecialchars(
@@ -162,7 +162,7 @@ class TranslationStatusController extends \TYPO3\CMS\Backend\Module\AbstractFunc
                                                        $row,
                                                        array('class' => 'c-recIcon')
                                                );
-                                               $info = $icon . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($row['title'], $titleLen)) . (strcmp($row['nav_title'], '') ? ' [Nav: <em>' . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($row['nav_title'], $titleLen)) . '</em>]' : '') . ($row['_COUNT'] > 1 ? '<div>' . $LANG->getLL('lang_renderl10n_badThingThereAre', TRUE) . '</div>' : '');
+                                               $info = $icon . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($row['title'], $titleLen)) . ((string)$row['nav_title'] !== '' ? ' [Nav: <em>' . htmlspecialchars(\TYPO3\CMS\Core\Utility\GeneralUtility::fixed_lgd_cs($row['nav_title'], $titleLen)) . '</em>]' : '') . ($row['_COUNT'] > 1 ? '<div>' . $LANG->getLL('lang_renderl10n_badThingThereAre', TRUE) . '</div>' : '');
                                                $tCells[] = '<td class="' . $status . ' c-leftLine">' . $info . '</td>';
                                                // Edit whole record:
                                                $info = '';
index b4aa062..f24b65d 100644 (file)
@@ -911,7 +911,7 @@ class TypoScriptFrontendController {
                if (\TYPO3\CMS\Core\Utility\GeneralUtility::_GP('FE_SESSION_KEY')) {
                        $fe_sParts = explode('-', GeneralUtility::_GP('FE_SESSION_KEY'));
                        // If the session key hash check is OK:
-                       if (!strcmp(md5(($fe_sParts[0] . '/' . $this->TYPO3_CONF_VARS['SYS']['encryptionKey'])), $fe_sParts[1])) {
+                       if (md5(($fe_sParts[0] . '/' . $this->TYPO3_CONF_VARS['SYS']['encryptionKey'])) === (string)$fe_sParts[1]) {
                                $cookieName = \TYPO3\CMS\Frontend\Authentication\FrontendUserAuthentication::getCookieName();
                                $_COOKIE[$cookieName] = $fe_sParts[0];
                                if (isset($_SERVER['HTTP_COOKIE'])) {
@@ -1902,7 +1902,7 @@ class TypoScriptFrontendController {
                }
                // Create response:
                // Simply boolean; Just shows TYPO3 error page with reason:
-               if (gettype($code) == 'boolean' || !strcmp($code, 1)) {
+               if (gettype($code) == 'boolean' || (string)$code === '1') {
                        $title = 'Page Not Found';
                        $message = 'The page did not exist or was inaccessible.' . ($reason ? ' Reason: ' . htmlspecialchars($reason) : '');
                        $messagePage = GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\Messaging\\ErrorpageMessage', $message, $title);
@@ -2526,7 +2526,7 @@ class TypoScriptFrontendController {
                                                        case 'content_fallback':
                                                                $fallBackOrder = GeneralUtility::intExplode(',', $sys_language_content);
                                                                foreach ($fallBackOrder as $orderValue) {
-                                                                       if (!strcmp($orderValue, '0') || count($this->sys_page->getPageOverlay($this->id, $orderValue))) {
+                                                                       if ((string)$orderValue === '0' || count($this->sys_page->getPageOverlay($this->id, $orderValue))) {
                                                                                $this->sys_language_content = $orderValue;
                                                                                // Setting content uid (but leaving the sys_language_uid)
                                                                                break;
@@ -2974,7 +2974,7 @@ class TypoScriptFrontendController {
                                }
                                $value = '&' . $linkVar . '=' . $temp;
                        } else {
-                               if ($test !== '' && strcmp('array', $test)) {
+                               if ($test !== '' && $test !== 'array') {
                                        // Error: This key must not be an array!
                                        continue;
                                }
@@ -3047,7 +3047,7 @@ class TypoScriptFrontendController {
                <strong>Page is being generated.</strong><br />
                If this message does not disappear within ' . $seconds . ' seconds, please reload.';
                        $message = $this->config['config']['message_page_is_being_generated'];
-                       if (strcmp('', $message)) {
+                       if ((string)$message !== '') {
                                // This page is always encoded as UTF-8
                                $message = $this->csConvObj->utf8_encode($message, $this->renderCharset);
                                $message = str_replace('###TITLE###', $title, $message);
@@ -4046,7 +4046,7 @@ if (version == "n3") {
                if ($decode) {
                        list($md5Hash, $str) = explode(':', $string, 2);
                        $newHash = substr(md5($this->TYPO3_CONF_VARS['SYS']['encryptionKey'] . ':' . $str), 0, 10);
-                       if (!strcmp($md5Hash, $newHash)) {
+                       if ($md5Hash === $newHash) {
                                $str = base64_decode($str);
                                $str = $this->roundTripCryptString($str);
                                return $str;
@@ -4634,7 +4634,7 @@ if (version == "n3") {
                if (!isset($this->LL_labels_cache[$this->lang][$input])) {
                        $restStr = trim(substr($input, 4));
                        $extPrfx = '';
-                       if (!strcmp(substr($restStr, 0, 4), 'EXT:')) {
+                       if (substr($restStr, 0, 4) === 'EXT:') {
                                $restStr = trim(substr($restStr, 4));
                                $extPrfx = 'EXT:';
                        }
index 51fc940..ffb2873 100644 (file)
@@ -384,7 +384,7 @@ class PageGenerator {
                        $pageRenderer->setXmlPrologAndDocType(implode(LF, $docTypeParts));
                }
                // Begin header section:
-               if (strcmp($GLOBALS['TSFE']->config['config']['htmlTag_setParams'], 'none')) {
+               if ($GLOBALS['TSFE']->config['config']['htmlTag_setParams'] !== 'none') {
                        $_attr = $GLOBALS['TSFE']->config['config']['htmlTag_setParams'] ? $GLOBALS['TSFE']->config['config']['htmlTag_setParams'] : GeneralUtility::implodeAttributes($htmlTagAttributes);
                } else {
                        $_attr = '';
@@ -1074,7 +1074,7 @@ class PageGenerator {
                        if (strstr('|' . $needle . '|', '|' . $haystack . '|')) {
                                $OK = TRUE;
                        }
-               } elseif (!strcmp($needle, $haystack)) {
+               } elseif ((string)$needle === (string)$haystack) {
                        // String comparison
                        $OK = TRUE;
                }
index 4ce6d4f..3d4f35d 100644 (file)
@@ -842,7 +842,7 @@ class PageRepository {
         */
        public function deleteClause($table) {
                // Hardcode for pages because TCA might not be loaded yet (early frontend initialization)
-               if (!strcmp($table, 'pages')) {
+               if ($table === 'pages') {
                        return ' AND pages.deleted=0';
                } else {
                        return $GLOBALS['TCA'][$table]['ctrl']['delete'] ? ' AND ' . $table . '.' . $GLOBALS['TCA'][$table]['ctrl']['delete'] . '=0' : '';
@@ -999,7 +999,7 @@ class PageRepository {
                                }
                        }
                        // If workspace ids matches and ID of current online version is found, look up the PID value of that:
-                       if ($oid && ($this->versioningWorkspaceId == 0 && $this->checkWorkspaceAccess($wsid) || !strcmp((int) $wsid, $this->versioningWorkspaceId))) {
+                       if ($oid && ((int)$this->versioningWorkspaceId === 0 && $this->checkWorkspaceAccess($wsid) || (int)$wsid === (int)$this->versioningWorkspaceId)) {
                                $oidRec = $this->getRawRecord($table, $oid, 'pid', TRUE);
                                if (is_array($oidRec)) {
                                        // SWAP uid as well? Well no, because when fixing a versioning PID happens it is assumed that this is a "branch" type page and therefore the uid should be kept (like in versionOL()).
index 3b41ff3..60be303 100644 (file)
@@ -1165,13 +1165,13 @@ class ImportExportController extends \TYPO3\CMS\Backend\Module\BaseScriptClass {
                $opt = array();
                $isSelFlag = 0;
                foreach ($optValues as $k => $v) {
-                       $sel = !strcmp($k, $value) ? ' selected="selected"' : '';
+                       $sel = (string)$k === (string)$value ? ' selected="selected"' : '';
                        if ($sel) {
                                $isSelFlag++;
                        }
                        $opt[] = '<option value="' . htmlspecialchars($k) . '"' . $sel . '>' . htmlspecialchars($v) . '</option>';
                }
-               if (!$isSelFlag && strcmp('', $value)) {
+               if (!$isSelFlag && (string)$value !== '') {
                        $opt[] = '<option value="' . htmlspecialchars($value) . '" selected="selected">' . htmlspecialchars(('[\'' . $value . '\']')) . '</option>';
                }
                return '<select name="' . $prefix . '">' . implode('', $opt) . '</select>';
index 0e6199d..396e773 100644 (file)
@@ -533,7 +533,7 @@ class ImportExport {
         */
        public function export_addRecord($table, $row, $relationLevel = 0) {
                BackendUtility::workspaceOL($table, $row);
-               if (strcmp($table, '') && is_array($row) && $row['uid'] > 0 && !$this->excludeMap[($table . ':' . $row['uid'])]) {
+               if ((string)$table !== '' && is_array($row) && $row['uid'] > 0 && !$this->excludeMap[($table . ':' . $row['uid'])]) {
                        if ($this->checkPID($table === 'pages' ? $row['uid'] : $row['pid'])) {
                                if (!isset($this->dat['records'][($table . ':' . $row['uid'])])) {
                                        // Prepare header info:
@@ -2191,10 +2191,10 @@ class ImportExport {
                $initStr = fread($fd, $initStrLen);
                $initStrDat = explode(':', $initStr);
                if (strstr($initStrDat[0], 'Warning') == FALSE) {
-                       if (!strcmp($initStrDat[3], '')) {
+                       if ((string)$initStrDat[3] === '') {
                                $datString = fread($fd, intval($initStrDat[2]));
                                fread($fd, 1);
-                               if (!strcmp(md5($datString), $initStrDat[0])) {
+                               if (md5($datString) === $initStrDat[0]) {
                                        if ($initStrDat[1]) {
                                                if ($this->compress) {
                                                        $datString = gzuncompress($datString);
@@ -2246,10 +2246,10 @@ class ImportExport {
                $initStr = substr($filecontent, $pointer, $initStrLen);
                $pointer += $initStrLen;
                $initStrDat = explode(':', $initStr);
-               if (!strcmp($initStrDat[3], '')) {
+               if ((string)$initStrDat[3] === '') {
                        $datString = substr($filecontent, $pointer, intval($initStrDat[2]));
                        $pointer += intval($initStrDat[2]) + 1;
-                       if (!strcmp(md5($datString), $initStrDat[0])) {
+                       if (md5($datString) === $initStrDat[0]) {
                                if ($initStrDat[1]) {
                                        if ($this->compress) {
                                                $datString = gzuncompress($datString);
@@ -2745,7 +2745,7 @@ class ImportExport {
                                        $testDirPrefix2 = $this->verifyFolderAccess($testDirPrefix);
                                        if (!$testDirPrefix2) {
                                                $pInfo['msg'] = 'ERROR: There are no available filemounts to write file in! ';
-                                       } elseif (strcmp($testDirPrefix, $testDirPrefix2)) {
+                                       } elseif ($testDirPrefix !== $testDirPrefix2) {
                                                $pInfo['msg'] = 'File will be attempted written to "' . $testDirPrefix2 . '". ';
                                        }
                                }
@@ -3027,13 +3027,13 @@ class ImportExport {
                $opt = array();
                $isSelFlag = 0;
                foreach ($optValues as $k => $v) {
-                       $sel = !strcmp($k, $value) ? ' selected="selected"' : '';
+                       $sel = (string)$k === (string)$value ? ' selected="selected"' : '';
                        if ($sel) {
                                $isSelFlag++;
                        }
                        $opt[] = '<option value="' . htmlspecialchars($k) . '"' . $sel . '>' . htmlspecialchars($v) . '</option>';
                }
-               if (!$isSelFlag && strcmp('', $value)) {
+               if (!$isSelFlag && (string)$value !== '') {
                        $opt[] = '<option value="' . htmlspecialchars($value) . '" selected="selected">' . htmlspecialchars(('[\'' . $value . '\']')) . '</option>';
                }
                return '<select name="' . $prefix . '">' . implode('', $opt) . '</select>';
@@ -3060,7 +3060,7 @@ class ImportExport {
                        foreach ($databaseRecord as $fN => $value) {
                                if (is_array($GLOBALS['TCA'][$table]['columns'][$fN]) && $GLOBALS['TCA'][$table]['columns'][$fN]['config']['type'] != 'passthrough') {
                                        if (isset($importRecord[$fN])) {
-                                               if (strcmp(trim($databaseRecord[$fN]), trim($importRecord[$fN]))) {
+                                               if (trim($databaseRecord[$fN]) !== trim($importRecord[$fN])) {
                                                        // Create diff-result:
                                                        $output[$fN] = $t3lib_diff_Obj->makeDiffDisplay(BackendUtility::getProcessedValue($table, $fN, !$inverseDiff ? $importRecord[$fN] : $databaseRecord[$fN], 0, 1, 1), BackendUtility::getProcessedValue($table, $fN, !$inverseDiff ? $databaseRecord[$fN] : $importRecord[$fN], 0, 1, 1));
                                                }
index 42fad09..e8ef0bf 100644 (file)
@@ -50,7 +50,7 @@ class LocalPageTree extends \TYPO3\CMS\Backend\Tree\View\BrowseTreeView {
         * @todo Define visibility
         */
        public function wrapTitle($title, $v) {
-               $title = !strcmp(trim($title), '') ? '<em>[' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.no_title', TRUE) . ']</em>' : htmlspecialchars($title);
+               $title = trim($title) === '' ? '<em>[' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.no_title', TRUE) . ']</em>' : htmlspecialchars($title);
                return $title;
        }
 
index 03a3508..6e9c49d 100644 (file)
@@ -1012,7 +1012,7 @@ class IndexedPagesController extends \TYPO3\CMS\Backend\Module\AbstractFunctionM
                $lines = array();
                $isRemoved = 0;
                while ($row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
-                       if (!$isRemoved && !strcmp($row['gr_list'], $gr_list)) {
+                       if (!$isRemoved && (string)$row['gr_list'] === (string)$gr_list) {
                                $isRemoved = 1;
                        } else {
                                $lines[] = $row;
index 50ce45b..e7bf795 100644 (file)
@@ -1235,7 +1235,7 @@ class SearchFormController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
                        }
                } else {
                        // Ordinary TYPO3 pages:
-                       if (strcmp($row['gr_list'], $GLOBALS['TSFE']->gr_list)) {
+                       if ((string)$row['gr_list'] !== (string)$GLOBALS['TSFE']->gr_list) {
                                // Selecting for the grlist records belonging to the phash-row where the current users gr_list exists. If it is found it is proof that this user has direct access to the phash-rows content although he did not himself initiate the indexing...
                                if (\TYPO3\CMS\IndexedSearch\Utility\IndexedSearchUtility::isTableUsed('index_grlist')) {
                                        $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('phash', 'index_grlist', 'phash=' . intval($row['phash']) . ' AND gr_list=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($GLOBALS['TSFE']->gr_list, 'index_grlist'));
@@ -1473,7 +1473,7 @@ class SearchFormController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
                        $opt = array();
                        $isSelFlag = 0;
                        foreach ($optValues as $k => $v) {
-                               $sel = !strcmp($k, $value) ? ' selected="selected"' : '';
+                               $sel = (string)$k === (string)$value ? ' selected="selected"' : '';
                                if ($sel) {
                                        $isSelFlag++;
                                }
@@ -1778,7 +1778,7 @@ class SearchFormController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
                        $opt = array();
                        $isSelFlag = 0;
                        foreach ($optValues as $k => $v) {
-                               $sel = !strcmp($k, $value) ? ' selected="selected"' : '';
+                               $sel = (string)$k === (string)$value ? ' selected="selected"' : '';
                                if ($sel) {
                                        $isSelFlag++;
                                }
index b731ff4..954866c 100644 (file)
@@ -674,7 +674,7 @@ class IndexSearchRepository {
                        }
                } else {
                        // Ordinary TYPO3 pages:
-                       if (strcmp($row['gr_list'], $this->frontendUserGroupList)) {
+                       if ((string)$row['gr_list'] !== (string)$this->frontendUserGroupList) {
                                // Selecting for the grlist records belonging to the phash-row where the current users gr_list exists. If it is found it is proof that this user has direct access to the phash-rows content although he did not himself initiate the indexing...
                                if ($this->isTableUsed('index_grlist')) {
                                        $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('phash', 'index_grlist', 'phash=' . intval($row['phash']) . ' AND gr_list=' . $GLOBALS['TYPO3_DB']->fullQuoteStr($this->frontendUserGroupList, 'index_grlist'));
index 36f345f..c1f9cbc 100644 (file)
@@ -258,7 +258,7 @@ class Indexer {
                        if (!$indexerConfig['disableFrontendIndexing'] || $this->crawlerActive) {
                                if (!$pObj->page['no_search']) {
                                        if (!$pObj->no_cache) {
-                                               if (!strcmp($pObj->sys_language_uid, $pObj->sys_language_content)) {
+                                               if ((int)$pObj->sys_language_uid === (int)$pObj->sys_language_content) {
                                                        // Setting up internal configuration from config array:
                                                        $this->conf = array();
                                                        // Information about page for which the indexing takes place
index d11d992..2d1ed9b 100644 (file)
@@ -101,7 +101,7 @@ class AllConfiguration extends Action\AbstractAction implements Action\ActionInt
                                                $itemData['value'] = str_replace(array('\'.chr(10).\'', '\' . LF . \''), array(LF, LF), $value);
                                        } elseif (preg_match('/^(<.*?>)?boolean/i', $description)) {
                                                $itemData['type'] = 'checkbox';
-                                               $itemData['value'] = $value && strcmp($value, '0') ? $value : 1;
+                                               $itemData['value'] = !empty($value) ? $value : 1;
                                                $itemData['checked'] = $value ? TRUE : FALSE;
                                        } else {
                                                $itemData['type'] = 'input';
@@ -153,7 +153,7 @@ class AllConfiguration extends Action\AbstractAction implements Action\ActionInt
                                                                }
                                                        }
                                                        // Save if value changed
-                                                       if (strcmp($GLOBALS['TYPO3_CONF_VARS'][$section][$valueKey], $value)) {
+                                                       if ((string)$GLOBALS['TYPO3_CONF_VARS'][$section][$valueKey] !== (string)$value) {
                                                                $configurationPathValuePairs[$section . '/' . $valueKey] = $value;
                                                                /** @var $message \TYPO3\CMS\Install\Status\StatusInterface */
                                                                $status = $this->objectManager->get('TYPO3\\CMS\\Install\\Status\\OkStatus');
@@ -191,13 +191,13 @@ class AllConfiguration extends Action\AbstractAction implements Action\ActionInt
                foreach ($lines as $lc) {
                        $lc = trim($lc);
                        if ($in) {
-                               if (!strcmp($lc, ');')) {
+                               if ($lc === ');') {
                                        $in = 0;
                                } else {
                                        if (preg_match('/["\']([[:alnum:]_-]*)["\'][[:space:]]*=>(.*)/i', $lc, $reg)) {
                                                preg_match('/,[\\t\\s]*\\/\\/(.*)/i', $reg[2], $creg);
                                                $theComment = trim($creg[1]);
-                                               if (substr(strtolower(trim($reg[2])), 0, 5) == 'array' && !strcmp($reg[1], strtoupper($reg[1]))) {
+                                               if (substr(strtolower(trim($reg[2])), 0, 5) == 'array' && $reg[1] === strtoupper($reg[1])) {
                                                        $mainKey = trim($reg[1]);
                                                } elseif ($mainKey) {
                                                        $commentArray[$mainKey][$reg[1]] = $theComment;
@@ -205,7 +205,7 @@ class AllConfiguration extends Action\AbstractAction implements Action\ActionInt
                                        }
                                }
                        }
-                       if (!strcmp($lc, 'return array(')) {
+                       if ($lc === 'return array(') {
                                $in = 1;
                        }
                }
index 25373f1..42b777b 100644 (file)
@@ -520,7 +520,7 @@ class SqlSchemaMigrationService {
                        if (stristr($lineContent, 'auto_increment')) {
                                $lineContent = preg_replace('/ default \'0\'/i', '', $lineContent);
                        }
-                       if (!$removeNonSQL || strcmp(trim($lineContent), '') && substr(trim($lineContent), 0, 1) != '#' && substr(trim($lineContent), 0, 2) != '--') {
+                       if (!$removeNonSQL || trim($lineContent) !== '' && substr(trim($lineContent), 0, 1) != '#' && substr(trim($lineContent), 0, 2) != '--') {
                                // '--' is seen as mysqldump comments from server version 3.23.49
                                $statementArray[$statementArrayPointer] .= $lineContent;
                                $is_set = 1;
@@ -588,7 +588,7 @@ class SqlSchemaMigrationService {
                        $reg = array();
                        if (preg_match('/^insert[[:space:]]*into[[:space:]]*[`]?([[:alnum:]_]*)[`]?/i', substr($lineContent, 0, 100), $reg)) {
                                $nTable = trim($reg[1]);
-                               if ($nTable && !strcmp($table, $nTable)) {
+                               if ($nTable && $table === $nTable) {
                                        $outStatements[] = $lineContent;
                                }
                        }
index 7a111c9..786768f 100644 (file)
@@ -295,7 +295,7 @@ class LanguageService {
                        $restStr = trim(substr($input, 4));
                        $extPrfx = '';
                                // ll-file refered to is found in an extension.
-                       if (!strcmp(substr($restStr, 0, 4), 'EXT:')) {
+                       if (substr($restStr, 0, 4) === 'EXT:') {
                                $restStr = trim(substr($restStr, 4));
                                $extPrfx = 'EXT:';
                        }
index 1e52055..b03742d 100644 (file)
@@ -559,7 +559,7 @@ class DatabaseIntegrityView {
                $pcontent = $GLOBALS['LANG']->getLL('enterRegexPattern') . ' <input type="text" name="pattern" value="' . htmlspecialchars(($pattern ? $pattern : $GLOBALS['TYPO3_CONF_VARS']['BE']['fileDenyPattern'])) . '"> <input type="submit" name="' . $GLOBALS['LANG']->getLL('SearchButton') . '">';
                $this->content .= $this->doc->header($GLOBALS['LANG']->getLL('findFilename'));
                $this->content .= $this->doc->section($GLOBALS['LANG']->getLL('pattern'), $pcontent, FALSE, TRUE);
-               if (strcmp($pattern, '')) {
+               if ((string)$pattern !== '') {
                        $dirs = GeneralUtility::get_dirs(PATH_site);
                        $lines = array();
                        $depth = 10;
index 12a2049..9539f56 100644 (file)
@@ -1108,7 +1108,7 @@ class ElementBrowser {
                // Making the browsable pagetree:
                $pagetree = GeneralUtility::makeInstance('TBE_PageTree');
                $pagetree->thisScript = $this->thisScript;
-               $pagetree->ext_pArrPages = !strcmp($tables, 'pages') ? 1 : 0;
+               $pagetree->ext_pArrPages = $tables === 'pages' ? 1 : 0;
                $pagetree->ext_showNavTitle = $GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.showNavTitle');
                $pagetree->ext_showPageId = $GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.showPageIdWithTitle');
 
@@ -1411,7 +1411,7 @@ class ElementBrowser {
                $out = '';
                if ($this->expandPage >= 0 && \TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($this->expandPage) && $GLOBALS['BE_USER']->isInWebMount($this->expandPage)) {
                        // Set array with table names to list:
-                       if (!strcmp(trim($tables), '*')) {
+                       if (trim($tables) === '*') {
                                $tablesArr = array_keys($GLOBALS['TCA']);
                        } else {
                                $tablesArr = GeneralUtility::trimExplode(',', $tables, TRUE);
index 169a634..86b36f1 100644 (file)
@@ -577,7 +577,7 @@ class AbstractDatabaseRecordList extends \TYPO3\CMS\Backend\RecordList\AbstractR
                        'LIMIT' => $limit
                );
                // Filter out records that are translated, if TSconfig mod.web_list.hideTranslations is set
-               if ((in_array($table, GeneralUtility::trimExplode(',', $this->hideTranslations)) || $this->hideTranslations === '*') && !empty($GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField']) && strcmp($table, 'pages_language_overlay')) {
+               if ((in_array($table, GeneralUtility::trimExplode(',', $this->hideTranslations)) || $this->hideTranslations === '*') && !empty($GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField']) && $table !== 'pages_language_overlay') {
                        $queryParts['WHERE'] .= ' AND ' . $GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField'] . '=0 ';
                }
                // Apply hook as requested in http://forge.typo3.org/issues/16634
@@ -740,7 +740,7 @@ class AbstractDatabaseRecordList extends \TYPO3\CMS\Backend\RecordList\AbstractR
        public function linkWrapItems($table, $uid, $code, $row) {
                $origCode = $code;
                // If the title is blank, make a "no title" label:
-               if (!strcmp($code, '')) {
+               if ((string)$code === '') {
                        $code = '<i>[' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:labels.no_title', 1) . ']</i> - ' . htmlspecialchars(GeneralUtility::fixed_lgd_cs(
                                                BackendUtility::getRecordTitle($table, $row), $GLOBALS['BE_USER']->uc['titleLen']));
                } else {
@@ -822,7 +822,7 @@ class AbstractDatabaseRecordList extends \TYPO3\CMS\Backend\RecordList\AbstractR
         */
        public function listURL($altId = '', $table = -1, $exclList = '') {
                $urlParameters = array();
-               if (strcmp($altId, '')) {
+               if ((string)$altId !== '') {
                        $urlParameters['id'] = $altId;
                } else {
                        $urlParameters['id'] = $this->id;
index dfdbb6c..71467b3 100644 (file)
@@ -959,7 +959,7 @@ class BrowseLinks extends \TYPO3\CMS\Recordlist\Browser\ElementBrowser {
         * @return string Localized string.
         */
        public function getPageConfigLabel($string, $JScharCode = 1) {
-               if (strcmp(substr($string, 0, 4), 'LLL:')) {
+               if (substr($string, 0, 4) !== 'LLL:') {
                        $label = $string;
                } else {
                        $label = $GLOBALS['LANG']->sL(trim($string));
index 29f232c..641ab6e 100644 (file)
@@ -111,7 +111,7 @@ class AccessibilityLinkController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlu
                if (substr($filename, 0, 4) == 'EXT:') {
                        list($extKey, $local) = explode('/', substr($filename, 4), 2);
                        $newFilename = '';
-                       if (strcmp($extKey, '') && \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded($extKey) && strcmp($local, '')) {
+                       if ((string)$extKey !== '' && \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded($extKey) && (string)$local !== '') {
                                $newFilename = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($extKey) . $local;
                        }
                } elseif (substr($filename, 0, 1) != '/') {
index b2b2d59..81d03f6 100644 (file)
@@ -1269,7 +1269,7 @@ class RteHtmlAreaBase extends \TYPO3\CMS\Backend\Rte\AbstractRte {
        public function getPageConfigLabel($string, $JScharCode = 1) {
                global $LANG, $TSFE, $TYPO3_CONF_VARS;
                if ($this->is_FE()) {
-                       if (strcmp(substr($string, 0, 4), 'LLL:')) {
+                       if (substr($string, 0, 4) !== 'LLL:') {
                                // A pure string coming from Page TSConfig must be in utf-8
                                $label = $TSFE->csConvObj->conv($TSFE->sL(trim($string)), 'utf-8', $this->OutputCharset);
                        } else {
@@ -1278,7 +1278,7 @@ class RteHtmlAreaBase extends \TYPO3\CMS\Backend\Rte\AbstractRte {
                        $label = str_replace('"', '\\"', str_replace('\\\'', '\'', $label));
                        $label = $JScharCode ? $this->feJScharCode($label) : $label;
                } else {
-                       if (strcmp(substr($string, 0, 4), 'LLL:')) {
+                       if (substr($string, 0, 4) !== 'LLL:') {
                                $label = $string;
                        } else {
                                $label = $LANG->sL(trim($string));
@@ -1307,7 +1307,7 @@ class RteHtmlAreaBase extends \TYPO3\CMS\Backend\Rte\AbstractRte {
                        // extension
                        list($extKey, $local) = explode('/', substr($filename, 4), 2);
                        $newFilename = '';
-                       if (strcmp($extKey, '') && \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded($extKey) && strcmp($local, '')) {
+                       if ((string)$extKey !== '' && \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded($extKey) && (string)$local !== '') {
                                $newFilename = ($this->is_FE() || $this->isFrontendEditActive() ? \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($extKey) : $this->backPath . \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath($extKey)) . $local;
                        }
                } elseif (substr($filename, 0, 1) != '/') {
@@ -1451,7 +1451,7 @@ class RteHtmlAreaBase extends \TYPO3\CMS\Backend\Rte\AbstractRte {
                        if ($pp[0] && $pp[1]) {
                                foreach ($matchParts as $el) {
                                        $star = substr($el, -1) == '*';
-                                       if (!strcmp($pp[0], $el) || $star && GeneralUtility::isFirstPartOfStr($pp[0], substr($el, 0, -1))) {
+                                       if ($pp[0] === (string)$el || $star && GeneralUtility::isFirstPartOfStr($pp[0], substr($el, 0, -1))) {
                                                $nStyle[] = $pp[0] . ':' . $pp[1];
                                        } else {
                                                unset($styleParts[$k]);
index a430e45..ef5a259 100644 (file)
@@ -119,9 +119,9 @@ class SaltedPasswordService extends \TYPO3\CMS\Sv\AbstractAuthenticationService
        public function compareUident(array $user, array $loginData, $security_level = 'normal') {
                $validPasswd = FALSE;
                // Could be merged; still here to clarify
-               if (!strcmp(TYPO3_MODE, 'BE')) {
+               if (TYPO3_MODE === 'BE') {
                        $password = $loginData['uident_text'];
-               } elseif (!strcmp(TYPO3_MODE, 'FE')) {
+               } elseif (TYPO3_MODE === 'FE') {
                        $password = $loginData['uident_text'];
                }
                // Determine method used for given salted hashed password
@@ -151,7 +151,7 @@ class SaltedPasswordService extends \TYPO3\CMS\Sv\AbstractAuthenticationService
                                // Instanciate default method class
                                $this->objInstanceSaltedPW = \TYPO3\CMS\Saltedpasswords\Salt\SaltFactory::getSaltingInstance(substr($user['password'], 1));
                                // md5
-                               if (!strcmp(substr($user['password'], 0, 1), 'M')) {
+                               if (substr($user['password'], 0, 1) === 'M') {
                                        $validPasswd = $this->objInstanceSaltedPW->checkPassword(md5($password), substr($user['password'], 1));
                                } else {
                                        $validPasswd = $this->objInstanceSaltedPW->checkPassword($password, substr($user['password'], 1));
@@ -161,13 +161,13 @@ class SaltedPasswordService extends \TYPO3\CMS\Sv\AbstractAuthenticationService
                                        $this->authenticationFailed = TRUE;
                                }
                        } elseif (preg_match('/[0-9abcdef]{32,32}/', $user['password'])) {
-                               $validPasswd = !strcmp(md5($password), $user['password']) ? TRUE : FALSE;
+                               $validPasswd = md5($password) === (string)$user['password'];
                                // Skip further authentication methods
                                if (!$validPasswd) {
                                        $this->authenticationFailed = TRUE;
                                }
                        } else {
-                               $validPasswd = !strcmp($password, $user['password']) ? TRUE : FALSE;
+                               $validPasswd = (string)$password === (string)$user['password'];
                        }
                        // Should we store the new format value in DB?
                        if ($validPasswd && intval($this->extConf['updatePasswd'])) {
index 0bedf60..192223d 100644 (file)
@@ -74,7 +74,7 @@ class BlowfishSaltTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function hasCorrectBaseClass() {
-               $hasCorrectBaseClass = 0 === strcmp('TYPO3\\CMS\\Saltedpasswords\\Salt\\BlowfishSalt', get_class($this->objectInstance)) ? TRUE : FALSE;
+               $hasCorrectBaseClass = get_class($this->objectInstance) === 'TYPO3\\CMS\\Saltedpasswords\\Salt\\BlowfishSalt';
                // XCLASS ?
                if (!$hasCorrectBaseClass && FALSE != get_parent_class($this->objectInstance)) {
                        $hasCorrectBaseClass = is_subclass_of($this->objectInstance, 'TYPO3\\CMS\\Saltedpasswords\\Salt\\BlowfishSalt');
@@ -257,7 +257,7 @@ class BlowfishSaltTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                        $password = str_repeat($pad, max($i, 1));
                        $saltedHashPasswordPrevious = $saltedHashPasswordCurrent;
                        $saltedHashPasswordCurrent = $this->objectInstance->getHashedPassword($password, $salt);
-                       if ($i > 0 && 0 == strcmp($saltedHashPasswordPrevious, $saltedHashPasswordCurrent)) {
+                       if ($i > 0 && $saltedHashPasswordPrevious === $saltedHashPasswordCurrent) {
                                $criticalPwLength = $i;
                                break;
                        }
index e56ce86..03c4994 100644 (file)
@@ -76,7 +76,7 @@ class Md5SaltTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function hasCorrectBaseClass() {
-               $hasCorrectBaseClass = 0 === strcmp('TYPO3\\CMS\\Saltedpasswords\\Salt\\Md5Salt', get_class($this->objectInstance)) ? TRUE : FALSE;
+               $hasCorrectBaseClass = get_class($this->objectInstance) === 'TYPO3\\CMS\\Saltedpasswords\\Salt\\Md5Salt';
                // XCLASS ?
                if (!$hasCorrectBaseClass && FALSE != get_parent_class($this->objectInstance)) {
                        $hasCorrectBaseClass = is_subclass_of($this->objectInstance, 'TYPO3\\CMS\\Saltedpasswords\\Salt\\Md5Salt');
@@ -234,7 +234,7 @@ class Md5SaltTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                        $password = str_repeat($pad, max($i, 1));
                        $saltedHashPasswordPrevious = $saltedHashPasswordCurrent;
                        $saltedHashPasswordCurrent = $this->objectInstance->getHashedPassword($password, $salt);
-                       if ($i > 0 && 0 == strcmp($saltedHashPasswordPrevious, $saltedHashPasswordCurrent)) {
+                       if ($i > 0 && $saltedHashPasswordPrevious === $saltedHashPasswordCurrent) {
                                $criticalPwLength = $i;
                                break;
                        }
index 4e042c3..68574e2 100644 (file)
@@ -63,7 +63,7 @@ class PhpassSaltTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         * @test
         */
        public function hasCorrectBaseClass() {
-               $hasCorrectBaseClass = 0 === strcmp('TYPO3\\CMS\\Saltedpasswords\\Salt\\PhpassSalt', get_class($this->objectInstance)) ? TRUE : FALSE;
+               $hasCorrectBaseClass = get_class($this->objectInstance) === 'TYPO3\\CMS\\Saltedpasswords\\Salt\\PhpassSalt';
                // XCLASS ?
                if (!$hasCorrectBaseClass && FALSE != get_parent_class($this->objectInstance)) {
                        $hasCorrectBaseClass = is_subclass_of($this->objectInstance, 'TYPO3\\CMS\\Saltedpasswords\\Salt\\PhpassSalt');
@@ -234,7 +234,7 @@ class PhpassSaltTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
                        $password = str_repeat($pad, max($i, 1));
                        $saltedHashPasswordPrevious = $saltedHashPasswordCurrent;
                        $saltedHashPasswordCurrent = $this->objectInstance->getHashedPassword($password, $salt);
-                       if ($i > 0 && 0 == strcmp($saltedHashPasswordPrevious, $saltedHashPasswordCurrent)) {
+                       if ($i > 0 && $saltedHashPasswordPrevious === $saltedHashPasswordCurrent) {
                                $criticalPwLength = $i;
                                break;
                        }
index 085a5d4..f9161e1 100644 (file)
@@ -23,6 +23,8 @@ namespace TYPO3\CMS\Scheduler\CronCommand;
  *
  *  This copyright notice MUST APPEAR in all copies of the script!
  ***************************************************************/
+use TYPO3\CMS\Core\Utility\MathUtility;
+
 /**
  * Validate and normalize a cron command.
  *
@@ -185,7 +187,7 @@ class NormalizeCommand {
                                        $fieldArray[] = self::reduceListOfValuesByStepValue($leftList . '/' . $right);
                                } elseif (strpos($listElement, '-') !== FALSE) {
                                        $fieldArray[] = self::convertRangeToListOfValues($listElement);
-                               } elseif (strcmp(intval($listElement), $listElement) === 0) {
+                               } elseif (MathUtility::canBeInterpretedAsInteger($listElement)) {
                                        $fieldArray[] = $listElement;
                                } else {
                                        throw new \InvalidArgumentException('Unable to normalize integer field.', 1291429389);
@@ -225,7 +227,7 @@ class NormalizeCommand {
                $rangeArray = explode('-', $range);
                // Sanitize fields and cast to integer
                foreach ($rangeArray as $fieldNumber => $fieldValue) {
-                       if (strcmp(intval($fieldValue), $fieldValue) !== 0) {
+                       if (!MathUtility::canBeInterpretedAsInteger($fieldValue)) {
                                throw new \InvalidArgumentException('Unable to convert value to integer.', 1291237668);
                        }
                        $rangeArray[$fieldNumber] = (int) $fieldValue;
@@ -276,7 +278,7 @@ class NormalizeCommand {
                if (strlen($stepValuesAndStepArray[1]) === 0) {
                        throw new \InvalidArgumentException('Unable to convert step values: Right part of / is empty.', 1291414956);
                }
-               if (strcmp(intval($right), $right) !== 0) {
+               if (!MathUtility::canBeInterpretedAsInteger($right)) {
                        throw new \InvalidArgumentException('Unable to convert step values: Right part must be a single integer.', 1291414957);
                }
                $right = (int) $right;
@@ -284,7 +286,7 @@ class NormalizeCommand {
                $validValues = array();
                $currentStep = $right;
                foreach ($leftArray as $leftValue) {
-                       if (strcmp(intval($leftValue), $leftValue) !== 0) {
+                       if (!MathUtility::canBeInterpretedAsInteger($leftValue)) {
                                throw new \InvalidArgumentException('Unable to convert step values: Left part must be a single integer or comma separated list of integers.', 1291414958);
                        }
                        if ($currentStep === 0) {
index ec6f12b..3cdb439 100644 (file)
@@ -46,7 +46,7 @@ class ActionList extends \TYPO3\CMS\Recordlist\RecordList\DatabaseRecordList {
         */
        public function listURL($alternativeId = '', $table = -1, $excludeList = '') {
                $urlParameters = array();
-               if (strcmp($alternativeId, '')) {
+               if ((string)$alternativeId !== '') {
                        $urlParameters['id'] = $alternativeId;
                } else {
                        $urlParameters['id'] = $this->id;
index 1670053..3f22f4d 100644 (file)
@@ -56,7 +56,7 @@ class VersionClickMenu {
                        $c = 0;
                        foreach ($menuItems as $k => $value) {
                                $c++;
-                               if (!strcmp($k, 'delete')) {
+                               if ($k === 'delete') {
                                        break;
                                }
                        }
index 43771c2..bdcd1bc 100644 (file)
@@ -316,7 +316,7 @@ class VersionModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClass
                                                                ';
                                        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)) {
-