[TASK] Use short version ?: in ternary operator (PHP 5.3+) 07/19007/10
authorStefan Neufeind <typo3.neufeind@speedpartner.de>
Thu, 19 Dec 2013 23:47:35 +0000 (00:47 +0100)
committerChristian Kuhn <lolli@schwarzbu.ch>
Thu, 30 Jan 2014 22:39:58 +0000 (23:39 +0100)
Shorten some constructs, make them easier to read
and less error-prone.

Resolves: #46400
Releases: 6.2
Change-Id: I7b0126ccfeaefdfdb89321d7287c6347d8aee050
Reviewed-on: https://review.typo3.org/19007
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
100 files changed:
typo3/sysext/backend/Classes/ClickMenu/ClickMenu.php
typo3/sysext/backend/Classes/Controller/BackendController.php
typo3/sysext/backend/Classes/Controller/EditDocumentController.php
typo3/sysext/backend/Classes/Controller/LoginController.php
typo3/sysext/backend/Classes/Controller/NewRecordController.php
typo3/sysext/backend/Classes/Controller/PageLayoutController.php
typo3/sysext/backend/Classes/Controller/Wizard/TableController.php
typo3/sysext/backend/Classes/Form/Element/InlineElement.php
typo3/sysext/backend/Classes/Form/Element/SuggestDefaultReceiver.php
typo3/sysext/backend/Classes/Form/Element/SuggestElement.php
typo3/sysext/backend/Classes/Form/Element/ValueSlider.php
typo3/sysext/backend/Classes/Form/FormEngine.php
typo3/sysext/backend/Classes/History/RecordHistory.php [changed mode: 0755->0644]
typo3/sysext/backend/Classes/Module/BaseScriptClass.php
typo3/sysext/backend/Classes/RecordList/ElementBrowserRecordList.php
typo3/sysext/backend/Classes/Toolbar/ShortcutToolbarItem.php
typo3/sysext/backend/Classes/Tree/Pagetree/Commands.php
typo3/sysext/backend/Classes/Tree/View/AbstractTreeView.php
typo3/sysext/backend/Classes/Tree/View/FolderTreeView.php
typo3/sysext/backend/Classes/Utility/BackendUtility.php
typo3/sysext/backend/Classes/Utility/IconUtility.php
typo3/sysext/belog/Classes/ViewHelpers/Form/TranslateLabelSelectViewHelper.php
typo3/sysext/beuser/Classes/ViewHelpers/IssueCommandViewHelper.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/DataHandling/DataHandler.php
typo3/sysext/core/Classes/Database/DatabaseConnection.php
typo3/sysext/core/Classes/Database/QueryGenerator.php
typo3/sysext/core/Classes/Database/RelationHandler.php
typo3/sysext/core/Classes/Database/SqlParser.php
typo3/sysext/core/Classes/Error/Http/StatusException.php
typo3/sysext/core/Classes/FrontendEditing/FrontendEditingController.php
typo3/sysext/core/Classes/Html/HtmlParser.php
typo3/sysext/core/Classes/Http/HttpRequest.php
typo3/sysext/core/Classes/Imaging/GraphicalFunctions.php
typo3/sysext/core/Classes/Localization/Parser/LocallangArrayParser.php
typo3/sysext/core/Classes/Log/LogManager.php
typo3/sysext/core/Classes/Mail/Mailer.php
typo3/sysext/core/Classes/Resource/ProcessedFile.php
typo3/sysext/core/Classes/Resource/ResourceStorage.php
typo3/sysext/core/Classes/Resource/StorageRepository.php
typo3/sysext/core/Classes/TypoScript/ConfigurationForm.php
typo3/sysext/core/Classes/TypoScript/ExtendedTemplateService.php
typo3/sysext/core/Classes/TypoScript/TemplateService.php
typo3/sysext/core/Classes/Utility/CommandUtility.php
typo3/sysext/core/Classes/Utility/File/BasicFileUtility.php
typo3/sysext/core/Classes/Utility/GeneralUtility.php
typo3/sysext/core/Tests/Unit/Log/LogRecordTest.php
typo3/sysext/cshmanual/Classes/Controller/HelpModuleController.php
typo3/sysext/css_styled_content/Classes/Controller/CssStyledContentController.php
typo3/sysext/extensionmanager/Classes/Domain/Repository/ConfigurationItemRepository.php
typo3/sysext/extensionmanager/Classes/Utility/Importer/ExtensionListUtility.php
typo3/sysext/felogin/Classes/Controller/FrontendLoginController.php
typo3/sysext/frontend/Classes/Authentication/FrontendUserAuthentication.php
typo3/sysext/frontend/Classes/ContentObject/ContentContentObject.php
typo3/sysext/frontend/Classes/ContentObject/ContentObjectRenderer.php
typo3/sysext/frontend/Classes/ContentObject/FlowPlayerContentObject.php
typo3/sysext/frontend/Classes/ContentObject/MediaContentObject.php
typo3/sysext/frontend/Classes/ContentObject/Menu/AbstractMenuContentObject.php
typo3/sysext/frontend/Classes/ContentObject/Menu/ImageMenuContentObject.php
typo3/sysext/frontend/Classes/ContentObject/Menu/JavaScriptMenuContentObject.php
typo3/sysext/frontend/Classes/ContentObject/OffsetTableContentObject.php
typo3/sysext/frontend/Classes/ContentObject/RecordsContentObject.php
typo3/sysext/frontend/Classes/ContentObject/SearchResultContentObject.php
typo3/sysext/frontend/Classes/Controller/DataSubmissionController.php
typo3/sysext/frontend/Classes/Controller/ShowImageController.php
typo3/sysext/frontend/Classes/Controller/TranslationStatusController.php
typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php
typo3/sysext/frontend/Classes/Imaging/GifBuilder.php
typo3/sysext/frontend/Classes/Page/PageGenerator.php
typo3/sysext/frontend/Classes/Page/PageRepository.php
typo3/sysext/frontend/Classes/Plugin/AbstractPlugin.php
typo3/sysext/impexp/Classes/Controller/ImportExportController.php
typo3/sysext/impexp/Classes/ImportExport.php
typo3/sysext/indexed_search/Classes/Controller/SearchController.php
typo3/sysext/indexed_search/Classes/Controller/SearchFormController.php
typo3/sysext/indexed_search/Classes/FileContentParser.php
typo3/sysext/indexed_search/Classes/Hook/CrawlerHook.php
typo3/sysext/indexed_search/Classes/Indexer.php
typo3/sysext/recordlist/Classes/Browser/ElementBrowser.php
typo3/sysext/rsaauth/Classes/Hook/UserSetupHook.php
typo3/sysext/rtehtmlarea/Classes/BrowseLinks.php
typo3/sysext/rtehtmlarea/Classes/Controller/FrontendRteController.php
typo3/sysext/rtehtmlarea/Classes/Controller/SpellCheckingController.php
typo3/sysext/rtehtmlarea/Classes/Extension/Acronym.php
typo3/sysext/rtehtmlarea/Classes/Extension/CopyPaste.php
typo3/sysext/rtehtmlarea/Classes/Extension/Typo3HtmlParser.php
typo3/sysext/rtehtmlarea/Classes/Hook/SoftReferenceHook.php
typo3/sysext/rtehtmlarea/Classes/RteHtmlAreaBase.php
typo3/sysext/rtehtmlarea/Classes/SelectImage.php
typo3/sysext/rtehtmlarea/Classes/User.php
typo3/sysext/rtehtmlarea/ext_localconf.php
typo3/sysext/scheduler/Classes/Controller/SchedulerModuleController.php
typo3/sysext/setup/Classes/Controller/SetupModuleController.php
typo3/sysext/sv/Classes/Report/ServicesListReport.php
typo3/sysext/sys_action/Classes/ActionTask.php
typo3/sysext/t3editor/Classes/Hook/TypoScriptTemplateInfoHook.php
typo3/sysext/taskcenter/Classes/Controller/TaskModuleController.php
typo3/sysext/workspaces/Classes/Service/WorkspaceService.php

index 561ac7d..d534c9f 100644 (file)
@@ -712,7 +712,7 @@ class ClickMenu {
         * @todo Define visibility
         */
        public function DB_changeFlag($table, $rec, $flagField, $title, $name, $iconRelPath = 'gfx/') {
-               $uid = $rec['_ORIG_uid'] ? $rec['_ORIG_uid'] : $rec['uid'];
+               $uid = $rec['_ORIG_uid'] ?: $rec['uid'];
                $editOnClick = '';
                $loc = 'top.content.list_frame';
                $editOnClick = 'if(' . $loc . '){' . $loc . '.location.href=top.TS.PATH_typo3+\'tce_db.php?redirect=\'' . '+top.rawurlencode(' . $this->frameLocation(($loc . '.document')) . '.pathname+' . $this->frameLocation(($loc . '.document')) . '.search)+\'' . '&data[' . $table . '][' . $uid . '][' . $flagField . ']=' . ($rec[$flagField] ? 0 : 1) . '&prErr=1&vC=' . $GLOBALS['BE_USER']->veriCode() . BackendUtility::getUrlToken('tceAction') . '\';}hideCM();top.nav.refresh.defer(500, top.nav);';
@@ -1267,7 +1267,7 @@ class ClickMenu {
                                }
                        }
                        $pointer = max(0, $pointer);
-                       $menuItemsBefore = array_slice($menuItems, 0, $pointer ? $pointer : 0);
+                       $menuItemsBefore = array_slice($menuItems, 0, $pointer ?: 0);
                        $menuItemsAfter = array_slice($menuItems, $pointer);
                        $menuItems = $menuItemsBefore + $newMenuItems + $menuItemsAfter;
                }
index efb75a2..8173371 100644 (file)
@@ -316,7 +316,7 @@ class BackendController {
                $icon = \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('status-user-' . ($GLOBALS['BE_USER']->isAdmin() ? 'admin' : 'backend'));
                $realName = $GLOBALS['BE_USER']->user['realName'];
                $username = $GLOBALS['BE_USER']->user['username'];
-               $label = $realName ? $realName : $username;
+               $label = $realName ?: $username;
                $title = $username;
                // Link to user setup if it's loaded and user has access
                $link = '';
index 0604f59..aa517a4 100644 (file)
@@ -392,7 +392,7 @@ class EditDocumentController {
                        $this->defVals = $this->overrideVals;
                }
                // Setting return URL
-               $this->retUrl = $this->returnUrl ? $this->returnUrl : 'dummy.php';
+               $this->retUrl = $this->returnUrl ?: 'dummy.php';
                // Fix $this->editconf if versioning applies to any of the records
                $this->fixWSversioningInEditConf();
                // Make R_URL (request url) based on input GETvars:
index 5aad233..dfff2b5 100644 (file)
@@ -185,7 +185,7 @@ class LoginController {
                }
                $GLOBALS['LANG']->includeLLFile('EXT:lang/locallang_login.xlf');
                // Setting the redirect URL to "backend.php" if no alternative input is given
-               $this->redirectToURL = $this->redirect_url ? $this->redirect_url : 'backend.php';
+               $this->redirectToURL = $this->redirect_url ?: 'backend.php';
                // Do a logout if the command is set
                if ($this->L == 'OUT' && is_object($GLOBALS['BE_USER'])) {
                        $GLOBALS['BE_USER']->logoff();
index 6b69a9b..033e169 100644 (file)
@@ -380,7 +380,7 @@ class NewRecordController {
                $rowContent = '';
                // New pages INSIDE this pages
                $newPageLinks = array();
-               if ($this->newPagesInto && $this->isTableAllowedForThisPage($this->pageinfo, 'pages') && $GLOBALS['BE_USER']->check('tables_modify', 'pages') && $GLOBALS['BE_USER']->workspaceCreateNewRecord(($this->pageinfo['_ORIG_uid'] ? $this->pageinfo['_ORIG_uid'] : $this->id), 'pages')) {
+               if ($this->newPagesInto && $this->isTableAllowedForThisPage($this->pageinfo, 'pages') && $GLOBALS['BE_USER']->check('tables_modify', 'pages') && $GLOBALS['BE_USER']->workspaceCreateNewRecord(($this->pageinfo['_ORIG_uid'] ?: $this->id), 'pages')) {
                        // Create link to new page inside:
                        $newPageLinks[] = $this->linkWrap(IconUtility::getSpriteIconForRecord($table, array()) . $GLOBALS['LANG']->sL($v['ctrl']['title'], TRUE) . ' (' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.xlf:db_new.php.inside', TRUE) . ')', $table, $this->id);
                }
@@ -657,8 +657,8 @@ class NewRecordController {
         * @todo Define visibility
         */
        public function showNewRecLink($table, array $allowedNewTables = array(), array $deniedNewTables = array()) {
-               $allowedNewTables = $allowedNewTables ? $allowedNewTables : $this->allowedNewTables;
-               $deniedNewTables = $deniedNewTables ? $deniedNewTables : $this->deniedNewTables;
+               $allowedNewTables = $allowedNewTables ?: $this->allowedNewTables;
+               $deniedNewTables = $deniedNewTables ?: $this->deniedNewTables;
                // No deny/allow tables are set:
                if (!count($allowedNewTables) && !count($deniedNewTables)) {
                        return TRUE;
index 9652488..686c384 100644 (file)
@@ -740,7 +740,7 @@ class PageLayoutController {
                        if ($uidVal == 'new') {
                                $new_unique_uid = uniqid('NEW');
                                $rec['uid'] = $new_unique_uid;
-                               $rec['pid'] = intval($ex_pid) ? intval($ex_pid) : $this->id;
+                               $rec['pid'] = intval($ex_pid) ?: $this->id;
                                $recordAccess = TRUE;
                        } else {
                                $rec['uid'] = $uidVal;
index a54cf4e..ff4e798 100644 (file)
@@ -582,7 +582,7 @@ class TableController {
                if (!$cols && trim($tLines[0])) {
                        $cols = count(explode($this->tableParsing_delimiter, $tLines[0]));
                }
-               $cols = $cols ? $cols : 4;
+               $cols = $cols ?: 4;
                // Traverse the number of table elements:
                $cfgArr = array();
                foreach ($tLines as $k => $v) {
index aa76cd2..6f4afdf 100644 (file)
@@ -802,7 +802,7 @@ class InlineElement {
                $foreign_selector = $conf['foreign_selector'];
                $PA = array();
                $PA['fieldConf'] = $GLOBALS['TCA'][$foreign_table]['columns'][$foreign_selector];
-               $PA['fieldConf']['config']['form_type'] = $PA['fieldConf']['config']['form_type'] ? $PA['fieldConf']['config']['form_type'] : $PA['fieldConf']['config']['type'];
+               $PA['fieldConf']['config']['form_type'] = $PA['fieldConf']['config']['form_type'] ?: $PA['fieldConf']['config']['type'];
                // Using "form_type" locally in this script
                $PA['fieldTSConfig'] = $this->fObj->setTSconfig($foreign_table, array(), $foreign_selector);
                $config = $PA['fieldConf']['config'];
@@ -2262,7 +2262,7 @@ class InlineElement {
                        if ($PA['fieldConf'] && $conf['foreign_selector_fieldTcaOverride']) {
                                \TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($PA['fieldConf'], $conf['foreign_selector_fieldTcaOverride']);
                        }
-                       $PA['fieldConf']['config']['form_type'] = $PA['fieldConf']['config']['form_type'] ? $PA['fieldConf']['config']['form_type'] : $PA['fieldConf']['config']['type'];
+                       $PA['fieldConf']['config']['form_type'] = $PA['fieldConf']['config']['form_type'] ?: $PA['fieldConf']['config']['type'];
                        // Using "form_type" locally in this script
                        $PA['fieldTSConfig'] = $this->fObj->setTSconfig($foreign_table, array(), $field);
                        $config = $PA['fieldConf']['config'];
@@ -2478,7 +2478,7 @@ class InlineElement {
         */
        protected function wrapWithAnchor($text, $link, $attributes = array()) {
                $link = trim($link);
-               $result = '<a href="' . ($link ? $link : '#') . '"';
+               $result = '<a href="' . ($link ?: '#') . '"';
                foreach ($attributes as $key => $value) {
                        $result .= ' ' . $key . '="' . htmlspecialchars(trim($value)) . '"';
                }
index cc12d88..fb7019c 100644 (file)
@@ -307,7 +307,7 @@ class SuggestDefaultReceiver {
         */
        protected function checkRecordAccess($row, $uid) {
                $retValue = TRUE;
-               $table = $this->mmForeignTable ? $this->mmForeignTable : $this->table;
+               $table = $this->mmForeignTable ?: $this->table;
                if ($table == 'pages') {
                        if (!BackendUtility::readPageAccess($uid, $GLOBALS['BE_USER']->getPagePermsClause(1))) {
                                $retValue = FALSE;
index 959d3a6..5ec6082 100644 (file)
@@ -277,7 +277,7 @@ class SuggestElement {
                        asort($rowsSort);
                        $rowsSort = array_keys($rowsSort);
                        // Limit the number of items in the result list
-                       $maxItems = $config['maxItemsInResultList'] ? $config['maxItemsInResultList'] : 10;
+                       $maxItems = $config['maxItemsInResultList'] ?: 10;
                        $maxItems = min(count($resultRows), $maxItems);
                        // put together the selector entry
                        for ($i = 0; $i < $maxItems; $i++) {
index 3f8c222..e8ceb3d 100644 (file)
@@ -67,8 +67,8 @@ class ValueSlider {
                        $max = isset($params['fieldConfig']['range']['upper']) ? intval($params['fieldConfig']['range']['upper']) : 10000;
                }
                $elementType = $params['fieldConfig']['type'];
-               $step = $params['wConf']['step'] ? $params['wConf']['step'] : 1;
-               $width = intval($params['wConf']['width']) ? intval($params['wConf']['width']) : 400;
+               $step = $params['wConf']['step'] ?: 1;
+               $width = intval($params['wConf']['width']) ?: 400;
                $type = 'null';
                if (isset($params['fieldConfig']['eval'])) {
                        $eval = GeneralUtility::trimExplode(',', $params['fieldConfig']['eval'], TRUE);
index 35b90b3..98bf123 100644 (file)
@@ -1020,7 +1020,7 @@ class FormEngine {
                $PA['pal'] = $pal;
                // Get the TCA configuration for the current field:
                $PA['fieldConf'] = $GLOBALS['TCA'][$table]['columns'][$field];
-               $PA['fieldConf']['config']['form_type'] = $PA['fieldConf']['config']['form_type'] ? $PA['fieldConf']['config']['form_type'] : $PA['fieldConf']['config']['type'];
+               $PA['fieldConf']['config']['form_type'] = $PA['fieldConf']['config']['form_type'] ?: $PA['fieldConf']['config']['type'];
 
                // Using "form_type" locally in this script
                $skipThisField = $this->inline->skipField($table, $field, $row, $PA['fieldConf']['config']);
@@ -1103,9 +1103,9 @@ class FormEngine {
                                        $PA['onFocus'] = $palJSfunc && !$GLOBALS['BE_USER']->uc['dontShowPalettesOnFocusInAB'] ? ' onfocus="' . htmlspecialchars($palJSfunc) . '"' : '';
                                        // Find item
                                        $item = '';
-                                       $PA['label'] = $PA['altName'] ? $PA['altName'] : $PA['fieldConf']['label'];
-                                       $PA['label'] = $PA['fieldTSConfig']['label'] ? $PA['fieldTSConfig']['label'] : $PA['label'];
-                                       $PA['label'] = $PA['fieldTSConfig']['label.'][$GLOBALS['LANG']->lang] ? $PA['fieldTSConfig']['label.'][$GLOBALS['LANG']->lang] : $PA['label'];
+                                       $PA['label'] = $PA['altName'] ?: $PA['fieldConf']['label'];
+                                       $PA['label'] = $PA['fieldTSConfig']['label'] ?: $PA['label'];
+                                       $PA['label'] = $PA['fieldTSConfig']['label.'][$GLOBALS['LANG']->lang] ?: $PA['label'];
                                        $PA['label'] = $this->sL($PA['label']);
                                        // JavaScript code for event handlers:
                                        $PA['fieldChangeFunc'] = array();
@@ -1222,7 +1222,7 @@ class FormEngine {
         * @todo Define visibility
         */
        public function getSingleField_SW($table, $field, $row, &$PA) {
-               $PA['fieldConf']['config']['form_type'] = $PA['fieldConf']['config']['form_type'] ? $PA['fieldConf']['config']['form_type'] : $PA['fieldConf']['config']['type'];
+               $PA['fieldConf']['config']['form_type'] = $PA['fieldConf']['config']['form_type'] ?: $PA['fieldConf']['config']['type'];
                // Using "form_type" locally in this script
                // Hook: getSingleField_beforeRender
                foreach ($this->hookObjectsSingleField as $hookObject) {
@@ -1396,7 +1396,7 @@ class FormEngine {
                if (isset($config['checkbox'])) {
                        $item .= IconUtility::getSpriteIcon('actions-input-clear', array('tag' => 'a', 'class' => 't3-tceforms-input-clearer', 'onclick' => 'document.getElementById(\'' . $inputId . '\').value=\'\';document.getElementById(\'' . $inputId . '\').focus();' . implode('', $PA['fieldChangeFunc'])));
                }
-               $mLgd = $config['max'] ? $config['max'] : 256;
+               $mLgd = $config['max'] ?: 256;
                $iOnChange = implode('', $PA['fieldChangeFunc']);
                $cssClasses[] = 'hasDefaultValue';
                $item .= '<input type="text" ' . $this->getPlaceholderAttribute($table, $field, $config, $row) . 'id="' . $inputId . '" ' . 'class="' . implode(' ', $cssClasses) . '" ' . 'name="' . $PA['itemFormElName'] . '_hr" ' . 'value=""' . 'style="' . $cssStyle . '" ' . 'maxlength="' . $mLgd . '" ' . 'onchange="' . htmlspecialchars($iOnChange) . '"' . $PA['onFocus'] . ' />';
@@ -1573,7 +1573,7 @@ TBE_EDITOR.customEvalFunctions[\'' . $evalData . '\'] = function(value) {
                                if ($specConf['nowrap']) {
                                        $wrap = 'off';
                                } else {
-                                       $wrap = $config['wrap'] ? $config['wrap'] : 'virtual';
+                                       $wrap = $config['wrap'] ?: 'virtual';
                                }
                                $classes = array();
                                if ($specConf['fixed-font']) {
old mode 100755 (executable)
new mode 100644 (file)
index 4acaee7..5bd675f
@@ -346,7 +346,7 @@ class RecordHistory {
                        $displayCode .= '<tr><td>' . $GLOBALS['LANG']->getLL($key, 1) . '</td>';
                        $displayCode .= '<td><select name="settings[' . $key . ']" onChange="document.settings.submit()" style="width:100px">';
                        foreach ($values as $singleKey => $singleVal) {
-                               $caption = $GLOBALS['LANG']->getLL($singleVal, 1) ? $GLOBALS['LANG']->getLL($singleVal, 1) : $singleVal;
+                               $caption = $GLOBALS['LANG']->getLL($singleVal, 1) ?: $singleVal;
                                $displayCode .= '<option value="' . $singleKey . '"' . ($singleKey == $currentSelection[$key] ? ' selected="selected"' : '') . '> ' . $caption . '</option>';
                        }
                        $displayCode .= '</select></td></tr>';
index 7575af6..387459f 100644 (file)
@@ -274,7 +274,9 @@ class BaseScriptClass {
         * @todo Define visibility
         */
        public function handleExternalFunctionValue($MM_key = 'function', $MS_value = NULL) {
-               $MS_value = is_null($MS_value) ? $this->MOD_SETTINGS[$MM_key] : $MS_value;
+               if ($MS_value === NULL) {
+                       $MS_value = $this->MOD_SETTINGS[$MM_key];
+               }
                $this->extClassConf = $this->getExternalItemConfig($this->MCONF['name'], $MM_key, $MS_value);
                if (is_array($this->extClassConf) && $this->extClassConf['path']) {
                        $this->include_once[] = $this->extClassConf['path'];
index b5a8028..2b1f36d 100644 (file)
@@ -135,7 +135,7 @@ class ElementBrowserRecordList extends \TYPO3\CMS\Recordlist\RecordList\Database
                                        if (!$filter['userFunc']) {
                                                continue;
                                        }
-                                       $parameters = $filter['parameters'] ? $filter['parameters'] : array();
+                                       $parameters = $filter['parameters'] ?: array();
                                        $parameters['values'] = array($table . '_' . $row['uid']);
                                        $parameters['tcaFieldConfig'] = $tcaFieldConfig;
                                        $valueArray = GeneralUtility::callUserFunction($filter['userFunc'], $parameters, $this);
index 9dabdec..ea8d767 100644 (file)
@@ -231,7 +231,7 @@ class ShortcutToolbarItem implements \TYPO3\CMS\Backend\Toolbar\ToolbarItemHookI
                        $moduleParts = explode('|', $row['module_name']);
                        $row['module_name'] = $moduleParts[0];
                        $row['M_module_name'] = $moduleParts[1];
-                       $moduleParts = explode('_', $row['M_module_name'] ? $row['M_module_name'] : $row['module_name']);
+                       $moduleParts = explode('_', $row['M_module_name'] ?: $row['module_name']);
                        $queryParts = parse_url($row['url']);
                        $queryParameters = GeneralUtility::explodeUrl2Array($queryParts['query'], 1);
                        if ($row['module_name'] == 'xMOD_alt_doc.php' && is_array($queryParameters['edit'])) {
index 460c601..9048540 100644 (file)
@@ -317,7 +317,7 @@ class Commands {
                $subNode->setType('pages');
                $subNode->setId($record['uid']);
                $subNode->setMountPoint($mountPoint);
-               $subNode->setWorkspaceId($record['_ORIG_uid'] ? $record['_ORIG_uid'] : $record['uid']);
+               $subNode->setWorkspaceId($record['_ORIG_uid'] ?: $record['uid']);
                $subNode->setBackgroundColor(self::$backgroundColors[$record['uid']]);
                $field = 'title';
                $text = $record['title'];
index 21efe75..24a9a33 100644 (file)
@@ -349,8 +349,8 @@ abstract class AbstractTreeView {
         * @todo Define visibility
         */
        public function setTreeName($treeName = '') {
-               $this->treeName = $treeName ? $treeName : $this->treeName;
-               $this->treeName = $this->treeName ? $this->treeName : $this->table;
+               $this->treeName = $treeName ?: $this->treeName;
+               $this->treeName = $this->treeName ?: $this->table;
                $this->treeName = str_replace('_', '', $this->treeName);
        }
 
@@ -791,7 +791,7 @@ abstract class AbstractTreeView {
                        // Accumulate the id of the element in the internal arrays
                        $this->ids[] = ($idH[$row['uid']]['uid'] = $row['uid']);
                        $this->ids_hierarchy[$depth][] = $row['uid'];
-                       $this->orig_ids_hierarchy[$depth][] = $row['_ORIG_uid'] ? $row['_ORIG_uid'] : $row['uid'];
+                       $this->orig_ids_hierarchy[$depth][] = $row['_ORIG_uid'] ?: $row['uid'];
                        // Make a recursive call to the next level
                        $HTML_depthData = $depthData . '<img' . IconUtility::skinImg($this->backPath, ('gfx/ol/' . $LN . '.gif'), 'width="18" height="16"') . ' alt="" />';
                        if ($depth > 1 && $this->expandNext($newID) && !$row['php_tree_stop']) {
index 7c0c3f2..bb4763a 100644 (file)
@@ -207,7 +207,7 @@ class FolderTreeView extends \TYPO3\CMS\Backend\Tree\View\AbstractTreeView {
         * @return string The title
         */
        public function getTitleStr($row, $titleLen = 30) {
-               return $row['_title'] ? $row['_title'] : parent::getTitleStr($row, $titleLen);
+               return $row['_title'] ?: parent::getTitleStr($row, $titleLen);
        }
 
        /**
index 79680ed..53eb885 100644 (file)
@@ -66,7 +66,7 @@ class BackendUtility {
         */
        static public function deleteClause($table, $tableAlias = '') {
                if ($GLOBALS['TCA'][$table]['ctrl']['delete']) {
-                       return ' AND ' . ($tableAlias ? $tableAlias : $table) . '.' . $GLOBALS['TCA'][$table]['ctrl']['delete'] . '=0';
+                       return ' AND ' . ($tableAlias ?: $table) . '.' . $GLOBALS['TCA'][$table]['ctrl']['delete'] . '=0';
                } else {
                        return '';
                }
@@ -933,7 +933,7 @@ class BackendUtility {
                                // Used to avoid looping, if any should happen.
                                $subFieldPointer = $conf['ds_pointerField_searchParent_subField'];
                                while (!$srcPointer) {
-                                       $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid,' . $ds_pointerField . ',' . $ds_searchParentField . ($subFieldPointer ? ',' . $subFieldPointer : ''), $table, 'uid=' . intval(($newRecordPidValue ? $newRecordPidValue : $rr[$ds_searchParentField])) . self::deleteClause($table));
+                                       $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('uid,' . $ds_pointerField . ',' . $ds_searchParentField . ($subFieldPointer ? ',' . $subFieldPointer : ''), $table, 'uid=' . intval($newRecordPidValue ?: $rr[$ds_searchParentField]) . self::deleteClause($table));
                                        $newRecordPidValue = 0;
                                        $rr = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
                                        $GLOBALS['TYPO3_DB']->sql_free_result($res);
@@ -1339,7 +1339,7 @@ class BackendUtility {
        static public function getListGroupNames($fields = 'title, uid') {
                $exQ = ' AND hide_in_lists=0';
                if (!$GLOBALS['BE_USER']->isAdmin()) {
-                       $exQ .= ' AND uid IN (' . ($GLOBALS['BE_USER']->user['usergroup_cached_list'] ? $GLOBALS['BE_USER']->user['usergroup_cached_list'] : 0) . ')';
+                       $exQ .= ' AND uid IN (' . ($GLOBALS['BE_USER']->user['usergroup_cached_list'] ?: 0) . ')';
                }
                return self::getGroupNames($fields, $exQ);
        }
@@ -2253,7 +2253,7 @@ class BackendUtility {
         * @return string File icon filename
         */
        static public function getFileIcon($ext) {
-               return $GLOBALS['FILEICONS'][$ext] ? $GLOBALS['FILEICONS'][$ext] : $GLOBALS['FILEICONS']['default'];
+               return $GLOBALS['FILEICONS'][$ext] ?: $GLOBALS['FILEICONS']['default'];
        }
 
        /**
index e69e5a4..57e112e 100644 (file)
@@ -179,7 +179,7 @@ class IconUtility {
                        }
                } else {
                        if (!($iconfile = $GLOBALS['TCA'][$table]['ctrl']['typeicons'][$row[$GLOBALS['TCA'][$table]['ctrl']['typeicon_column']]])) {
-                               $iconfile = $GLOBALS['TCA'][$table]['ctrl']['iconfile'] ? $GLOBALS['TCA'][$table]['ctrl']['iconfile'] : $table . '.gif';
+                               $iconfile = $GLOBALS['TCA'][$table]['ctrl']['iconfile'] ?: $table . '.gif';
                        }
                }
                // Setting path of iconfile if not already set. Default is "gfx/i/"
@@ -316,7 +316,7 @@ class IconUtility {
                        // Otherwise, test if auto-detection is enabled:
                        // Search for alternative icon automatically:
                        $fExt = $GLOBALS['TBE_STYLES']['skinImgAutoCfg']['forceFileExtension'];
-                       $scaleFactor = $GLOBALS['TBE_STYLES']['skinImgAutoCfg']['scaleFactor'] ? $GLOBALS['TBE_STYLES']['skinImgAutoCfg']['scaleFactor'] : 1;
+                       $scaleFactor = $GLOBALS['TBE_STYLES']['skinImgAutoCfg']['scaleFactor'] ?: 1;
                        // Scaling factor
                        $lookUpName = $fExt ? preg_replace('/\\.[[:alnum:]]+$/', '', $srcKey) . '.' . $fExt : $srcKey;
                        // Set filename to look for
index e2ae6b4..1b7d292 100644 (file)
@@ -78,7 +78,7 @@ class TranslateLabelSelectViewHelper extends \TYPO3\CMS\Fluid\ViewHelpers\Form\S
                }
                $labelKey = $this->hasArgument('optionLabelPrefix') ? $this->arguments['optionLabelPrefix'] . $label : $label;
                $translatedLabel = \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate($labelKey, $this->controllerContext->getRequest()->getControllerExtensionName());
-               return $translatedLabel ? $translatedLabel : $label;
+               return $translatedLabel ?: $label;
        }
 
 }
index f686583..67c1fb0 100755 (executable)
@@ -43,7 +43,7 @@ class IssueCommandViewHelper extends \TYPO3\CMS\Fluid\Core\ViewHelper\AbstractVi
         * @see template::issueCommand()
         */
        public function render($parameters, $redirectUrl = '') {
-               $redirectUrl = $redirectUrl ? $redirectUrl : \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('REQUEST_URI');
+               $redirectUrl = $redirectUrl ?: \TYPO3\CMS\Core\Utility\GeneralUtility::getIndpEnv('REQUEST_URI');
                return $GLOBALS['BACK_PATH'] . 'tce_db.php?' . $parameters . '&redirect=' . ($redirectUrl == '' ? '\' + T3_THIS_LOCATION + \'' : rawurlencode($redirectUrl)) . '&vC=' . rawurlencode($GLOBALS['BE_USER']->veriCode()) . \TYPO3\CMS\Backend\Utility\BackendUtility::getUrlToken('tceAction') . '&prErr=1&uPT=1';
        }
 
index 1b9e4a2..c3e82cf 100644 (file)
@@ -1284,7 +1284,7 @@ abstract class AbstractUserAuthentication {
         * @todo Define visibility
         */
        public function processLoginData($loginData, $passwordTransmissionStrategy = '') {
-               $passwordTransmissionStrategy = $passwordTransmissionStrategy ? $passwordTransmissionStrategy : ($GLOBALS['TYPO3_CONF_VARS'][$this->loginType]['loginSecurityLevel'] ? trim($GLOBALS['TYPO3_CONF_VARS'][$this->loginType]['loginSecurityLevel']) : $this->security_level);
+               $passwordTransmissionStrategy = $passwordTransmissionStrategy ?: ($GLOBALS['TYPO3_CONF_VARS'][$this->loginType]['loginSecurityLevel'] ? trim($GLOBALS['TYPO3_CONF_VARS'][$this->loginType]['loginSecurityLevel']) : $this->security_level);
                if ($this->writeDevLog) {
                        GeneralUtility::devLog('Login data before processing: ' . GeneralUtility::arrayToLogString($loginData), 'TYPO3\\CMS\\Core\\Authentication\\AbstractUserAuthentication');
                }
@@ -1363,7 +1363,7 @@ abstract class AbstractUserAuthentication {
         */
        public function compareUident($user, $loginData, $passwordCompareStrategy = '') {
                $OK = FALSE;
-               $passwordCompareStrategy = $passwordCompareStrategy ? $passwordCompareStrategy : $this->security_level;
+               $passwordCompareStrategy = $passwordCompareStrategy ?: $this->security_level;
                switch ($passwordCompareStrategy) {
                        case 'superchallenged':
 
index 22c9edd..9729fdb 100644 (file)
@@ -1800,7 +1800,7 @@ class BackendUserAuthentication extends \TYPO3\CMS\Core\Authentication\AbstractU
                                // We now have a path with slash after and slash before (if unix)
                                if (@is_dir($path) && ($GLOBALS['TYPO3_CONF_VARS']['BE']['lockRootPath'] && GeneralUtility::isFirstPartOfStr($path, $GLOBALS['TYPO3_CONF_VARS']['BE']['lockRootPath']) || GeneralUtility::isFirstPartOfStr($path, $fdir))) {
                                        // Alternative title?
-                                       $name = $title ? $title : $altTitle;
+                                       $name = $title ?: $altTitle;
                                        // Adds the filemount. The same filemount with same name, type and path cannot be set up twice because of the hash string used as key.
                                        $this->groupData['filemounts'][md5($name . '|' . $path . '|' . $type)] = array('name' => $name, 'path' => $path, 'type' => $type);
                                        // Return TRUE - went well, success!
index bb73692..b46cd68 100644 (file)
@@ -671,9 +671,9 @@ class CharsetConverter {
                        $script = $this->lang_to_script[$language];
                }
                if (TYPO3_OS == 'WIN') {
-                       $cs = $this->script_to_charset_windows[$script] ? $this->script_to_charset_windows[$script] : 'windows-1252';
+                       $cs = $this->script_to_charset_windows[$script] ?: 'windows-1252';
                } else {
-                       $cs = $this->script_to_charset_unix[$script] ? $this->script_to_charset_unix[$script] : 'utf-8';
+                       $cs = $this->script_to_charset_unix[$script] ?: 'utf-8';
                }
                return $cs;
        }
index 0e596eb..067d5c6 100644 (file)
@@ -1315,7 +1315,7 @@ class DataHandler {
                        BackendUtility::fixVersioningPid($table, $currentRecord);
                        // Get original language record if available:
                        if (is_array($currentRecord) && $GLOBALS['TCA'][$table]['ctrl']['transOrigDiffSourceField'] && $GLOBALS['TCA'][$table]['ctrl']['languageField'] && $currentRecord[$GLOBALS['TCA'][$table]['ctrl']['languageField']] > 0 && $GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField'] && intval($currentRecord[$GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField']]) > 0) {
-                               $lookUpTable = $GLOBALS['TCA'][$table]['ctrl']['transOrigPointerTable'] ? $GLOBALS['TCA'][$table]['ctrl']['transOrigPointerTable'] : $table;
+                               $lookUpTable = $GLOBALS['TCA'][$table]['ctrl']['transOrigPointerTable'] ?: $table;
                                $originalLanguageRecord = $this->recordInfo($lookUpTable, $currentRecord[$GLOBALS['TCA'][$table]['ctrl']['transOrigPointerField']], '*');
                                BackendUtility::workspaceOL($lookUpTable, $originalLanguageRecord);
                                $originalLanguage_diffStorage = unserialize($currentRecord[$GLOBALS['TCA'][$table]['ctrl']['transOrigDiffSourceField']]);
@@ -1839,7 +1839,7 @@ class DataHandler {
                        if (empty($filter['userFunc'])) {
                                continue;
                        }
-                       $parameters = $filter['parameters'] ? $filter['parameters'] : array();
+                       $parameters = $filter['parameters'] ?: array();
                        $parameters['values'] = $values;
                        $parameters['tcaFieldConfig'] = $tcaFieldConfiguration;
                        $values = GeneralUtility::callUserFunction($filter['userFunc'], $parameters, $this);
@@ -1890,7 +1890,7 @@ class DataHandler {
                        // Setting permitted extensions.
                        $all_files = array();
                        $all_files['webspace']['allow'] = $tcaFieldConf['allowed'];
-                       $all_files['webspace']['deny'] = $tcaFieldConf['disallowed'] ? $tcaFieldConf['disallowed'] : '*';
+                       $all_files['webspace']['deny'] = $tcaFieldConf['disallowed'] ?: '*';
                        $all_files['ftpspace'] = $all_files['webspace'];
                        $this->fileFunc->init('', $all_files);
                }
@@ -4685,7 +4685,7 @@ class DataHandler {
                                                                $overrideArray = array(
                                                                        't3ver_id' => $highestVerNumber + 1,
                                                                        't3ver_oid' => $id,
-                                                                       't3ver_label' => $label ? $label : $subVer . ' / ' . date('d-m-Y H:m:s'),
+                                                                       't3ver_label' => $label ?: $subVer . ' / ' . date('d-m-Y H:m:s'),
                                                                        't3ver_wsid' => $this->BE_USER->workspace,
                                                                        't3ver_state' => (string)($delete ? new VersionState(VersionState::DELETE_PLACEHOLDER) : new VersionState(VersionState::DEFAULT_STATE)),
                                                                        't3ver_count' => 0,
index ef8b96d..7be2063 100644 (file)
@@ -339,7 +339,7 @@ class DatabaseConnection {
                $mmWhere .= ($local_table and $foreign_table) ? ' AND ' : '';
                $tables = ($local_table ? $local_table . ',' : '') . $mm_table;
                if ($foreign_table) {
-                       $mmWhere .= ($foreign_table_as ? $foreign_table_as : $foreign_table) . '.uid=' . $mm_table . '.uid_foreign';
+                       $mmWhere .= ($foreign_table_as ?: $foreign_table) . '.uid=' . $mm_table . '.uid_foreign';
                        $tables .= ',' . $foreign_table . ($foreign_table_as ? ' AS ' . $foreign_table_as : '');
                }
                return $this->exec_SELECTquery($select, $tables, $mmWhere . ' ' . $whereClause, $groupBy, $orderBy, $limit);
index cfad56d..8b83401 100644 (file)
@@ -1231,7 +1231,7 @@ class QueryGenerator {
                $prefix = $this->enablePrefix ? $this->table . '.' : '';
                if (!$first) {
                        // Is it OK to insert the AND operator if none is set?
-                       $qs .= trim(($conf['operator'] ? $conf['operator'] : 'AND')) . ' ';
+                       $qs .= trim(($conf['operator'] ?: 'AND')) . ' ';
                }
                $qsTmp = str_replace('#FIELD#', $prefix . trim(substr($conf['type'], 6)), $this->compSQL[$conf['comparison']]);
                $inputVal = $this->cleanInputVal($conf);
index f82d7e5..8e9a40e 100644 (file)
@@ -475,7 +475,7 @@ class RelationHandler {
                        // Default
                        if (!$this->MM_is_foreign) {
                                // If tablesnames columns exists and contain a name, then this value is the table, else it's the firstTable...
-                               $theTable = $row['tablenames'] ? $row['tablenames'] : $this->firstTable;
+                               $theTable = $row['tablenames'] ?: $this->firstTable;
                        }
                        if (($row[$uidForeign_field] || $theTable == 'pages') && $theTable && isset($this->tableArray[$theTable])) {
                                $this->itemArray[$key]['id'] = $row[$uidForeign_field];
index 0f4a603..dd44230 100644 (file)
@@ -1524,7 +1524,7 @@ class SqlParser {
                $orderBy = $this->compileFieldList($components['ORDERBY']);
                $limit = $components['LIMIT'];
                // Make query:
-               $query = 'SELECT ' . ($components['STRAIGHT_JOIN'] ? $components['STRAIGHT_JOIN'] . '' : '') . '
+               $query = 'SELECT ' . ($components['STRAIGHT_JOIN'] ?: '') . '
                                ' . $this->compileFieldList($components['SELECT']) . '
                                FROM ' . $this->compileFromTables($components['FROM']) . (strlen($where) ? '
                                WHERE ' . $where : '') . (strlen($groupBy) ? '
@@ -1653,7 +1653,7 @@ class SqlParser {
         */
        protected function compileALTERTABLE($components) {
                // Make query:
-               $query = 'ALTER TABLE ' . $components['TABLE'] . ' ' . $components['action'] . ' ' . ($components['FIELD'] ? $components['FIELD'] : $components['KEY']);
+               $query = 'ALTER TABLE ' . $components['TABLE'] . ' ' . $components['action'] . ' ' . ($components['FIELD'] ?: $components['KEY']);
                // Based on action, add the final part:
                switch (strtoupper(str_replace(array(' ', TAB, CR, LF), '', $components['action']))) {
                        case 'ADD':
index 8e6580a..8102ada 100644 (file)
@@ -54,7 +54,7 @@ class StatusException extends \TYPO3\CMS\Core\Error\Exception {
                } else {
                        $this->statusHeaders = array($statusHeaders);
                }
-               $this->title = $title ? $title : $this->title;
+               $this->title = $title ?: $this->title;
                parent::__construct($message, $code);
        }
 
index ea92fb3..e9e0888 100644 (file)
@@ -135,7 +135,7 @@ class FrontendEditingController {
                        // If the table is set as the first parameter, and does not match the table of the current record, then just return.
                        return $content;
                }
-               $editUid = $dataArray['_LOCALIZED_UID'] ? $dataArray['_LOCALIZED_UID'] : $currentRecordUID;
+               $editUid = $dataArray['_LOCALIZED_UID'] ?: $currentRecordUID;
                // Edit icons imply that the editing action is generally allowed, assuming page and content element permissions permit it.
                if (!array_key_exists('allow', $conf)) {
                        $conf['allow'] = 'edit';
index 2c3243f..97b38f1 100644 (file)
@@ -1283,9 +1283,9 @@ class HtmlParser {
                                        $attr .= '="' . htmlspecialchars($v) . '"';
                                }
                        } else {
-                               $attr = $meta[$k]['origTag'] ? $meta[$k]['origTag'] : $k;
-                               if ((string)$v !== '' || isset($meta[$k]['dashType'])) {
-                                       $dash = $meta[$k]['dashType'] ? $meta[$k]['dashType'] : (\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($v) ? '' : '"');
+                               $attr = $meta[$k]['origTag'] ?: $k;
+                               if (strcmp($v, '') || isset($meta[$k]['dashType'])) {
+                                       $dash = $meta[$k]['dashType'] ?: (\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($v) ? '' : '"');
                                        $attr .= '=' . $dash . $v . $dash;
                                }
                        }
@@ -1552,4 +1552,4 @@ class HtmlParser {
                return $value;
        }
 
-}
+}
\ No newline at end of file
index a7eb91a..2f6df42 100644 (file)
@@ -79,10 +79,10 @@ class HttpRequest extends \HTTP_Request2 {
                        'ssl_verify_peer' => (bool) $GLOBALS['TYPO3_CONF_VARS']['HTTP']['ssl_verify_peer'],
                        'ssl_verify_host' => (bool) $GLOBALS['TYPO3_CONF_VARS']['HTTP']['ssl_verify_host'],
                        // we have to deal with Install Tool limitations and set this to NULL if it is empty
-                       'ssl_cafile' => empty($GLOBALS['TYPO3_CONF_VARS']['HTTP']['ssl_cafile']) ? NULL : $GLOBALS['TYPO3_CONF_VARS']['HTTP']['ssl_cafile'],
-                       'ssl_capath' => empty($GLOBALS['TYPO3_CONF_VARS']['HTTP']['ssl_capath']) ? NULL : $GLOBALS['TYPO3_CONF_VARS']['HTTP']['ssl_capath'],
-                       'ssl_local_cert' => empty($GLOBALS['TYPO3_CONF_VARS']['HTTP']['ssl_local_cert']) ? NULL : $GLOBALS['TYPO3_CONF_VARS']['HTTP']['ssl_local_cert'],
-                       'ssl_passphrase' => empty($GLOBALS['TYPO3_CONF_VARS']['HTTP']['ssl_passphrase']) ? NULL : $GLOBALS['TYPO3_CONF_VARS']['HTTP']['ssl_passphrase']
+                       'ssl_cafile' => $GLOBALS['TYPO3_CONF_VARS']['HTTP']['ssl_cafile'] ?: NULL,
+                       'ssl_capath' => $GLOBALS['TYPO3_CONF_VARS']['HTTP']['ssl_capath'] ?: NULL,
+                       'ssl_local_cert' => $GLOBALS['TYPO3_CONF_VARS']['HTTP']['ssl_local_cert'] ?: NULL,
+                       'ssl_passphrase' => $GLOBALS['TYPO3_CONF_VARS']['HTTP']['ssl_passphrase'] ?: NULL
                );
                $configuration = array_merge($default, $config);
                $this->setConfig($configuration);
index c3617bc..3b8e08e 100644 (file)
@@ -1210,7 +1210,7 @@ class GraphicalFunctions {
        public function calcWordSpacing($conf, $scaleFactor = 1) {
                $spacing = intval($conf['spacing']);
                $wordSpacing = intval($conf['wordSpacing']);
-               $wordSpacing = $wordSpacing ? $wordSpacing : $spacing * 2;
+               $wordSpacing = $wordSpacing ?: $spacing * 2;
                $spacing *= $scaleFactor;
                $wordSpacing *= $scaleFactor;
                return array($spacing, $wordSpacing);
index c89a6d5..2ce7fc9 100644 (file)
@@ -209,7 +209,7 @@ class LocallangArrayParser implements \TYPO3\CMS\Core\Localization\Parser\Locali
         * @return void
         */
        protected function setCharsets($languageKey, $charset) {
-               $this->sourceCharset = $this->csConvObj->parse_charset($this->csConvObj->charSetArray[$languageKey] ? $this->csConvObj->charSetArray[$languageKey] : 'utf-8');
+               $this->sourceCharset = $this->csConvObj->parse_charset($this->csConvObj->charSetArray[$languageKey] ?: 'utf-8');
                if ($charset) {
                        $this->targetCharset = $this->csConvObj->parse_charset($charset);
                } else {
index eb5436d..5d49771 100644 (file)
@@ -187,7 +187,7 @@ class LogManager implements \TYPO3\CMS\Core\SingletonInterface {
                // for these keys, for example "writerConfiguration"
                $configurationKey = $configurationType . 'Configuration';
                $configuration = $GLOBALS['TYPO3_CONF_VARS']['LOG'];
-               $result = !empty($configuration[$configurationKey]) ? $configuration[$configurationKey] : array();
+               $result = $configuration[$configurationKey] ?: array();
                // Walk from general to special (t3lib, t3lib.db, t3lib.db.foo)
                // and search for the most specific configuration
                foreach ($explodedName as $partOfClassName) {
index 8265f1a..fe4f286 100644 (file)
@@ -100,7 +100,7 @@ class Mailer extends \Swift_Mailer {
                                if ($port === NULL || $port === '') {
                                        $port = '25';
                                }
-                               $useEncryption = $this->mailSettings['transport_smtp_encrypt'] ? $this->mailSettings['transport_smtp_encrypt'] : NULL;
+                               $useEncryption = $this->mailSettings['transport_smtp_encrypt'] ?: NULL;
                                // Create our transport
                                $this->transport = \Swift_SmtpTransport::newInstance($host, $port, $useEncryption);
                                // Need authentication?
index d42351d..8f8e546 100644 (file)
@@ -142,8 +142,8 @@ class ProcessedFile extends AbstractFile {
         * @return ProcessedFile
         */
        protected function reconstituteFromDatabaseRecord(array $databaseRow) {
-               $this->taskType = empty($this->taskType) ? $databaseRow['task_type'] : $this->taskType;
-               $this->processingConfiguration = empty($this->processingConfiguration) ? unserialize($databaseRow['configuration']) : $this->processingConfiguration;
+               $this->taskType = $this->taskType ?: $databaseRow['task_type'];
+               $this->processingConfiguration = $this->processingConfiguration ?: unserialize($databaseRow['configuration']);
 
                $this->originalFileSha1 = $databaseRow['originalfilesha1'];
                $this->identifier = $databaseRow['identifier'];
index 7eafa12..4fab0f5 100644 (file)
@@ -1789,7 +1789,7 @@ class ResourceStorage {
                // TODO implement the $conflictMode handling
                $this->assureFolderCopyPermissions($folderToCopy, $targetParentFolder);
                $returnObject = NULL;
-               $newFolderName = $newFolderName ? $newFolderName : $folderToCopy->getName();
+               $newFolderName = $newFolderName ?: $folderToCopy->getName();
                $this->emitPreFolderCopySignal($folderToCopy, $targetParentFolder, $newFolderName);
                $sourceStorage = $folderToCopy->getStorage();
                // call driver method to move the file
index ad8e1e9..a29c13e 100644 (file)
@@ -130,7 +130,7 @@ class StorageRepository extends AbstractRepository {
                $res = $this->db->exec_SELECTquery(
                        '*',
                        $this->table,
-                       ($whereClause ? $whereClause : '1=1') . $this->getWhereClauseForEnabledFields()
+                       ($whereClause ?: '1=1') . $this->getWhereClauseForEnabledFields()
                );
 
                /** @var $driverRegistry Driver\DriverRegistry */
index f1245fc..b83572b 100644 (file)
@@ -148,7 +148,7 @@ class ConfigurationForm extends \TYPO3\CMS\Core\TypoScript\ExtendedTemplateServi
                        }
                ');
                if ($addFormTag) {
-                       $content .= '<form action="' . htmlspecialchars(($script ? $script : \TYPO3\CMS\Core\Utility\GeneralUtility::linkThisScript())) . '" name="' . $this->ext_CEformName . '" method="post" enctype="' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['form_enctype'] . '">';
+                       $content .= '<form action="' . htmlspecialchars(($script ?: \TYPO3\CMS\Core\Utility\GeneralUtility::linkThisScript())) . '" name="' . $this->ext_CEformName . '" method="post" enctype="' . $GLOBALS['TYPO3_CONF_VARS']['SYS']['form_enctype'] . '">';
                }
                $content .= $addFields;
                $content .= $printFields;
index b4efd75..006722b 100644 (file)
@@ -690,8 +690,8 @@ class ExtendedTemplateService extends \TYPO3\CMS\Core\TypoScript\TemplateService
                                                        <td align="center">' . ($row['root'] ? \TYPO3\CMS\Backend\Utility\IconUtility::getSpriteIcon('status-status-checked') : '') . '&nbsp;&nbsp;</td>
                                                        <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">' . ((string)$RL !== '' ? $RL : '') . '</td>
+                                                       <td align="center">' . ($row['pid'] ?: '') . '</td>
+                                                       <td align="center">' . (strcmp($RL, '') ? $RL : '') . '</td>
                                                        <td>' . ($row['next'] ? '&nbsp;' . $row['next'] . '&nbsp;&nbsp;' : '') . '</td>
                                                </tr>';
                        if ($deeper) {
@@ -1603,4 +1603,4 @@ class ExtendedTemplateService extends \TYPO3\CMS\Core\TypoScript\TemplateService
                }
        }
 
-}
+}
\ No newline at end of file
index f076378..a39a94d 100644 (file)
@@ -1301,7 +1301,7 @@ class TemplateService {
         * @todo Define visibility
         */
        public function printTitle($pageTitle, $noTitle = FALSE, $showTitleFirst = FALSE) {
-               $siteTitle = trim($this->setup['sitetitle']) ? $this->setup['sitetitle'] : '';
+               $siteTitle = trim($this->setup['sitetitle']);
                $pageTitle = $noTitle ? '' : $pageTitle;
                $pageTitleSeparator = '';
                if ($showTitleFirst) {
@@ -1469,7 +1469,7 @@ class TemplateService {
                        $LD['url'] = $script . '?id=' . $page['uid'];
                }
                // Setting target
-               $LD['target'] = trim($page['target']) ? trim($page['target']) : $oTarget;
+               $LD['target'] = trim($page['target']) ?: $oTarget;
                // typeNum
                $typeNum = $this->setup[$LD['target'] . '.']['typeNum'];
                if (!\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($typeOverride) && intval($GLOBALS['TSFE']->config['config']['forceTypeValue'])) {
index d64028e..ff561b7 100644 (file)
@@ -386,7 +386,7 @@ class CommandUtility {
 
                        // Image magick paths first
                        // im_path_lzw take precedence over im_path
-               if (($imPath = ($GLOBALS['TYPO3_CONF_VARS']['GFX']['im_path_lzw'] ? $GLOBALS['TYPO3_CONF_VARS']['GFX']['im_path_lzw'] : $GLOBALS['TYPO3_CONF_VARS']['GFX']['im_path']))) {
+               if (($imPath = ($GLOBALS['TYPO3_CONF_VARS']['GFX']['im_path_lzw'] ?: $GLOBALS['TYPO3_CONF_VARS']['GFX']['im_path']))) {
                        $imPath = self::fixPath($imPath);
                        $pathsArr[$imPath] = $imPath;
                }
index 92285c6..6e9ab60 100644 (file)
@@ -144,7 +144,7 @@ class BasicFileUtility {
                $this->mounts = $mounts;
                $this->webPath = GeneralUtility::getIndpEnv('TYPO3_DOCUMENT_ROOT');
                $this->isInit = 1;
-               $this->maxInputNameLen = $GLOBALS['TYPO3_CONF_VARS']['SYS']['maxFileNameLength'] ? $GLOBALS['TYPO3_CONF_VARS']['SYS']['maxFileNameLength'] : $this->maxInputNameLen;
+               $this->maxInputNameLen = $GLOBALS['TYPO3_CONF_VARS']['SYS']['maxFileNameLength'] ?: $this->maxInputNameLen;
        }
 
        /**
index 4f0e878..7fde70b 100644 (file)
@@ -2032,7 +2032,7 @@ class GeneralUtility {
         */
        static public function array2xml_cs(array $array, $docTag = 'phparray', array $options = array(), $charset = '') {
                // Set default charset unless explicitly specified
-               $charset = $charset ? $charset : 'utf-8';
+               $charset = $charset ?: 'utf-8';
                // Return XML:
                return '<?xml version="1.0" encoding="' . htmlspecialchars($charset) . '" standalone="yes" ?>' . LF . self::array2xml($array, '', 0, $docTag, 0, $options);
        }
@@ -2097,7 +2097,7 @@ class GeneralUtility {
                                } else {
                                        // Use special tag for num. keys:
                                        $attr .= ' index="' . $tagName . '"';
-                                       $tagName = $options['useIndexTagForNum'] ? $options['useIndexTagForNum'] : 'numIndex';
+                                       $tagName = $options['useIndexTagForNum'] ?: 'numIndex';
                                }
                        } elseif ($options['useIndexTagForAssoc']) {
                                // Use tag for all associative keys:
@@ -2211,7 +2211,7 @@ class GeneralUtility {
                // Default output charset is UTF-8, only ASCII, ISO-8859-1 and UTF-8 are supported!!!
                $match = array();
                preg_match('/^[[:space:]]*<\\?xml[^>]*encoding[[:space:]]*=[[:space:]]*"([^"]*)"/', substr($string, 0, 200), $match);
-               $theCharset = $match[1] ? $match[1] : 'utf-8';
+               $theCharset = $match[1] ?: 'utf-8';
                // us-ascii / utf-8 / iso-8859-1
                xml_parser_set_option($parser, XML_OPTION_TARGET_ENCODING, $theCharset);
                // Parse content:
@@ -2483,8 +2483,8 @@ class GeneralUtility {
                        $fp = @fsockopen(($scheme . $parsedURL['host']), $port, $errno, $errstr, 2.0);
                        if (!$fp || $errno > 0) {
                                if (isset($report)) {
-                                       $report['error'] = $errno ? $errno : -1;
-                                       $report['message'] = $errno ? ($errstr ? $errstr : 'Socket error.') : 'Socket initialization error.';
+                                       $report['error'] = $errno ?: -1;
+                                       $report['message'] = $errno ? ($errstr ?: 'Socket error.') : 'Socket initialization error.';
                                }
                                return FALSE;
                        }
index 080c20e..97bc907 100644 (file)
@@ -39,7 +39,7 @@ class RecordTest extends \TYPO3\CMS\Core\Tests\UnitTestCase {
         */
        protected function getRecord(array $parameters = array()) {
                /** @var $record \TYPO3\CMS\Core\Log\LogRecord */
-               $record = new \TYPO3\CMS\Core\Log\LogRecord(!empty($parameters['component']) ? $parameters['component'] : 'test.core.log', !empty($parameters['level']) ? $parameters['level'] : \TYPO3\CMS\Core\Log\LogLevel::DEBUG, !empty($parameters['message']) ? $parameters['message'] : 'test message', !empty($parameters['data']) ? $parameters['data'] : array());
+               $record = new \TYPO3\CMS\Core\Log\LogRecord($parameters['component'] ?: 'test.core.log', $parameters['level'] ?: \TYPO3\CMS\Core\Log\LogLevel::DEBUG, $parameters['message'] ?: 'test message', $parameters['data'] ?: array());
                return $record;
        }
 
index 31b2265..4c58f6d 100644 (file)
@@ -657,7 +657,7 @@ class HelpModuleController {
                                                foreach ($GLOBALS['TCA_DESCR'][$cshKey]['columns'] as $field => $data) {
                                                        if ($field) {
                                                                $this->glossaryWords[$cshKey . '.' . $field] = array(
-                                                                       'title' => trim($data['alttitle'] ? $data['alttitle'] : $cshKey),
+                                                                       'title' => trim($data['alttitle'] ?: $cshKey),
                                                                        'description' => str_replace('%22', '%23%23%23', rawurlencode($data['description']))
                                                                );
                                                        }
index 871a9c9..e0ac54b 100644 (file)
@@ -250,7 +250,7 @@ class CssStyledContentController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlug
                                list($path) = explode('|', $filePathConf);
                        } else {
                                // Get the list of files from the field
-                               $field = trim($conf['field']) ? trim($conf['field']) : 'media';
+                               $field = trim($conf['field']) ?: 'media';
                                $fileList = $this->cObj->data[$field];
                                $path = 'uploads/media/';
                                if (
@@ -416,7 +416,7 @@ class CssStyledContentController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlug
                                }
                        }
                }
-               return $relations ? $relations : $equalRelations;
+               return $relations ?: $equalRelations;
        }
 
        /**
@@ -529,7 +529,7 @@ class CssStyledContentController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlug
                $colspacing = intval($this->cObj->stdWrap($conf['colSpace'], $conf['colSpace.']));
                $border = intval($this->cObj->stdWrap($conf['border'], $conf['border.'])) ? 1 : 0;
                $borderThickness = intval($this->cObj->stdWrap($conf['borderThick'], $conf['borderThick.']));
-               $borderThickness = $borderThickness ? $borderThickness : 1;
+               $borderThickness = $borderThickness ?: 1;
                $borderSpace = $conf['borderSpace'] && $border ? intval($conf['borderSpace']) : 0;
                // Generate cols
                $cols = intval($this->cObj->stdWrap($conf['cols'], $conf['cols.']));
@@ -891,7 +891,7 @@ class CssStyledContentController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlug
                        }
                        // Add the border class if needed
                        if ($border) {
-                               $classes[] = $conf['borderClass'] ? $conf['borderClass'] : 'csc-textpic-border';
+                               $classes[] = $conf['borderClass'] ?: 'csc-textpic-border';
                        }
                        // Add the class for equal height if needed
                        if ($equalHeight) {
@@ -1006,7 +1006,7 @@ class CssStyledContentController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlug
                        }
                        $borderClass = '';
                        if ($border) {
-                               $borderClass = $conf['borderClass'] ? $conf['borderClass'] : 'csc-textpic-border';
+                               $borderClass = $conf['borderClass'] ?: 'csc-textpic-border';
                        }
                        // Multiple classes with all properties, to be styled in CSS
                        $class = '';
index dec11e6..8e690a7 100644 (file)
@@ -111,7 +111,7 @@ class ConfigurationItemRepository {
                        $configurationOption['label'] = \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate($configurationOption['label'], $extensionKey);
                }
                $configurationOption['labels'] = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode(':', $configurationOption['label'], FALSE, 2);
-               $configurationOption['subcat_name'] = $configurationOption['subcat_name'] ? $configurationOption['subcat_name'] : '__default';
+               $configurationOption['subcat_name'] = $configurationOption['subcat_name'] ?: '__default';
                $hierarchicConfiguration[$configurationOption['cat']][$configurationOption['subcat_name']][$configurationOption['name']] = $configurationOption;
                return $hierarchicConfiguration;
        }
@@ -160,7 +160,7 @@ class ConfigurationItemRepository {
         * @return array
         */
        protected function addMetaInformation(&$configuration) {
-               $metaInformation = $configuration['__meta__'] ? $configuration['__meta__'] : array();
+               $metaInformation = $configuration['__meta__'] ?: array();
                unset($configuration['__meta__']);
                return $metaInformation;
        }
index a3d23f1..05e0c94 100644 (file)
@@ -191,12 +191,12 @@ class ExtensionListUtility implements \SplObserver {
                        intval($subject->getLastuploaddate()),
                        $subject->getT3xfilemd5(),
                        $this->repositoryUid,
-                       $this->extensionModel->getDefaultState($subject->getState() ? $subject->getState() : ''),
+                       $this->extensionModel->getDefaultState($subject->getState() ?: ''),
                        intval($subject->getReviewstate()),
-                       $this->extensionModel->getCategoryIndexFromStringOrNumber($subject->getCategory() ? $subject->getCategory() : ''),
-                       $subject->getDescription() ? $subject->getDescription() : '',
-                       $subject->getDependencies() ? $subject->getDependencies() : '',
-                       $subject->getUploadcomment() ? $subject->getUploadcomment() : ''
+                       $this->extensionModel->getCategoryIndexFromStringOrNumber($subject->getCategory() ?: ''),
+                       $subject->getDescription() ?: '',
+                       $subject->getDependencies() ?: '',
+                       $subject->getUploadcomment() ?: ''
                );
                ++$this->sumRecords;
        }
index ab35546..44acaf3 100644 (file)
@@ -152,7 +152,7 @@ class FrontendLoginController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin
                }
                $this->redirectUrl = $this->validateRedirectUrl($this->redirectUrl);
                // Get Template
-               $templateFile = $this->conf['templateFile'] ? $this->conf['templateFile'] : 'EXT:felogin/template.html';
+               $templateFile = $this->conf['templateFile'] ?: 'EXT:felogin/template.html';
                $this->template = $this->cObj->fileResource($templateFile);
                // Is user logged in?
                $this->userIsLoggedIn = $GLOBALS['TSFE']->loginUser;
@@ -294,7 +294,7 @@ class FrontendLoginController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin
        protected function changePassword() {
                $subpartArray = ($linkpartArray = array());
                $done = FALSE;
-               $minLength = intval($this->conf['newPasswordMinLength']) ? intval($this->conf['newPasswordMinLength']) : 6;
+               $minLength = intval($this->conf['newPasswordMinLength']) ?: 6;
                $subpart = $this->cObj->getSubpart($this->template, '###TEMPLATE_CHANGEPASSWORD###');
                $markerArray['###STATUS_HEADER###'] = $this->getDisplayText('change_password_header', $this->conf['changePasswordHeader_stdWrap.']);
                $markerArray['###STATUS_MESSAGE###'] = sprintf($this->getDisplayText(
index 6696b25..acd4528 100644 (file)
@@ -326,7 +326,7 @@ class FrontendUserAuthentication extends \TYPO3\CMS\Core\Authentication\Abstract
                        ksort($this->groupData['uid']);
                        ksort($this->groupData['pid']);
                }
-               return count($this->groupData['uid']) ? count($this->groupData['uid']) : 0;
+               return count($this->groupData['uid']) ?: 0;
        }
 
        /**
index 23f4c09..1f991e8 100644 (file)
@@ -50,7 +50,7 @@ class ContentContentObject extends \TYPO3\CMS\Frontend\ContentObject\AbstractCon
                        $GLOBALS['TSFE']->recordRegister[$originalRec]++;
                }
                $conf['table'] = isset($conf['table.']) ? trim($this->cObj->stdWrap($conf['table'], $conf['table.'])) : trim($conf['table']);
-               $renderObjName = $conf['renderObj'] ? $conf['renderObj'] : '<' . $conf['table'];
+               $renderObjName = $conf['renderObj'] ?: '<' . $conf['table'];
                $renderObjKey = $conf['renderObj'] ? 'renderObj' : '';
                $renderObjConf = $conf['renderObj.'];
                $slide = isset($conf['slide.']) ? intval($this->cObj->stdWrap($conf['slide'], $conf['slide.'])) : intval($conf['slide']);
index 662e59e..0cdf8b2 100644 (file)
@@ -3555,7 +3555,7 @@ class ContentObjectRenderer {
         * @todo Define visibility
         */
        public function listNum($content, $listNum, $char) {
-               $char = $char ? $char : ',';
+               $char = $char ?: ',';
                if (\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($char)) {
                        $char = chr($char);
                }
index 9a9cdd8..85175f7 100644 (file)
@@ -299,7 +299,7 @@ class FlowPlayerContentObject extends \TYPO3\CMS\Frontend\ContentObject\Abstract
                        $conf['caption'] = $prefix . $conf['caption'];
                }
                // Write calculated values in conf for the hook
-               $conf['player'] = $player ? $player : $filename;
+               $conf['player'] = $player ?: $filename;
                $conf['installUrl'] = $installUrl;
                $conf['filename'] = $conf['flashvars.']['url'];
                $conf['prefix'] = $prefix;
index a9dffb7..02398d2 100644 (file)
@@ -123,7 +123,7 @@ class MediaContentObject extends \TYPO3\CMS\Frontend\ContentObject\AbstractConte
                        }
                }
                $mime = $renderType . 'object';
-               $typeConf = $conf['mimeConf.'][$mime . '.'][$conf['type'] . '.'] ? $conf['mimeConf.'][$mime . '.'][$conf['type'] . '.'] : array();
+               $typeConf = $conf['mimeConf.'][$mime . '.'][$conf['type'] . '.'] ?: array();
                $conf['predefined'] = array();
                // Width and height
                $conf['width'] = intval($this->doFlexFormOverlay($conf, 'width'));
index 4700330..5438e3d 100644 (file)
@@ -329,7 +329,7 @@ class AbstractMenuContentObject {
                        }
                        // Setting "nextActive": This is the page uid + MPvar of the NEXT page in rootline. Used to expand the menu if we are in the right branch of the tree
                        // Notice: The automatic expansion of a menu is designed to work only when no "special" modes (except "directory") are used.
-                       $startLevel = $directoryLevel ? $directoryLevel : $this->entryLevel;
+                       $startLevel = $directoryLevel ?: $this->entryLevel;
                        $currentLevel = $startLevel + $this->menuNumber;
                        if (is_array($this->tmpl->rootLine[$currentLevel])) {
                                $nextMParray = $this->MP_array;
@@ -382,7 +382,7 @@ class AbstractMenuContentObject {
                        // Begin production of menu:
                        $temp = array();
                        $altSortFieldValue = trim($this->mconf['alternativeSortingField']);
-                       $altSortField = $altSortFieldValue ? $altSortFieldValue : 'sorting';
+                       $altSortField = $altSortFieldValue ?: 'sorting';
                        // ... only for the FIRST level of a HMENU
                        if ($this->menuNumber == 1 && $this->conf['special']) {
                                $value = isset($this->conf['special.']['value.']) ? $this->parent_cObj->stdWrap($this->conf['special.']['value'], $this->conf['special.']['value.']) : $this->conf['special.']['value'];
@@ -1018,7 +1018,7 @@ class AbstractMenuContentObject {
                                        // If rollOver on normal, we must apply a state for rollOver on the active
                                        if ($ROconf) {
                                                // If RollOver on active then apply this
-                                               $ROconf[$key] = $IFSUBROconf[$key] ? $IFSUBROconf[$key] : $IFSUBconf[$key];
+                                               $ROconf[$key] = $IFSUBROconf[$key] ?: $IFSUBconf[$key];
                                        }
                                }
                        }
@@ -1044,7 +1044,7 @@ class AbstractMenuContentObject {
                                        // If rollOver on normal, we must apply a state for rollOver on the active
                                        if ($ROconf) {
                                                // If RollOver on active then apply this
-                                               $ROconf[$key] = $ACTROconf[$key] ? $ACTROconf[$key] : $ACTconf[$key];
+                                               $ROconf[$key] = $ACTROconf[$key] ?: $ACTconf[$key];
                                        }
                                }
                        }
@@ -1071,7 +1071,7 @@ class AbstractMenuContentObject {
                                        // If rollOver on normal, we must apply a state for rollOver on the active
                                        if ($ROconf) {
                                                // If RollOver on active then apply this
-                                               $ROconf[$key] = $ACTIFSUBROconf[$key] ? $ACTIFSUBROconf[$key] : $ACTIFSUBconf[$key];
+                                               $ROconf[$key] = $ACTIFSUBROconf[$key] ?: $ACTIFSUBconf[$key];
                                        }
                                }
                        }
@@ -1098,7 +1098,7 @@ class AbstractMenuContentObject {
                                        // If rollOver on normal, we must apply a state for rollOver on the active
                                        if ($ROconf) {
                                                // If RollOver on active then apply this
-                                               $ROconf[$key] = $CURROconf[$key] ? $CURROconf[$key] : $CURconf[$key];
+                                               $ROconf[$key] = $CURROconf[$key] ?: $CURconf[$key];
                                        }
                                }
                        }
@@ -1124,7 +1124,7 @@ class AbstractMenuContentObject {
                                        // If rollOver on normal, we must apply a state for rollOver on the current
                                        if ($ROconf) {
                                                // If RollOver on current then apply this
-                                               $ROconf[$key] = $CURIFSUBROconf[$key] ? $CURIFSUBROconf[$key] : $CURIFSUBconf[$key];
+                                               $ROconf[$key] = $CURIFSUBROconf[$key] ?: $CURIFSUBconf[$key];
                                        }
                                }
                        }
@@ -1150,7 +1150,7 @@ class AbstractMenuContentObject {
                                        // If rollOver on normal, we must apply a state for rollOver on the active
                                        if ($ROconf) {
                                                // If RollOver on active then apply this
-                                               $ROconf[$key] = $USRROconf[$key] ? $USRROconf[$key] : $USRconf[$key];
+                                               $ROconf[$key] = $USRROconf[$key] ?: $USRconf[$key];
                                        }
                                }
                        }
@@ -1193,7 +1193,7 @@ class AbstractMenuContentObject {
                                        // If rollOver on normal, we must apply a state for rollOver on the active
                                        if ($ROconf) {
                                                // If RollOver on active then apply this
-                                               $ROconf[$key] = $USERDEF1ROconf[$key] ? $USERDEF1ROconf[$key] : $USERDEF1conf[$key];
+                                               $ROconf[$key] = $USERDEF1ROconf[$key] ?: $USERDEF1conf[$key];
                                        }
                                }
                        }
@@ -1219,7 +1219,7 @@ class AbstractMenuContentObject {
                                        // If rollOver on normal, we must apply a state for rollOver on the active
                                        if ($ROconf) {
                                                // If RollOver on active then apply this
-                                               $ROconf[$key] = $USERDEF2ROconf[$key] ? $USERDEF2ROconf[$key] : $USERDEF2conf[$key];
+                                               $ROconf[$key] = $USERDEF2ROconf[$key] ?: $USERDEF2conf[$key];
                                        }
                                }
                        }
@@ -1246,7 +1246,7 @@ class AbstractMenuContentObject {
                if ($this->mconf['overrideId'] || $this->menuArr[$key]['overrideId']) {
                        $overrideArray = array();
                        // If a user script returned the value overrideId in the menu array we use that as page id
-                       $overrideArray['uid'] = $this->mconf['overrideId'] ? $this->mconf['overrideId'] : $this->menuArr[$key]['overrideId'];
+                       $overrideArray['uid'] = $this->mconf['overrideId'] ?: $this->menuArr[$key]['overrideId'];
                        $overrideArray['alias'] = '';
                        // Clear MP parameters since ID was changed.
                        $MP_params = '';
@@ -1320,7 +1320,7 @@ class AbstractMenuContentObject {
                if (preg_match('/([0-9]+[\\s])?(([0-9]+)x([0-9]+))?(:.+)?/s', $LD['target'], $matches) || $targetIsType) {
                        // has type?
                        if (intval($matches[1]) || $targetIsType) {
-                               $LD['totalURL'] = $this->parent_cObj->URLqMark($LD['totalURL'], '&type=' . ($targetIsType ? $targetIsType : intval($matches[1])));
+                               $LD['totalURL'] = $this->parent_cObj->URLqMark($LD['totalURL'], '&type=' . ($targetIsType ?: intval($matches[1])));
                                $LD['target'] = $targetIsType ? '' : trim(substr($LD['target'], strlen($matches[1]) + 1));
                        }
                        // Open in popup window?
@@ -1750,7 +1750,7 @@ class AbstractMenuContentObject {
         * @return array
         */
        protected function sectionIndex($altSortField, $pid = NULL) {
-               $pid = intval($pid ? $pid : $this->id);
+               $pid = intval($pid ?: $this->id);
                $basePageRow = $this->sys_page->getPage($pid);
                if (!is_array($basePageRow)) {
                        return array();
index fe0fe46..97c56dc 100644 (file)
@@ -88,7 +88,7 @@ class ImageMenuContentObject extends \TYPO3\CMS\Frontend\ContentObject\Menu\Abst
                                                foreach ($sKeyArray as $theKey) {
                                                        $theValue = $val[$theKey];
                                                        if (intval($theKey) && ($theValArr = $val[$theKey . '.'])) {
-                                                               $cObjData = $this->menuArr[$key] ? $this->menuArr[$key] : array();
+                                                               $cObjData = $this->menuArr[$key] ?: array();
                                                                $gifObjCount++;
                                                                if ($theValue == 'TEXT') {
                                                                        $waArr[$key]['textNum'] = $gifObjCount;
@@ -137,7 +137,7 @@ class ImageMenuContentObject extends \TYPO3\CMS\Frontend\ContentObject\Menu\Abst
                                                                                $temp_sKeyArray = \TYPO3\CMS\Core\TypoScript\TemplateService::sortedKeyList($theValArr['file.']);
                                                                                foreach ($temp_sKeyArray as $temp_theKey) {
                                                                                        if ($theValArr['mask.'][$temp_theKey] == 'TEXT') {
-                                                                                               $gifCreator->data = $this->menuArr[$key] ? $this->menuArr[$key] : array();
+                                                                                               $gifCreator->data = $this->menuArr[$key] ?: array();
                                                                                                $theValArr['mask.'][$temp_theKey . '.'] = $gifCreator->checkTextObj($theValArr['mask.'][$temp_theKey . '.']);
                                                                                                // If this is not done it seems that imageMaps will be rendered wrong!!
                                                                                                unset($theValArr['mask.'][$temp_theKey . '.']['text.']);
@@ -148,7 +148,7 @@ class ImageMenuContentObject extends \TYPO3\CMS\Frontend\ContentObject\Menu\Abst
                                                                                $temp_sKeyArray = \TYPO3\CMS\Core\TypoScript\TemplateService::sortedKeyList($theValArr['mask.']);
                                                                                foreach ($temp_sKeyArray as $temp_theKey) {
                                                                                        if ($theValArr['mask.'][$temp_theKey] == 'TEXT') {
-                                                                                               $gifCreator->data = $this->menuArr[$key] ? $this->menuArr[$key] : array();
+                                                                                               $gifCreator->data = $this->menuArr[$key] ?: array();
                                                                                                $theValArr['mask.'][$temp_theKey . '.'] = $gifCreator->checkTextObj($theValArr['mask.'][$temp_theKey . '.']);
                                                                                                // if this is not done it seems that imageMaps will be rendered wrong!!
                                                                                                unset($theValArr['mask.'][$temp_theKey . '.']['text.']);
@@ -192,8 +192,8 @@ class ImageMenuContentObject extends \TYPO3\CMS\Frontend\ContentObject\Menu\Abst
                                foreach ($waArr as $key => $val) {
                                        $index = $val['free'];
                                        $gifCreator->setup[$index] = 'WORKAREA';
-                                       $workArea[2] = $dConf[$key][2] ? $dConf[$key][2] : $dConf[$key][0];
-                                       $workArea[3] = $dConf[$key][3] ? $dConf[$key][3] : $dConf[$key][1];
+                                       $workArea[2] = $dConf[$key][2] ?: $dConf[$key][0];
+                                       $workArea[3] = $dConf[$key][3] ?: $dConf[$key][1];
                                        $gifCreator->setup[$index . '.']['set'] = implode(',', $workArea);
                                        $workArea[0] += $dConf[$key][0];
                                        $workArea[1] += $dConf[$key][1];
index 35db8d2..9de017f 100644 (file)
@@ -57,7 +57,7 @@ class JavaScriptMenuContentObject extends \TYPO3\CMS\Frontend\ContentObject\Menu
                        $this->levels = $levels;
                        $uniqueParam = \TYPO3\CMS\Core\Utility\GeneralUtility::shortMD5(microtime(), 5);
                        $this->JSVarName = 'eid' . $uniqueParam;
-                       $this->JSMenuName = $this->mconf['menuName'] ? $this->mconf['menuName'] : 'JSmenu' . $uniqueParam;
+                       $this->JSMenuName = $this->mconf['menuName'] ?: 'JSmenu' . $uniqueParam;
                        $JScode = '
  var ' . $this->JSMenuName . ' = new JSmenu(' . $levels . ', \'' . $this->JSMenuName . 'Form\');';
                        for ($a = 1; $a <= $levels; $a++) {
@@ -72,12 +72,12 @@ class JavaScriptMenuContentObject extends \TYPO3\CMS\Frontend\ContentObject\Menu
                        for ($a = 1; $a <= $this->levels; $a++) {
                                $formCode = '';
                                $levelConf = $this->mconf[$a . '.'];
-                               $length = $levelConf['width'] ? $levelConf['width'] : 14;
+                               $length = $levelConf['width'] ?: 14;
                                $lenghtStr = '';
                                for ($b = 0; $b < $length; $b++) {
                                        $lenghtStr .= '_';
                                }
-                               $height = $levelConf['elements'] ? $levelConf['elements'] : 5;
+                               $height = $levelConf['elements'] ?: 5;
                                $formCode .= '<select name="selector' . $a . '" onchange="' . $this->JSMenuName . '.act(' . $a . ');"' . ($levelConf['additionalParams'] ? ' ' . $levelConf['additionalParams'] : '') . '>';
                                for ($b = 0; $b < $height; $b++) {
                                        $formCode .= '<option value="0">';
index ca97564..b6a8dc0 100644 (file)
@@ -118,7 +118,7 @@ class OffsetTableContentObject extends \TYPO3\CMS\Frontend\ContentObject\Abstrac
                        // top
                        if ($valPairs[1]) {
                                $rows[1] .= '<tr>';
-                               $rows[1] .= '<td><img src="' . $GLOBALS['TSFE']->absRefPrefix . 'clear.gif" width="' . ($valPairs[0] ? $valPairs[0] : 1) . '" height="' . $valPairs[1] . '" alt="" title="" /></td>';
+                               $rows[1] .= '<td><img src="' . $GLOBALS['TSFE']->absRefPrefix . 'clear.gif" width="' . ($valPairs[0] ?: 1) . '" height="' . $valPairs[1] . '" alt="" title="" /></td>';
                                if ($valPairs[0]) {
                                        $rows[1] .= '<td></td>';
                                }
@@ -134,7 +134,7 @@ class OffsetTableContentObject extends \TYPO3\CMS\Frontend\ContentObject\Abstrac
                        }
                        $rows[2] .= '<td' . $this->tdParams . '>' . $content . '</td>';
                        if ($valPairs[2]) {
-                               $rows[2] .= $valPairs[3] ? '<td>' . $heightImg . '</td>' : '<td><img src="' . $GLOBALS['TSFE']->absRefPrefix . 'clear.gif" width="' . $valPairs[2] . '" height="' . ($valPairs[5] ? $valPairs[5] : 1) . '" alt="" title="" /></td>';
+                               $rows[2] .= $valPairs[3] ? '<td>' . $heightImg . '</td>' : '<td><img src="' . $GLOBALS['TSFE']->absRefPrefix . 'clear.gif" width="' . $valPairs[2] . '" height="' . ($valPairs[5] ?: 1) . '" alt="" title="" /></td>';
                        }
                        $rows[2] .= '</tr>';
                        // Bottom row:
@@ -146,7 +146,7 @@ class OffsetTableContentObject extends \TYPO3\CMS\Frontend\ContentObject\Abstrac
                                if ($valPairs[2]) {
                                        $rows[3] .= '<td>' . $widthImg . '</td>';
                                }
-                               $rows[3] .= '<td><img src="' . $GLOBALS['TSFE']->absRefPrefix . 'clear.gif" width="' . ($valPairs[2] ? $valPairs[2] : ($valPairs[4] ? $valPairs[4] : 1)) . '" height="' . $valPairs[3] . '" alt="" title="" /></td>';
+                               $rows[3] .= '<td><img src="' . $GLOBALS['TSFE']->absRefPrefix . 'clear.gif" width="' . ($valPairs[2] ?: ($valPairs[4] ?: 1)) . '" height="' . $valPairs[3] . '" alt="" title="" /></td>';
                                $rows[3] .= '</tr>';
                        }
                        return $this->begin . implode('', $rows) . $this->end;
index 32489a9..47d2e6f 100644 (file)
@@ -122,7 +122,7 @@ class RecordsContentObject extends AbstractContentObject {
                                                        $row = $this->cObj->checkPid($row['pid']) ? $row : '';
                                                }
                                                if ($row && !$GLOBALS['TSFE']->recordRegister[($val['table'] . ':' . $val['id'])]) {
-                                                       $renderObjName = $conf['conf.'][$val['table']] ? $conf['conf.'][$val['table']] : '<' . $val['table'];
+                                                       $renderObjName = $conf['conf.'][$val['table']] ?: '<' . $val['table'];
                                                        $renderObjKey = $conf['conf.'][$val['table']] ? 'conf.' . $val['table'] : '';
                                                        $renderObjConf = $conf['conf.'][$val['table'] . '.'];
                                                        $this->cObj->currentRecordNumber++;
index f5a7084..c746881 100644 (file)
@@ -391,7 +391,7 @@ class SearchResultContentObject extends \TYPO3\CMS\Frontend\ContentObject\Abstra
                                        } elseif (strlen($val) > 1) {
                                                // A searchword MUST be at least two characters long!
                                                $this->sword_array[$i]['sword'] = $val;
-                                               $this->sword_array[$i]['oper'] = $lastoper ? $lastoper : $this->default_operator;
+                                               $this->sword_array[$i]['oper'] = $lastoper ?: $this->default_operator;
                                                $lastoper = '';
                                                $i++;
                                        }
index 8133154..a6a0e43 100644 (file)
@@ -168,7 +168,7 @@ class DataSubmissionController {
                                $this->mailMessage->setBody($plainTextContent, 'text/plain', $this->characterSet);
                        }
                        for ($a = 0; $a < 10; $a++) {
-                               $variableName = 'attachment' . ($a ? $a : '');
+                               $variableName = 'attachment' . ($a ?: '');
                                if (!isset($_FILES[$variableName])) {
                                        continue;
                                }
index b44c993..ad11456 100644 (file)
@@ -176,10 +176,10 @@ class ShowImageController {
 
 <html>
 <head>
-       <title>' . htmlspecialchars(($this->title ? $this->title : 'Image')) . '</title>
+       <title>' . htmlspecialchars(($this->title ?: 'Image')) . '</title>
        ' . ($this->title ? '' : '<meta name="robots" content="noindex,follow" />') . '
 </head>
-               ' . ($this->bodyTag ? $this->bodyTag : '<body>');
+               ' . ($this->bodyTag ?: '<body>');
                if (is_array($imgInfo)) {
                        $wrapParts = explode('|', $this->wrap);
                        $this->content .= trim($wrapParts[0]) . $img->imgTag($imgInfo) . trim($wrapParts[1]);
index 2ff431a..b8d4b86 100644 (file)
@@ -304,7 +304,7 @@ class TranslationStatusController extends \TYPO3\CMS\Backend\Module\AbstractFunc
         */
        public function getContentElementCount($pageId, $sysLang) {
                $count = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows('uid', 'tt_content', 'pid=' . intval($pageId) . ' AND sys_language_uid=' . intval($sysLang) . BackendUtility::deleteClause('tt_content') . BackendUtility::versioningPlaceholderClause('tt_content'));
-               return $count ? $count : '-';
+               return $count ?: '-';
        }
 
 }
index dfd48bf..d8ca484 100644 (file)
@@ -1651,7 +1651,7 @@ class TypoScriptFrontendController {
                if (!is_array($groupList)) {
                        $groupList = explode(',', $groupList);
                }
-               $pageGroupList = explode(',', $row['fe_group'] ? $row['fe_group'] : 0);
+               $pageGroupList = explode(',', $row['fe_group'] ?: 0);
                return count(array_intersect($groupList, $pageGroupList)) > 0;
        }
 
@@ -1822,7 +1822,7 @@ class TypoScriptFrontendController {
         * @todo Define visibility
         */
        public function pageUnavailableAndExit($reason = '', $header = '') {
-               $header = $header ? $header : $this->TYPO3_CONF_VARS['FE']['pageUnavailable_handling_statheader'];
+               $header = $header ?: $this->TYPO3_CONF_VARS['FE']['pageUnavailable_handling_statheader'];
                $this->pageUnavailableHandler($this->TYPO3_CONF_VARS['FE']['pageUnavailable_handling'], $header, $reason);
                die;
        }
@@ -1836,7 +1836,7 @@ class TypoScriptFrontendController {
         * @todo Define visibility
         */
        public function pageNotFoundAndExit($reason = '', $header = '') {
-               $header = $header ? $header : $this->TYPO3_CONF_VARS['FE']['pageNotFound_handling_statheader'];
+               $header = $header ?: $this->TYPO3_CONF_VARS['FE']['pageNotFound_handling_statheader'];
                $this->pageNotFoundHandler($this->TYPO3_CONF_VARS['FE']['pageNotFound_handling'], $header, $reason);
                die;
        }
@@ -2403,7 +2403,7 @@ class TypoScriptFrontendController {
                                        }
                                        // Processing for the config_array:
                                        $this->config['rootLine'] = $this->tmpl->rootLine;
-                                       $this->config['mainScript'] = trim($this->config['config']['mainScript']) ? trim($this->config['config']['mainScript']) : 'index.php';
+                                       $this->config['mainScript'] = trim($this->config['config']['mainScript']) ?: 'index.php';
                                        // Class for render Header and Footer parts
                                        $template = '';
                                        if ($this->pSetup['pageHeaderFooterTemplateFile']) {
@@ -2801,7 +2801,7 @@ class TypoScriptFrontendController {
                $fdef = array();
                //|recipient_copy=hidden|karsten@localhost.localdomain
                preg_match('/^[\\s]*\\|[\\s]*recipient_copy[\\s]*=[\\s]*hidden[\\s]*\\|(.*)$/m', $bodytext, $fdef);
-               $recipient_copy = !empty($fdef[1]) ? $fdef[1] : '';
+               $recipient_copy = $fdef[1] ?: '';
                return $recipient_copy;
        }
 
@@ -2863,7 +2863,7 @@ class TypoScriptFrontendController {
                                                $absoluteFileName = GeneralUtility::getFileAbsFileName(\TYPO3\CMS\Core\Utility\GeneralUtility::resolveBackPath($this->jumpurl), FALSE);
                                                if (\TYPO3\CMS\Core\Utility\GeneralUtility::isAllowedAbsPath($absoluteFileName) && GeneralUtility::verifyFilenameAgainstDenyPattern($absoluteFileName) && !\TYPO3\CMS\Core\Utility\GeneralUtility::isFirstPartOfStr($absoluteFileName, (PATH_site . 'typo3conf'))) {
                                                        if (@is_file($absoluteFileName)) {
-                                                               $mimeType = $mimeType ? $mimeType : 'application/octet-stream';
+                                                               $mimeType = $mimeType ?: 'application/octet-stream';
                                                                header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
                                                                header('Content-Type: ' . $mimeType);
                                                                header('Content-Disposition: attachment; filename="' . basename($absoluteFileName) . '"');
@@ -4570,7 +4570,7 @@ if (version == "n3") {
                if ($urlmode) {
                        $message = GeneralUtility::substUrlsInPlainText($message, $urlmode);
                }
-               $encoding = $this->config['config']['notification_email_encoding'] ? $this->config['config']['notification_email_encoding'] : '';
+               $encoding = $this->config['config']['notification_email_encoding'] ?: '';
                $charset = $this->renderCharset;
                $convCharset = FALSE;
                // do we need to convert mail data?
@@ -4710,7 +4710,7 @@ if (version == "n3") {
         */
        public function initLLvars() {
                // Setting language key and split index:
-               $this->lang = $this->config['config']['language'] ? $this->config['config']['language'] : 'default';
+               $this->lang = $this->config['config']['language'] ?: 'default';
                $this->getPageRenderer()->setLanguage($this->lang);
 
                // Finding the requested language in this list based
@@ -4747,7 +4747,7 @@ if (version == "n3") {
        public function csConv($str, $from = '') {
                if ($from) {
                        $output = $this->csConvObj->conv($str, $this->csConvObj->parse_charset($from), $this->renderCharset, 1);
-                       return $output ? $output : $str;
+                       return $output ?: $str;
                } else {
                        return $str;
                }
index ca74a4d..da2d8f4 100644 (file)
@@ -317,8 +317,8 @@ class GifBuilder extends \TYPO3\CMS\Core\Imaging\GraphicalFunctions {
                        $XY = GeneralUtility::intExplode(',', $this->setup['XY']);
                        $maxWidth = isset($this->setup['maxWidth.']) ? intval($this->cObj->stdWrap($this->setup['maxWidth'], $this->setup['maxWidth.'])) : intval($this->setup['maxWidth']);
                        $maxHeight = isset($this->setup['maxHeight.']) ? intval($this->cObj->stdWrap($this->setup['maxHeight'], $this->setup['maxHeight.'])) : intval($this->setup['maxHeight']);
-                       $XY[0] = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange($XY[0], 1, $maxWidth ? $maxWidth : 2000);
-                       $XY[1] = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange($XY[1], 1, $maxHeight ? $maxHeight : 2000);
+                       $XY[0] = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange($XY[0], 1, $maxWidth ?: 2000);
+                       $XY[1] = \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange($XY[1], 1, $maxHeight ?: 2000);
                        $this->XY = $XY;
                        $this->w = $XY[0];
                        $this->h = $XY[1];
@@ -578,7 +578,7 @@ class GifBuilder extends \TYPO3\CMS\Core\Imaging\GraphicalFunctions {
                $this->combinedTextStrings[] = strip_tags($conf['text']);
                // Max length = 100 if automatic line braks are not defined:
                if (!isset($conf['breakWidth']) || !$conf['breakWidth']) {
-                       $tlen = intval($conf['textMaxLength']) ? intval($conf['textMaxLength']) : 100;
+                       $tlen = intval($conf['textMaxLength']) ?: 100;
                        if ($this->nativeCharset) {
                                $conf['text'] = $this->csConvObj->substr($this->nativeCharset, $conf['text'], 0, $tlen);
                        } else {
index 6821dea..b57ceca 100644 (file)
@@ -95,7 +95,7 @@ class PageGenerator {
                }
                $GLOBALS['TSFE']->compensateFieldWidth = '' . $GLOBALS['TSFE']->config['config']['compensateFieldWidth'];
                $GLOBALS['TSFE']->lockFilePath = '' . $GLOBALS['TSFE']->config['config']['lockFilePath'];
-               $GLOBALS['TSFE']->lockFilePath = $GLOBALS['TSFE']->lockFilePath ? $GLOBALS['TSFE']->lockFilePath : $GLOBALS['TYPO3_CONF_VARS']['BE']['fileadminDir'];
+               $GLOBALS['TSFE']->lockFilePath = $GLOBALS['TSFE']->lockFilePath ?: $GLOBALS['TYPO3_CONF_VARS']['BE']['fileadminDir'];
                $GLOBALS['TYPO3_CONF_VARS']['GFX']['im_noScaleUp'] = isset($GLOBALS['TSFE']->config['config']['noScaleUp']) ? '' . $GLOBALS['TSFE']->config['config']['noScaleUp'] : $GLOBALS['TYPO3_CONF_VARS']['GFX']['im_noScaleUp'];
                $GLOBALS['TSFE']->TYPO3_CONF_VARS['GFX']['im_noScaleUp'] = $GLOBALS['TYPO3_CONF_VARS']['GFX']['im_noScaleUp'];
                $GLOBALS['TSFE']->ATagParams = trim($GLOBALS['TSFE']->config['config']['ATagParams']) ? ' ' . trim($GLOBALS['TSFE']->config['config']['ATagParams']) : '';
@@ -277,7 +277,7 @@ class PageGenerator {
                // Reset the content variables:
                $GLOBALS['TSFE']->content = '';
                $htmlTagAttributes = array();
-               $htmlLang = $GLOBALS['TSFE']->config['config']['htmlTag_langKey'] ? $GLOBALS['TSFE']->config['config']['htmlTag_langKey'] : 'en';
+               $htmlLang = $GLOBALS['TSFE']->config['config']['htmlTag_langKey'] ?: 'en';
                // Set content direction: (More info: http://www.tau.ac.il/~danon/Hebrew/HTML_and_Hebrew.html)
                if ($GLOBALS['TSFE']->config['config']['htmlTag_dir']) {
                        $htmlTagAttributes['dir'] = htmlspecialchars($GLOBALS['TSFE']->config['config']['htmlTag_dir']);
@@ -401,7 +401,7 @@ class PageGenerator {
                }
                $pageRenderer->setHtmlTag($htmlTag);
                // Head tag:
-               $headTag = $GLOBALS['TSFE']->pSetup['headTag'] ? $GLOBALS['TSFE']->pSetup['headTag'] : '<head>';
+               $headTag = $GLOBALS['TSFE']->pSetup['headTag'] ?: '<head>';
                $pageRenderer->setHeadTag($headTag);
                // Setting charset meta tag:
                $pageRenderer->setCharSet($theCharset);
@@ -486,8 +486,8 @@ class PageGenerator {
                                                        $pageRenderer->addCssFile(
                                                                $ss,
                                                                $cssFileConfig['alternate'] ? 'alternate stylesheet' : 'stylesheet',
-                                                               $cssFileConfig['media'] ? $cssFileConfig['media'] : 'all',
-                                                               $cssFileConfig['title'] ? $cssFileConfig['title'] : '',
+                                                               $cssFileConfig['media'] ?: 'all',
+                                                               $cssFileConfig['title'] ?: '',
                                                                empty($cssFileConfig['disableCompression']),
                                                                $cssFileConfig['forceOnTop'] ? TRUE : FALSE,
                                                                $cssFileConfig['allWrap'],
@@ -568,7 +568,7 @@ class PageGenerator {
                                $pageRenderer->loadPrototype();
                        }
                        if ($GLOBALS['TSFE']->pSetup['javascriptLibs.']['Scriptaculous']) {
-                               $modules = $GLOBALS['TSFE']->pSetup['javascriptLibs.']['Scriptaculous.']['modules'] ? $GLOBALS['TSFE']->pSetup['javascriptLibs.']['Scriptaculous.']['modules'] : '';
+                               $modules = $GLOBALS['TSFE']->pSetup['javascriptLibs.']['Scriptaculous.']['modules'] ?: '';
                                $pageRenderer->loadScriptaculous($modules);
                        }
                        if ($GLOBALS['TSFE']->pSetup['javascriptLibs.']['ExtCore']) {
@@ -599,7 +599,7 @@ class PageGenerator {
                        if ($GLOBALS['TSFE']->pSetup['javascriptLibs.']['ExtJs']) {
                                $css = $GLOBALS['TSFE']->pSetup['javascriptLibs.']['ExtJs.']['css'] ? TRUE : FALSE;
                                $theme = $GLOBALS['TSFE']->pSetup['javascriptLibs.']['ExtJs.']['theme'] ? TRUE : FALSE;
-                               $adapter = $GLOBALS['TSFE']->pSetup['javascriptLibs.']['ExtJs.']['adapter'] ? $GLOBALS['TSFE']->pSetup['javascriptLibs.']['ExtJs.']['adapter'] : '';
+                               $adapter = $GLOBALS['TSFE']->pSetup['javascriptLibs.']['ExtJs.']['adapter'] ?: '';
                                $pageRenderer->loadExtJs($css, $theme, $adapter);
                                if ($GLOBALS['TSFE']->pSetup['javascriptLibs.']['ExtJs.']['debug']) {
                                        $pageRenderer->enableExtJsDebug();
index d10ad78..289008b 100644 (file)
@@ -479,7 +479,7 @@ class PageRepository {
                                                // Check subpages - first subpage or random subpage
                                                $searchField = 'pid';
                                                // If a shortcut mode is set and no valid page is given to select subpags from use the actual page.
-                                               $searchUid = intval($row['shortcut']) ? intval($row['shortcut']) : $row['uid'];
+                                               $searchUid = intval($row['shortcut']) ?: $row['uid'];
                                        } elseif ($row['shortcut_mode'] == self::SHORTCUT_MODE_PARENT_PAGE) {
                                                // Shortcut to parent page
                                                $searchField = 'uid';
@@ -668,7 +668,7 @@ class PageRepository {
                                        $prevMountPids[] = $mount_pid;
                                        $recursiveMountPid = $this->getMountPointInfo($mount_pid, $mountRec, $prevMountPids, $firstPageUid);
                                        // Return mount point information:
-                                       $result = $recursiveMountPid ? $recursiveMountPid : array(
+                                       $result = $recursiveMountPid ?: array(
                                                'mount_pid' => $mount_pid,
                                                'overlay' => $pageRec['mount_pid_ol'],
                                                'MPvar' => $mount_pid . '-' . $firstPageUid,
index ff1db32..cfd7d06 100644 (file)
@@ -425,7 +425,7 @@ class AbstractPlugin {
                                $overrulePIvars = array_merge($overrulePIvars, (array) $mergeArr);
                                $str = $this->pi_linkTP($str, array($this->prefixId => $overrulePIvars), $cache, $altPageId);
                        } else {
-                               $overrulePIvars = array('showUid' => $uid ? $uid : '');
+                               $overrulePIvars = array('showUid' => $uid ?: '');
                                $overrulePIvars = array_merge($overrulePIvars, (array) $mergeArr);
                                $str = $this->pi_linkTP_keepPIvars($str, $overrulePIvars, $cache, 0, $altPageId);
                        }
@@ -563,7 +563,7 @@ class AbstractPlugin {
                        // Link to previous page
                        if ($alwaysPrev >= 0) {
                                if ($pointer > 0) {
-                                       $links[] = $this->cObj->wrap($this->pi_linkTP_keepPIvars($this->pi_getLL('pi_list_browseresults_prev', '< Previous', $hscText), array($pointerName => $pointer - 1 ? $pointer - 1 : ''), $pi_isOnlyFields), $wrapper['inactiveLinkWrap']);
+                                       $links[] = $this->cObj->wrap($this->pi_linkTP_keepPIvars($this->pi_getLL('pi_list_browseresults_prev', '< Previous', $hscText), array($pointerName => ($pointer - 1) ?: ''), $pi_isOnlyFields), $wrapper['inactiveLinkWrap']);
                                } elseif ($alwaysPrev) {
                                        $links[] = $this->cObj->wrap($this->pi_getLL('pi_list_browseresults_prev', '< Previous', $hscText), $wrapper['disabledLinkWrap']);
                                }
@@ -580,10 +580,10 @@ class AbstractPlugin {
                                        if ($this->internal['dontLinkActivePage']) {
                                                $links[] = $this->cObj->wrap($pageText, $wrapper['activeLinkWrap']);
                                        } else {
-                                               $links[] = $this->cObj->wrap($this->pi_linkTP_keepPIvars($pageText, array($pointerName => $a ? $a : ''), $pi_isOnlyFields), $wrapper['activeLinkWrap']);
+                                               $links[] = $this->cObj->wrap($this->pi_linkTP_keepPIvars($pageText, array($pointerName => $a ?: ''), $pi_isOnlyFields), $wrapper['activeLinkWrap']);
                                        }
                                } else {
-                                       $links[] = $this->cObj->wrap($this->pi_linkTP_keepPIvars($pageText, array($pointerName => $a ? $a : ''), $pi_isOnlyFields), $wrapper['inactiveLinkWrap']);
+                                       $links[] = $this->cObj->wrap($this->pi_linkTP_keepPIvars($pageText, array($pointerName => $a ?: ''), $pi_isOnlyFields), $wrapper['inactiveLinkWrap']);
                                }
                        }
                        if ($pointer < $totalPages - 1 || $showFirstLast) {
index ad1b430..41cfa27 100644 (file)
@@ -296,7 +296,7 @@ class ImportExportController extends \TYPO3\CMS\Backend\Module\BaseScriptClass {
                                        $fExt = ($this->export->doOutputCompress() ? '-z' : '') . '.t3d';
                        }
                        // Filename:
-                       $dlFile = $inData['filename'] ? $inData['filename'] : 'T3D_' . substr(preg_replace('/[^[:alnum:]_]/', '-', $inData['download_export_name']), 0, 20) . '_' . date('Y-m-d_H-i') . $fExt;
+                       $dlFile = $inData['filename'] ?: 'T3D_' . substr(preg_replace('/[^[:alnum:]_]/', '-', $inData['download_export_name']), 0, 20) . '_' . date('Y-m-d_H-i') . $fExt;
                        // Export for download:
                        if ($inData['download_export']) {
                                $mimeType = 'application/octet-stream';
index c873308..4d8fb22 100644 (file)
@@ -1082,7 +1082,7 @@ class ImportExport {
                        )
                );
                // Creating XML file from $outputArray:
-               $charset = $this->dat['header']['charset'] ? $this->dat['header']['charset'] : 'utf-8';
+               $charset = $this->dat['header']['charset'] ?: 'utf-8';
                $XML = '<?xml version="1.0" encoding="' . $charset . '" standalone="yes" ?>' . LF;
                $XML .= GeneralUtility::array2xml($this->dat, '', 0, 'T3RecordDocument', 0, $options);
                return $XML;
@@ -2690,7 +2690,7 @@ class ImportExport {
                                        $staticFixed = TRUE;
                                }
                                $pInfo['preCode'] = $preCode . '&nbsp;&nbsp;&nbsp;&nbsp;<img' . \TYPO3\CMS\Backend\Utility\IconUtility::skinImg($GLOBALS['BACK_PATH'], ('gfx/rel_db' . $Iprepend . '.gif'), 'width="13" height="12"') . ' align="top" title="' . htmlspecialchars($pInfo['ref']) . '" alt="" />';
-                               $pInfo['class'] = $htmlColorClass ? $htmlColorClass : 'bgColor3';
+                               $pInfo['class'] = $htmlColorClass ?: 'bgColor3';
                                $pInfo['type'] = 'rel';
                                if (!$staticFixed || $this->showStaticRelations) {
                                        $lines[] = $pInfo;
@@ -2734,7 +2734,7 @@ class ImportExport {
                        $pInfo['title'] = htmlspecialchars($fI['filename']);
                        $pInfo['ref'] = 'FILE';
                        $pInfo['size'] = $fI['filesize'];
-                       $pInfo['class'] = $htmlColorClass ? $htmlColorClass : 'bgColor3';
+                       $pInfo['class'] = $htmlColorClass ?: 'bgColor3';
                        $pInfo['type'] = 'file';
                        // If import mode and there is a non-RTE softreference, check the destination directory:
                        if ($this->mode === 'import' && $tokenID && !$fI['RTE_ORIG_ID']) {
@@ -2785,7 +2785,7 @@ class ImportExport {
                                $pInfo['title'] = htmlspecialchars($fI['filename']) . ' <em>(Original)</em>';
                                $pInfo['ref'] = 'FILE';
                                $pInfo['size'] = $fI['filesize'];
-                               $pInfo['class'] = $htmlColorClass ? $htmlColorClass : 'bgColor3';
+                               $pInfo['class'] = $htmlColorClass ?: 'bgColor3';
                                $pInfo['type'] = 'file';
                                $lines[] = $pInfo;
                                unset($this->remainHeader['files'][$ID]);
@@ -2806,7 +2806,7 @@ class ImportExport {
                                        $pInfo['title'] = htmlspecialchars($fI['filename']) . ' <em>(Resource)</em>';
                                        $pInfo['ref'] = 'FILE';
                                        $pInfo['size'] = $fI['filesize'];
-                                       $pInfo['class'] = $htmlColorClass ? $htmlColorClass : 'bgColor3';
+                                       $pInfo['class'] = $htmlColorClass ?: 'bgColor3';
                                        $pInfo['type'] = 'file';
                                        $lines[] = $pInfo;
                                        unset($this->remainHeader['files'][$ID]);
index 5f1a771..4b94023 100644 (file)
@@ -394,7 +394,7 @@ class SearchController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionControlle
                        }
                        $resultData['path'] = '<a href="' . htmlspecialchars($row['data_filename']) . '"' . $targetAttribute . '>' . htmlspecialchars($row['data_filename']) . '</a>';
                } else {
-                       $pathId = $row['data_page_id'] ? $row['data_page_id'] : $row['page_id'];
+                       $pathId = $row['data_page_id'] ?: $row['page_id'];
                        $pathMP = $row['data_page_id'] ? $row['data_page_mp'] : '';
                        $pathStr = htmlspecialchars($this->getPathFromPageId($pathId, $pathMP));
                        $resultData['path'] = $this->linkPage($pathId, $pathStr, array(
@@ -433,7 +433,7 @@ class SearchController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionControlle
         * @return array Configuration array
         */
        protected function getSpecialConfigForResultRow($row) {
-               $pathId = $row['data_page_id'] ? $row['data_page_id'] : $row['page_id'];
+               $pathId = $row['data_page_id'] ?: $row['page_id'];
                $pathMP = $row['data_page_id'] ? $row['data_page_mp'] : '';
                $rl = $GLOBALS['TSFE']->sys_page->getRootLine($pathId, $pathMP);
                $specConf = $this->settings['specialConfiguration.']['0.'];
@@ -595,7 +595,7 @@ class SearchController extends \TYPO3\CMS\Extbase\Mvc\Controller\ActionControlle
                                $outputStr = $GLOBALS['TSFE']->csConvObj->crop('utf-8', $row['item_description'], $length);
                                $outputStr = htmlspecialchars($outputStr);
                        }
-                       $output = $outputStr ? $outputStr : $markedSW;
+                       $output = $outputStr ?: $markedSW;
                        $output = $GLOBALS['TSFE']->csConv($output, 'utf-8');
                } else {
                        $output = '<span class="noResume">' . \TYPO3\CMS\Extbase\Utility\LocalizationUtility::translate('result.noResume', 'indexed_search') . '</span>';
index 0d29dc0..57c6f1d 100644 (file)
@@ -1928,7 +1928,7 @@ class SearchFormController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
                                $outputStr = $GLOBALS['TSFE']->csConvObj->crop('utf-8', $row['item_description'], $lgd);
                                $outputStr = htmlspecialchars($outputStr);
                        }
-                       $output = $this->utf8_to_currentCharset($outputStr ? $outputStr : $markedSW);
+                       $output = $this->utf8_to_currentCharset($outputStr ?: $markedSW);
                } else {
                        $output = '<span class="noResume">' . $this->pi_getLL('res_noResume', '', TRUE) . '</span>';
                }
@@ -2039,7 +2039,7 @@ class SearchFormController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
                $tmplArray['size'] = GeneralUtility::formatSize($row['item_size']);
                $tmplArray['created'] = $this->formatCreatedDate($row['item_crdate']);
                $tmplArray['modified'] = $this->formatModifiedDate($row['item_mtime']);
-               $pathId = $row['data_page_id'] ? $row['data_page_id'] : $row['page_id'];
+               $pathId = $row['data_page_id'] ?: $row['page_id'];
                $pathMP = $row['data_page_id'] ? $row['data_page_mp'] : '';
                $pI = parse_url($row['data_filename']);
                if ($pI['scheme']) {
@@ -2068,7 +2068,7 @@ class SearchFormController extends \TYPO3\CMS\Frontend\Plugin\AbstractPlugin {
         * @todo Define visibility
         */
        public function getSpecialConfigForRow($row) {
-               $pathId = $row['data_page_id'] ? $row['data_page_id'] : $row['page_id'];
+               $pathId = $row['data_page_id'] ?: $row['page_id'];
                $pathMP = $row['data_page_id'] ? $row['data_page_mp'] : '';
                $rl = $this->getRootLine($pathId, $pathMP);
                $specConf = $this->conf['specConfs.']['0.'];
index 596372e..3749b46 100644 (file)
@@ -234,7 +234,7 @@ class FileContentParser {
                // If extension was OK:
                if ($extOK) {
                        $this->supportedExtensions[$extension] = TRUE;
-                       $this->ext2itemtype_map[$extension] = $mainExtension ? $mainExtension : $extension;
+                       $this->ext2itemtype_map[$extension] = $mainExtension ?: $extension;
                        return TRUE;
                }
        }
index 9a76dfd..f34a909 100644 (file)
@@ -244,7 +244,7 @@ class CrawlerHook {
                                );
                        }
                        // Init:
-                       $pid = intval($cfgRec['alternative_source_pid']) ? intval($cfgRec['alternative_source_pid']) : $cfgRec['pid'];
+                       $pid = intval($cfgRec['alternative_source_pid']) ?: $cfgRec['pid'];
                        $numberOfRecords = $cfgRec['recordsbatch'] ? \TYPO3\CMS\Core\Utility\MathUtility::forceIntegerInRange($cfgRec['recordsbatch'], 1) : 100;
                        // Get root line:
                        $rl = $this->getUidRootLineForClosestTemplate($cfgRec['pid']);
@@ -620,7 +620,7 @@ class CrawlerHook {
                if ($cfgRec['timer_frequency'] <= 24 * 3600) {
                        $aMidNight = mktime(0, 0, 0) - 1 * 24 * 3600;
                } else {
-                       $lastTime = $cfgRec['timer_next_indexing'] ? $cfgRec['timer_next_indexing'] : $GLOBALS['EXEC_TIME'];
+                       $lastTime = $cfgRec['timer_next_indexing'] ?: $GLOBALS['EXEC_TIME'];
                        $aMidNight = mktime(0, 0, 0, date('m', $lastTime), date('d', $lastTime), date('y', $lastTime));
                }
                // Find last offset time plus frequency in seconds:
index 0950d33..5a5ed7f 100644 (file)
@@ -674,7 +674,7 @@ class Indexer {
         */
        public function convertHTMLToUtf8($content, $charset = '') {
                // Find charset:
-               $charset = $charset ? $charset : $this->getHTMLcharset($content);
+               $charset = $charset ?: $this->getHTMLcharset($content);
                $charset = $this->csObj->parse_charset($charset);
                // Convert charset:
                if ($charset && $charset !== 'utf-8') {
@@ -1111,7 +1111,7 @@ class Indexer {
        public function indexRegularDocument($file, $force = FALSE, $contentTmpFile = '', $altExtension = '') {
                // Init
                $fI = pathinfo($file);
-               $ext = $altExtension ? $altExtension : strtolower($fI['extension']);
+               $ext = $altExtension ?: strtolower($fI['extension']);
                // Create abs-path:
                if (!$contentTmpFile) {
                        if (!GeneralUtility::isAbsPath($file)) {
@@ -1595,7 +1595,7 @@ class Indexer {
        public function submitFilePage($hash, $file, $subinfo, $ext, $mtime, $ctime, $size, $content_md5h, $contentParts) {
                // Find item Type:
                $storeItemType = $this->external_parsers[$ext]->ext2itemtype_map[$ext];
-               $storeItemType = $storeItemType ? $storeItemType : $ext;
+               $storeItemType = $storeItemType ?: $ext;
                // Remove any current data for this phash:
                $this->removeOldIndexedFiles($hash['phash']);
                // Split filename:
@@ -1608,7 +1608,7 @@ class Indexer {
                        'contentHash' => $content_md5h,
                        'data_filename' => $file,
                        'item_type' => $storeItemType,
-                       'item_title' => trim($contentParts['title']) ? $contentParts['title'] : basename($file),
+                       'item_title' => trim($contentParts['title']) ?: basename($file),
                        'item_description' => $this->bodyDescription($contentParts),
                        'item_mtime' => $mtime,
                        'item_size' => $size,
index b6f0cad..1027f73 100644 (file)
@@ -406,10 +406,10 @@ class ElementBrowser {
                        var add_params="' . ($this->bparams ? '&bparams=' . rawurlencode($this->bparams) : '') . '";
 
                        var cur_href="' . ($this->curUrlArray['href'] ? rawurlencode($this->curUrlArray['href']) : '') . '";
-                       var cur_target="' . ($this->setTarget ? $this->setTarget : '') . '";
-                       var cur_class = "' . ($this->setClass ? $this->setClass : '') . '";
-                       var cur_title="' . ($this->setTitle ? $this->setTitle : '') . '";
-                       var cur_params="' . ($this->setParams ? $this->setParams : '') . '";
+                       var cur_target="' . ($this->setTarget ?: '') . '";
+                       var cur_class = "' . ($this->setClass ?: '') . '";
+                       var cur_title="' . ($this->setTitle ?: '') . '";
+                       var cur_params="' . ($this->setParams ?: '') . '";
 
                        function browse_links_setTarget(target) {       //
                                cur_target=target;
@@ -1352,7 +1352,7 @@ class ElementBrowser {
                        $_MCONF['name'] = 'file_list';
                        $_MOD_SETTINGS = BackendUtility::getModuleData($_MOD_MENU, GeneralUtility::_GP('SET'), $_MCONF['name']);
                }
-               $noThumbs = $noThumbs ? $noThumbs : empty($_MOD_SETTINGS['displayThumbs']);
+               $noThumbs = $noThumbs ?: !$_MOD_SETTINGS['displayThumbs'];
                // Create folder tree:
                $folderTree = GeneralUtility::makeInstance('TBE_FolderTree');
                $folderTree->thisScript = $this->thisScript;
index e6c936e..aaf3611 100644 (file)
@@ -47,8 +47,8 @@ class UserSetupHook {
                                $key = $storage->get();
                                $password = $backend->decrypt($key, substr($be_user_data['password'], 4));
                                $password2 = $backend->decrypt($key, substr($be_user_data['password2'], 4));
-                               $be_user_data['password'] = $password ? $password : $be_user_data['password'];
-                               $be_user_data['password2'] = $password2 ? $password2 : $be_user_data['password2'];
+                               $be_user_data['password'] = $password ?: $be_user_data['password'];
+                               $be_user_data['password2'] = $password2 ?: $be_user_data['password2'];
                        }
                }
        }
index 71467b3..30e72ea 100644 (file)
@@ -308,9 +308,9 @@ class BrowseLinks extends \TYPO3\CMS\Recordlist\Browser\ElementBrowser {
                // Attributes setting functions
                $JScode .= '
                        var cur_href="' . ($this->curUrlArray['href'] ? ($this->curUrlInfo['query'] ? substr($this->curUrlArray['href'], 0, -strlen($this->curUrlInfo['query'])) : $this->curUrlArray['href']) : '') . '";
-                       var cur_target="' . ($this->setTarget ? $this->setTarget : '') . '";
-                       var cur_class="' . ($this->setClass ? $this->setClass : '') . '";
-                       var cur_title="' . ($this->setTitle ? $this->setTitle : '') . '";
+                       var cur_target="' . ($this->setTarget ?: '') . '";
+                       var cur_class="' . ($this->setClass ?: '') . '";
+                       var cur_title="' . ($this->setTitle ?: '') . '";
 
                        function browse_links_setTarget(value) {
                                cur_target=value;
@@ -790,7 +790,7 @@ class BrowseLinks extends \TYPO3\CMS\Recordlist\Browser\ElementBrowser {
                                                <tr>
                                                        <td>' . $GLOBALS['LANG']->getLL('query_parameters', TRUE) . ':</td>
                                                        <td colspan="3">
-                                                               <input type="text" name="query_parameters" value="' . ($this->curUrlInfo['query'] ? $this->curUrlInfo['query'] : '') . '" ' . $this->doc->formWidth(30) . ' />
+                                                               <input type="text" name="query_parameters" value="' . ($this->curUrlInfo['query'] ?: '') . '" ' . $this->doc->formWidth(30) . ' />
                                                        </td>
                                                </tr>' : '';
        }
@@ -908,7 +908,7 @@ class BrowseLinks extends \TYPO3\CMS\Recordlist\Browser\ElementBrowser {
                                                                                browse_links_setTarget(anchorClass[\'target\']);
                                                                        } else if (document.ltargetform.ltarget && document.getElementById(\'ltargetrow\').style.display == \'none\') {
                                                                                        // Reset target to default if field is not displayed and class has no configured target
-                                                                               document.ltargetform.ltarget.value = \'' . ($this->defaultLinkTarget ? $this->defaultLinkTarget : '') . '\';
+                                                                               document.ltargetform.ltarget.value = \'' . ($this->defaultLinkTarget ?: '') . '\';
                                                                                browse_links_setTarget(document.ltargetform.ltarget.value);
                                                                        }
                                                                        break;
@@ -924,7 +924,7 @@ class BrowseLinks extends \TYPO3\CMS\Recordlist\Browser\ElementBrowser {
         * @todo Define visibility
         */
        public function addTitleSelector() {
-               $title = $this->setTitle ? $this->setTitle : ($this->setClass || !$this->classesAnchorDefault[$this->act] ? '' : $this->classesAnchorDefaultTitle[$this->act]);
+               $title = $this->setTitle ?: ($this->setClass || !$this->classesAnchorDefault[$this->act] ? '' : $this->classesAnchorDefaultTitle[$this->act]);
                $readOnly = $this->buttonConfig['properties.']['title.']['readOnly'] || $this->buttonConfig[$this->act . '.']['properties.']['title.']['readOnly'];
                if ($readOnly) {
                        $title = $this->setClass ? $this->classesAnchorClassTitle[$this->setClass] : $this->classesAnchorDefaultTitle[$this->act];
index f5ea15d..a1407d3 100644 (file)
@@ -128,7 +128,7 @@ class FrontendRteController extends \TYPO3\CMS\Rtehtmlarea\RteHtmlAreaBase {
                // Get the path to this extension:
                $this->extHttpPath = \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::siteRelPath($this->ID);
                // Get the site URL
-               $this->siteURL = $GLOBALS['TSFE']->absRefPrefix ? $GLOBALS['TSFE']->absRefPrefix : '';
+               $this->siteURL = $GLOBALS['TSFE']->absRefPrefix ?: '';
                // Get the host URL
                $this->hostURL = '';
                // Element ID + pid
@@ -172,7 +172,7 @@ class FrontendRteController extends \TYPO3\CMS\Rtehtmlarea\RteHtmlAreaBase {
                if ($this->language == 'default' || !$this->language) {
                        $this->language = 'en';
                }
-               $this->contentLanguageUid = $row['sys_language_uid'] > 0 ? $row['sys_language_uid'] : 0;
+               $this->contentLanguageUid = max($row['sys_language_uid'], 0);
                if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('static_info_tables')) {
                        if ($this->contentLanguageUid) {
                                $tableA = 'sys_language';
@@ -189,7 +189,7 @@ class FrontendRteController extends \TYPO3\CMS\Rtehtmlarea\RteHtmlAreaBase {
                                        $this->contentTypo3Language = strtolower(trim($languageRow['lg_typo3']));
                                }
                        } else {
-                               $this->contentISOLanguage = $GLOBALS['TSFE']->sys_language_isocode ? $GLOBALS['TSFE']->sys_language_isocode : 'en';
+                               $this->contentISOLanguage = $GLOBALS['TSFE']->sys_language_isocode ?: 'en';
                                $selectFields = 'lg_iso_2, lg_typo3';
                                $tableAB = 'static_languages';
                                $whereClause = 'lg_iso_2 = ' . $TYPO3_DB->fullQuoteStr(strtoupper($this->contentISOLanguage), $tableAB);
@@ -199,18 +199,18 @@ class FrontendRteController extends \TYPO3\CMS\Rtehtmlarea\RteHtmlAreaBase {
                                }
                        }
                }
-               $this->contentISOLanguage = $this->contentISOLanguage ? $this->contentISOLanguage : ($GLOBALS['TSFE']->sys_language_isocode ? $GLOBALS['TSFE']->sys_language_isocode : 'en');
-               $this->contentTypo3Language = $this->contentTypo3Language ? $this->contentTypo3Language : $GLOBALS['TSFE']->lang;
+               $this->contentISOLanguage = $this->contentISOLanguage ?: ($GLOBALS['TSFE']->sys_language_isocode ?: 'en');
+               $this->contentTypo3Language = $this->contentTypo3Language ?: $GLOBALS['TSFE']->lang;
                if ($this->contentTypo3Language == 'default') {
                        $this->contentTypo3Language = 'en';
                }
                // Character set
                $this->charset = $TSFE->renderCharset;
-               $this->OutputCharset = $TSFE->metaCharset ? $TSFE->metaCharset : $TSFE->renderCharset;
+               $this->OutputCharset = $TSFE->metaCharset ?: $TSFE->renderCharset;
                // Set the charset of the content
                $this->contentCharset = $TSFE->csConvObj->charSetArray[$this->contentTypo3Language];
-               $this->contentCharset = $this->contentCharset ? $this->contentCharset : 'utf-8';
-               $this->contentCharset = trim($TSFE->config['config']['metaCharset']) ? trim($TSFE->config['config']['metaCharset']) : $this->contentCharset;
+               $this->contentCharset = $this->contentCharset ?: 'utf-8';
+               $this->contentCharset = trim($TSFE->config['config']['metaCharset']) ?: $this->contentCharset;
                /* =======================================
                 * TOOLBAR CONFIGURATION
                 * =======================================
@@ -237,8 +237,8 @@ class FrontendRteController extends \TYPO3\CMS\Rtehtmlarea\RteHtmlAreaBase {
                $height = $RTEHeightOverride > 0 ? $RTEHeightOverride : $height;
                $RTEHeight = $height . 'px';
                $editorWrapHeight = ($height + 2) . 'px';
-               $this->RTEWrapStyle = $this->RTEWrapStyle ? $this->RTEWrapStyle : ($this->RTEdivStyle ? $this->RTEdivStyle : 'height:' . $editorWrapHeight . '; width:' . $editorWrapWidth . ';');
-               $this->RTEdivStyle = $this->RTEdivStyle ? $this->RTEdivStyle : 'position:relative; left:0px; top:0px; height:' . $RTEHeight . '; width:' . $RTEWidth . '; border: 1px solid black;';
+               $this->RTEWrapStyle = $this->RTEWrapStyle ?: ($this->RTEdivStyle ?: 'height:' . $editorWrapHeight . '; width:' . $editorWrapWidth . ';');
+               $this->RTEdivStyle = $this->RTEdivStyle ?: 'position:relative; left:0px; top:0px; height:' . $RTEHeight . '; width:' . $RTEWidth . '; border: 1px solid black;';
                /* =======================================
                 * LOAD JS, CSS and more
                 * =======================================
index 46cb67b..0a03305 100644 (file)
@@ -164,9 +164,9 @@ class SpellCheckingController {
                // Setting start time
                $time_start = microtime(TRUE);
                $this->pspell_is_available = in_array('pspell', get_loaded_extensions());
-               $this->AspellDirectory = trim($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$this->extKey]['plugins']['SpellChecker']['AspellDirectory']) ? trim($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$this->extKey]['plugins']['SpellChecker']['AspellDirectory']) : '/usr/bin/aspell';
+               $this->AspellDirectory = trim($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$this->extKey]['plugins']['SpellChecker']['AspellDirectory']) ?: '/usr/bin/aspell';
                // Setting command mode if requested and available
-               $this->forceCommandMode = trim($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$this->extKey]['plugins']['SpellChecker']['forceCommandMode']) ? trim($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$this->extKey]['plugins']['SpellChecker']['forceCommandMode']) : 0;
+               $this->forceCommandMode = trim($GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$this->extKey]['plugins']['SpellChecker']['forceCommandMode']) ?: 0;
                if (!$this->pspell_is_available || $this->forceCommandMode) {
                        $AspellVersionString = explode('Aspell', shell_exec($this->AspellDirectory . ' -v'));
                        $AspellVersion = substr($AspellVersionString[1], 0, 4);
index 1e5a5f0..0296860 100644 (file)
@@ -163,7 +163,7 @@ class Acronym extends \TYPO3\CMS\Rtehtmlarea\RteHtmlAreaApi {
                                }
                                $pageTree .= $pageTreePrefix . $queryGenerator->getTreeList($val, $recursive, ($begin = 0), $perms_clause);
                        }
-                       $whereClause .= ' AND ' . $tableA . '.pid IN (' . $GLOBALS['TYPO3_DB']->fullQuoteStr(($pageTree ? $pageTree : ''), $tableA) . ')';
+                       $whereClause .= ' AND ' . $tableA . '.pid IN (' . $GLOBALS['TYPO3_DB']->fullQuoteStr(($pageTree ?: ''), $tableA) . ')';
                }
                // Restrict to acronyms applicable to the language of current content element
                if ($this->htmlAreaRTE->contentLanguageUid > -1) {
index d0fb590..c8b6c96 100644 (file)
@@ -89,7 +89,7 @@ class CopyPaste extends \TYPO3\CMS\Rtehtmlarea\RteHtmlAreaApi {
                $registerRTEinJavascriptString = '';
                $button = 'paste';
                if ($this->htmlAreaRTE->client['browser'] == 'gecko') {
-                       $mozillaAllowClipboardURL = $this->thisConfig['buttons.'][$button . '.']['mozillaAllowClipboardURL'] ? $this->thisConfig['buttons.'][$button . '.']['mozillaAllowClipboardURL'] : $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$this->extensionKey]['plugins']['CopyPaste']['mozillaAllowClipboardURL'];
+                       $mozillaAllowClipboardURL = $this->thisConfig['buttons.'][$button . '.']['mozillaAllowClipboardURL'] ?: $GLOBALS['TYPO3_CONF_VARS']['EXTCONF'][$this->extensionKey]['plugins']['CopyPaste']['mozillaAllowClipboardURL'];
                        if ($mozillaAllowClipboardURL) {
                                if (!is_array($this->thisConfig['buttons.']) || !is_array($this->thisConfig['buttons.'][($button . '.')])) {
                                        $registerRTEinJavascriptString .= '
index c519538..183fc78 100644 (file)
@@ -80,7 +80,7 @@ class Typo3HtmlParser extends \TYPO3\CMS\Rtehtmlarea\RteHtmlAreaApi {
                        }
                        $registerRTEinJavascriptString .= '
                        RTEarea[' . $RTEcounter . '].buttons.' . $button . '.pathParseHtmlModule = "' . $this->htmlAreaRTE->extHttpPath . 'mod6/parse_html.php";
-                       RTEarea[' . $RTEcounter . '].buttons.' . $button . '.hotKey = "' . ($this->thisConfig['enableWordClean.']['hotKey'] ? $this->thisConfig['enableWordClean.']['hotKey'] : '0') . '";';
+                       RTEarea[' . $RTEcounter . '].buttons.' . $button . '.hotKey = "' . ($this->thisConfig['enableWordClean.']['hotKey'] ?: '0') . '";';
                }
                return $registerRTEinJavascriptString;
        }
index bbb337e..a40b399 100644 (file)
@@ -91,7 +91,7 @@ class SoftReferenceHook extends \TYPO3\CMS\Core\Database\SoftReferenceIndex {
                                        $imgTags[$k] = str_replace('data-htmlarea-file-uid="' . $fileUid . '"', 'data-htmlarea-file-uid="{softref:' . $tokenID . '}"', $imgTags[$k]);
                                        $elements[$k]['subst'] = array(
                                                'type' => 'db',
-                                               'recordRef' => ($fileTable ? $fileTable : 'sys_file') . ':' . $fileUid,
+                                               'recordRef' => ($fileTable ?: 'sys_file') . ':' . $fileUid,
                                                'tokenID' => $tokenID,
                                                'tokenValue' => $fileUid
                                        );
index f138349..beb2944 100644 (file)
@@ -409,7 +409,7 @@ class RteHtmlAreaBase extends \TYPO3\CMS\Backend\Rte\AbstractRte {
                        }
                        $this->contentTypo3Language = $this->language == 'en' ? 'default' : $this->language;
                        $this->contentISOLanguage = 'en';
-                       $this->contentLanguageUid = $row['sys_language_uid'] > 0 ? $row['sys_language_uid'] : 0;
+                       $this->contentLanguageUid = max($row['sys_language_uid'], 0);
                        if (\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('static_info_tables')) {
                                if ($this->contentLanguageUid) {
                                        $tableA = 'sys_language';
@@ -426,7 +426,7 @@ class RteHtmlAreaBase extends \TYPO3\CMS\Backend\Rte\AbstractRte {
                                                $this->contentTypo3Language = trim($languageRow['lg_typo3']) ? strtolower(trim($languageRow['lg_typo3'])) : 'default';
                                        }
                                } else {
-                                       $this->contentISOLanguage = trim($this->thisConfig['defaultContentLanguage']) ? trim($this->thisConfig['defaultContentLanguage']) : 'en';
+                                       $this->contentISOLanguage = trim($this->thisConfig['defaultContentLanguage']) ?: 'en';
                                        $selectFields = 'lg_iso_2, lg_typo3';
                                        $tableAB = 'static_languages';
                                        $whereClause = 'lg_iso_2 = ' . $TYPO3_DB->fullQuoteStr(strtoupper($this->contentISOLanguage), $tableAB);
@@ -559,7 +559,7 @@ class RteHtmlAreaBase extends \TYPO3\CMS\Backend\Rte\AbstractRte {
         */
        protected function addSkin() {
                // Get skin file name from Page TSConfig if any
-               $skinFilename = trim($this->thisConfig['skin']) ? trim($this->thisConfig['skin']) : 'EXT:' . $this->ID . '/htmlarea/skins/default/htmlarea.css';
+               $skinFilename = trim($this->thisConfig['skin']) ?: 'EXT:' . $this->ID . '/htmlarea/skins/default/htmlarea.css';
                $this->editorCSS = $this->getFullFileName($skinFilename);
                $skinDir = dirname($this->editorCSS);
                // Editing area style sheet
@@ -685,7 +685,7 @@ class RteHtmlAreaBase extends \TYPO3\CMS\Backend\Rte\AbstractRte {
                                $this->defaultToolbarOrder = $plugin->addButtonsToToolbar();
                        }
                }
-               $toolbarOrder = $this->thisConfig['toolbarOrder'] ? $this->thisConfig['toolbarOrder'] : $this->defaultToolbarOrder;
+               $toolbarOrder = $this->thisConfig['toolbarOrder'] ?: $this->defaultToolbarOrder;
                // Getting rid of undefined buttons
                $this->toolbarOrderArray = array_intersect(GeneralUtility::trimExplode(',', $toolbarOrder, TRUE), GeneralUtility::trimExplode(',', $this->defaultToolbarOrder, TRUE));
                $toolbarOrder = array_unique(array_values($this->toolbarOrderArray));
@@ -892,7 +892,7 @@ class RteHtmlAreaBase extends \TYPO3\CMS\Backend\Rte\AbstractRte {
                        RTEarea[editornumber].RTEWidthOverride = "' . (is_object($GLOBALS['BE_USER']) && isset($GLOBALS['BE_USER']->uc['rteWidth']) && trim($GLOBALS['BE_USER']->uc['rteWidth']) ? trim($GLOBALS['BE_USER']->uc['rteWidth']) : trim($this->thisConfig['RTEWidthOverride'])) . '";
                        RTEarea[editornumber].RTEHeightOverride = "' . (is_object($GLOBALS['BE_USER']) && isset($GLOBALS['BE_USER']->uc['rteHeight']) && intval($GLOBALS['BE_USER']->uc['rteHeight']) ? intval($GLOBALS['BE_USER']->uc['rteHeight']) : intval($this->thisConfig['RTEHeightOverride'])) . '";
                        RTEarea[editornumber].resizable = ' . (is_object($GLOBALS['BE_USER']) && isset($GLOBALS['BE_USER']->uc['rteResize']) && $GLOBALS['BE_USER']->uc['rteResize'] ? 'true' : (trim($this->thisConfig['rteResize']) ? 'true' : 'false')) . ';
-                       RTEarea[editornumber].maxHeight = "' . (is_object($GLOBALS['BE_USER']) && isset($GLOBALS['BE_USER']->uc['rteMaxHeight']) && intval($GLOBALS['BE_USER']->uc['rteMaxHeight']) ? trim($GLOBALS['BE_USER']->uc['rteMaxHeight']) : (intval($this->thisConfig['rteMaxHeight']) ? intval($this->thisConfig['rteMaxHeight']) : '2000')) . '";
+                       RTEarea[editornumber].maxHeight = "' . (is_object($GLOBALS['BE_USER']) && isset($GLOBALS['BE_USER']->uc['rteMaxHeight']) && intval($GLOBALS['BE_USER']->uc['rteMaxHeight']) ? trim($GLOBALS['BE_USER']->uc['rteMaxHeight']) : (intval($this->thisConfig['rteMaxHeight']) ?: '2000')) . '";
                        RTEarea[editornumber].fullScreen = ' . ($this->fullScreen ? 'true' : 'false') . ';
                        RTEarea[editornumber].showStatusBar = ' . (trim($this->thisConfig['showStatusBar']) ? 'true' : 'false') . ';
                        RTEarea[editornumber].enableWordClean = ' . (trim($this->thisConfig['enableWordClean']) ? 'true' : 'false') . ';
index 5a758f8..921442d 100644 (file)
@@ -183,7 +183,7 @@ class SelectImage extends \TYPO3\CMS\Recordlist\Browser\ElementBrowser {
         * @return      string          the path to the folder where RTE images are stored
         */
        protected function getRTEImageStorageDir() {
-               return $this->imgPath ? $this->imgPath : $GLOBALS['TYPO3_CONF_VARS']['BE']['RTE_imageStorageDir'];
+               return $this->imgPath ?: $GLOBALS['TYPO3_CONF_VARS']['BE']['RTE_imageStorageDir'];
        }
 
        /**
index afbd475..f459469 100644 (file)
@@ -234,7 +234,7 @@ class User {
                                                                if (!$v[($k2i . '.')]['dontInsertSiteUrl']) {
                                                                        $v[$k2i . '.']['content'] = str_replace('###_URL###', $this->siteUrl, $v[$k2i . '.']['content']);
                                                                }
-                                                               $logo = $v[$k2i . '.']['_icon'] ? $v[$k2i . '.']['_icon'] : '';
+                                                               $logo = $v[$k2i . '.']['_icon'] ?: '';
                                                                $onClickEvent = '';
                                                                switch ((string) $v[($k2i . '.')]['mode']) {
                                                                        case 'wrap':
index da34352..32e8d5d 100644 (file)
@@ -156,7 +156,7 @@ $TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['plugins']['TextStyle'] = array();
 $TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['plugins']['TextStyle']['objectReference'] = '&TYPO3\\CMS\\Rtehtmlarea\\Extension\\TextStyle';
 
 // Enable images and add default Page TS Config RTE configuration for enabling images with the Minimal and Typical default configuration
-$TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['enableImages'] = $_EXTCONF['enableImages'] ? $_EXTCONF['enableImages'] : 0;
+$TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['enableImages'] = $_EXTCONF['enableImages'] ?: 0;
 if ($TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['defaultConfiguration'] == 'Demo') {
        $TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['enableImages'] = 1;
 }
@@ -187,7 +187,7 @@ $TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['plugins']['TYPO3Link']['disableInFE'] = 1
 $TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['plugins']['TYPO3Link']['additionalAttributes'] = 'rel';
 
 // Add default Page TS Config RTE configuration for enabling links accessibility icons
-$TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['enableAccessibilityIcons'] = $_EXTCONF['enableAccessibilityIcons'] ? $_EXTCONF['enableAccessibilityIcons'] : 0;
+$TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['enableAccessibilityIcons'] = $_EXTCONF['enableAccessibilityIcons'] ?: 0;
 if ($TYPO3_CONF_VARS['EXTCONF'][$_EXTKEY]['enableAccessibilityIcons']) {
        \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig('<INCLUDE_TYPOSCRIPT: source="FILE:EXT:' . $_EXTKEY . '/res/accessibilityicons/pageTSConfig.txt">');
        \TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addTypoScript($_EXTKEY, 'setup', '<INCLUDE_TYPOSCRIPT: source="FILE:EXT:' . $_EXTKEY . '/res/accessibilityicons/setup.txt">', 43);
index e211a80..ff3d6ee 100644 (file)
@@ -589,7 +589,7 @@ class SchedulerModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClas
                                                // If an interval or a cron command is defined, it's a recurring task
                                                // FIXME: remove magic numbers for the type, use class constants instead
                                                $taskInfo['type'] = 2;
-                                               $taskInfo['frequency'] = empty($taskInfo['interval']) ? $taskInfo['croncmd'] : $taskInfo['interval'];
+                                               $taskInfo['frequency'] = $taskInfo['interval'] ?: $taskInfo['croncmd'];
                                        } else {
                                                // It's not a recurring task
                                                // Make sure interval and cron command are both empty
index 316deb8..587818e 100644 (file)
@@ -475,7 +475,7 @@ class SetupModuleController {
                                continue;
                        }
                        $label = $this->getLabel($config['label'], $fieldName);
-                       $label = $this->getCSH($config['csh'] ? $config['csh'] : $fieldName, $label);
+                       $label = $this->getCSH($config['csh'] ?: $fieldName, $label);
                        $type = $config['type'];
                        $eval = $config['eval'];
                        $class = $config['class'];
@@ -728,11 +728,11 @@ class SetupModuleController {
                } else {
                        $out = htmlspecialchars($str);
                }
-               if (isset($this->overrideConf[$key ? $key : $str])) {
+               if (isset($this->overrideConf[$key ?: $str])) {
                        $out = '<span style="color:#999999">' . $out . '</span>';
                }
                if ($addLabelTag) {
-                       $out = '<label for="' . ($altLabelTagId ? $altLabelTagId : 'field_' . $key) . '">' . $out . '</label>';
+                       $out = '<label for="' . ($altLabelTagId ?: 'field_' . $key) . '">' . $out . '</label>';
                }
                return $out;
        }
index 16e0987..c25562f 100644 (file)
@@ -130,9 +130,9 @@ class ServicesListReport implements \TYPO3\CMS\Reports\ReportInterface {
                if (!empty($serviceInformation['description'])) {
                        $serviceDescription .= '<p class="service-description">' . $serviceInformation['description'] . '</p>';
                }
-               $serviceSubtypes = empty($serviceInformation['serviceSubTypes']) ? '-' : implode(', ', $serviceInformation['serviceSubTypes']);
-               $serviceOperatingSystem = empty($serviceInformation['os']) ? $GLOBALS['LANG']->getLL('any') : $serviceInformation['os'];
-               $serviceRequiredExecutables = empty($serviceInformation['exec']) ? '-' : $serviceInformation['exec'];
+               $serviceSubtypes = $serviceInformation['serviceSubTypes'] ? implode(', ', $serviceInformation['serviceSubTypes']) : '-';
+               $serviceOperatingSystem = $serviceInformation['os'] ?: $GLOBALS['LANG']->getLL('any');
+               $serviceRequiredExecutables = $serviceInformation['exec'] ?: '-';
                $serviceAvailabilityClass = 'typo3-message message-error';
                $serviceAvailable = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_common.xlf:no');
                try {
index 6d08916..c9939bb 100644 (file)
@@ -160,7 +160,7 @@ class ActionTask implements \TYPO3\CMS\Taskcenter\TaskInterface {
                        $res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('*', 'sys_action', '', '', 'sys_action.sorting');
                } else {
                        // Editors can only see the actions which are assigned to a usergroup they belong to
-                       $additionalWhere = 'be_groups.uid IN (' . ($GLOBALS['BE_USER']->groupList ? $GLOBALS['BE_USER']->groupList : 0) . ')';
+                       $additionalWhere = 'be_groups.uid IN (' . ($GLOBALS['BE_USER']->groupList ?: 0) . ')';
                        $res = $GLOBALS['TYPO3_DB']->exec_SELECT_mm_query('sys_action.*', 'sys_action', 'sys_action_asgr_mm', 'be_groups', ' AND sys_action.hidden=0 AND ' . $additionalWhere, 'sys_action.uid', 'sys_action.sorting');
                }
                while ($actionRow = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res)) {
index b93f952..a01e76e 100644 (file)
@@ -112,7 +112,7 @@ class TypoScriptTemplateInfoHook {
                        // If given use the requested template_uid
                        // if not, use the first template-record on the page (in this case there should only be one record!)
                        $set = \TYPO3\CMS\Core\Utility\GeneralUtility::_GP('SET');
-                       $template_uid = $set['templatesOnPage'] ? $set['templatesOnPage'] : 0;
+                       $template_uid = $set['templatesOnPage'] ?: 0;
                        // Defined global here!
                        $tmpl = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Core\\TypoScript\\ExtendedTemplateService');
                        // Do not log time-performance information
@@ -122,7 +122,7 @@ class TypoScriptTemplateInfoHook {
                        $tplRow = $tmpl->ext_getFirstTemplate($pageId, $template_uid);
                        $existTemplate = is_array($tplRow) ? TRUE : FALSE;
                        if ($existTemplate) {
-                               $saveId = $tplRow['_ORIG_uid'] ? $tplRow['_ORIG_uid'] : $tplRow['uid'];
+                               $saveId = $tplRow['_ORIG_uid'] ?: $tplRow['uid'];
                                // Update template ?
                                $POST = \TYPO3\CMS\Core\Utility\GeneralUtility::_POST();
                                if ($POST['submit']) {
index 84ba35a..85a64f2 100644 (file)
@@ -234,7 +234,7 @@ class TaskModuleController extends \TYPO3\CMS\Backend\Module\BaseScriptClass {
                                                $icon = $item['icon'];
                                        }
                                }
-                               $description = !empty($item['descriptionHtml']) ? $item['descriptionHtml'] : '<p>' . nl2br(htmlspecialchars($item['description'])) . '</p>';
+                               $description = $item['descriptionHtml'] ?: '<p>' . nl2br(htmlspecialchars($item['description'])) . '</p>';
                                $id = $this->getUniqueKey($item['uid']);
                                // Collapsed & expanded menu items
                                if ($mainMenu && isset($GLOBALS['BE_USER']->uc['taskcenter']['states'][$id]) && $GLOBALS['BE_USER']->uc['taskcenter']['states'][$id]) {
index 3482a8b..9b969b1 100644 (file)
@@ -140,7 +140,7 @@ class WorkspaceService implements \TYPO3\CMS\Core\SingletonInterface {
                                }
                        }
                        // Select all versions to swap:
-                       $versions = $this->selectVersionsInWorkspace($wsid, 0, $stage, $pageId ? $pageId : -1, 0, 'tables_modify', $language);
+                       $versions = $this->selectVersionsInWorkspace($wsid, 0, $stage, $pageId ?: -1, 0, 'tables_modify', $language);
                        // Traverse the selection to build CMD array:
                        foreach ($versions as $table => $records) {
                                foreach ($records as $rec) {
@@ -168,7 +168,7 @@ class WorkspaceService implements \TYPO3\CMS\Core\SingletonInterface {
                        // Define stage to select:
                        $stage = -99;
                        // Select all versions to swap:
-                       $versions = $this->selectVersionsInWorkspace($wsid, 0, $stage, $pageId ? $pageId : -1, 0, 'tables_modify', $language);
+                       $versions = $this->selectVersionsInWorkspace($wsid, 0, $stage, $pageId ?: -1, 0, 'tables_modify', $language);
                        // Traverse the selection to build CMD array:
                        foreach ($versions as $table => $records) {
                                foreach ($records as $rec) {