[TASK] Refactor core usages of testInt, calcPriority, calcParenthesis
authorSusanne Moog <typo3@susannemoog.de>
Mon, 11 Jul 2011 20:21:52 +0000 (22:21 +0200)
committerChristian Kuhn <lolli@schwarzbu.ch>
Mon, 11 Jul 2011 20:55:03 +0000 (22:55 +0200)
As testInt, calcPriority and calcParenthesis were moved and renamed to
t3lib_utility_Math we have to change the core usages, too.

Change-Id: Ia828ffbdf92dc72d35a1d3f5919869d043e3bb83
Depends: #28064
Resolves: #28096
Reviewed-on: http://review.typo3.org/3260
Reviewed-by: Xavier Perseguers
Tested-by: Xavier Perseguers
Reviewed-by: Christian Kuhn
Tested-by: Christian Kuhn
53 files changed:
t3lib/class.t3lib_arraybrowser.php
t3lib/class.t3lib_befunc.php
t3lib/class.t3lib_cli.php
t3lib/class.t3lib_clipboard.php
t3lib/class.t3lib_compressor.php
t3lib/class.t3lib_loaddbgroup.php
t3lib/class.t3lib_parsehtml.php
t3lib/class.t3lib_parsehtml_proc.php
t3lib/class.t3lib_refindex.php
t3lib/class.t3lib_softrefproc.php
t3lib/class.t3lib_tceforms.php
t3lib/class.t3lib_tceforms_inline.php
t3lib/class.t3lib_tcemain.php
t3lib/class.t3lib_timetrack.php
t3lib/class.t3lib_tsparser_ext.php
t3lib/class.t3lib_tstemplate.php
t3lib/matchcondition/class.t3lib_matchcondition_abstract.php
t3lib/search/class.t3lib_search_livesearch.php
t3lib/utility/class.t3lib_utility_math.php
tests/t3lib/class.t3lib_divTest.php
typo3/alt_doc.php
typo3/alt_shortcut.php
typo3/backend.php
typo3/class.browse_links.php
typo3/class.db_list.inc
typo3/classes/class.shortcutmenu.php
typo3/init.php
typo3/sysext/beuser/mod/index.php
typo3/sysext/cms/layout/db_layout.php
typo3/sysext/cms/tslib/class.tslib_content.php
typo3/sysext/cms/tslib/class.tslib_fe.php
typo3/sysext/cms/tslib/class.tslib_menu.php
typo3/sysext/cms/tslib/class.tslib_pagegen.php
typo3/sysext/cms/tslib/class.tslib_pibase.php
typo3/sysext/cms/tslib/content/class.tslib_content_form.php
typo3/sysext/cms/tslib/content/class.tslib_content_searchresult.php
typo3/sysext/cms/tslib/index_ts.php
typo3/sysext/cms/tslib/media/scripts/fe_adminLib.inc
typo3/sysext/em/classes/tools/class.tx_em_tools.php
typo3/sysext/feedit/view/class.tx_feedit_editpanel.php
typo3/sysext/impexp/class.tx_impexp.php
typo3/sysext/install/mod/class.tx_install.php
typo3/sysext/recycler/classes/model/class.tx_recycler_model_deletedRecords.php
typo3/sysext/rsaauth/sv1/storage/class.tx_rsaauth_split_storage.php
typo3/sysext/statictemplates/media/scripts/fe_adminLib.inc
typo3/sysext/tstemplate/ts/index.php
typo3/sysext/tstemplate_ceditor/class.tx_tstemplateceditor.php
typo3/sysext/tstemplate_info/class.tx_tstemplateinfo.php
typo3/sysext/tstemplate_objbrowser/class.tx_tstemplateobjbrowser.php
typo3/wizard_add.php
typo3/wizard_edit.php
typo3/wizard_forms.php
typo3/wizard_table.php

index 53f2e63..7d231dd 100644 (file)
@@ -156,7 +156,7 @@ class t3lib_arrayBrowser {
                        // If varname is set:
                if ($this->varName && !$this->dontLinkVar) {
                        $variableName = $this->varName . '[\'' . str_replace('.', '\'][\'', $depth) . '\'] = ' .
-                               (!t3lib_div::testInt($theValue) ? '\'' . addslashes($theValue) . '\'' : $theValue) . '; ';
+                               (!t3lib_utility_Math::canBeInterpretedAsInteger($theValue) ? '\'' . addslashes($theValue) . '\'' : $theValue) . '; ';
                        $label = '<a href="index.php?varname=' . urlencode($variableName) . '#varname">' . $label . '</a>';
                }
 
index 03330f5..42b7ec9 100644 (file)
@@ -964,7 +964,7 @@ final class t3lib_BEfunc {
 
                                // If there is a srcPointer value:
                        if ($srcPointer) {
-                               if (t3lib_div::testInt($srcPointer)) { // If integer, then its a record we will look up:
+                               if (t3lib_utility_Math::canBeInterpretedAsInteger($srcPointer)) { // If integer, then its a record we will look up:
                                        list($tName, $fName) = explode(':', $ds_tableField, 2);
                                        if ($tName && $fName && is_array($GLOBALS['TCA'][$tName])) {
                                                $dataStructRec = self::getRecord($tName, $srcPointer);
@@ -1939,7 +1939,7 @@ final class t3lib_BEfunc {
         */
        public static function getRecordTitlePrep($title, $titleLength = 0) {
                        // If $titleLength is not a valid positive integer, use BE_USER->uc['titleLen']:
-               if (!$titleLength || !t3lib_div::testInt($titleLength) || $titleLength < 0) {
+               if (!$titleLength || !t3lib_utility_Math::canBeInterpretedAsInteger($titleLength) || $titleLength < 0) {
                        $titleLength = $GLOBALS['BE_USER']->uc['titleLen'];
                }
                $titleOrig = htmlspecialchars($title);
@@ -3294,7 +3294,7 @@ final class t3lib_BEfunc {
         */
        public static function getTSconfig_pidValue($table, $uid, $pid) {
 
-               if (t3lib_div::testInt($pid)) { // If pid is an integer this takes precedence in our lookup.
+               if (t3lib_utility_Math::canBeInterpretedAsInteger($pid)) { // If pid is an integer this takes precedence in our lookup.
                        $thePidValue = intval($pid);
                        if ($thePidValue < 0) { // If ref to another record, look that record up.
                                $pidRec = self::getRecord($table, abs($thePidValue), 'pid');
@@ -3336,7 +3336,7 @@ final class t3lib_BEfunc {
         * @see t3lib_TCEforms::getTSCpid()
         */
        public static function getPidForModTSconfig($table, $uid, $pid) {
-               $retVal = ($table == 'pages' && t3lib_div::testInt($uid)) ? $uid : $pid;
+               $retVal = ($table == 'pages' && t3lib_utility_Math::canBeInterpretedAsInteger($uid)) ? $uid : $pid;
                return $retVal;
        }
 
index 2c8bee0..f6c6d1c 100644 (file)
@@ -120,7 +120,7 @@ class t3lib_cli {
                $cli_options = array();
                $index = '_DEFAULT';
                foreach ($_SERVER['argv'] as $token) {
-                       if ($token{0} === '-' && !t3lib_div::testInt($token{1})) { // Options starting with a number is invalid - they could be negative values... !
+                       if ($token{0} === '-' && !t3lib_utility_Math::canBeInterpretedAsInteger($token{1})) { // Options starting with a number is invalid - they could be negative values... !
                                list($index, $opt) = explode('=', $token, 2);
                                if (isset($cli_options[$index])) {
                                        echo 'ERROR: Option ' . $index . ' was used twice!' . LF;
index 27b07e4..308f691 100644 (file)
@@ -91,7 +91,7 @@ class t3lib_clipboard {
 
                        // NumberTabs
                $clNP = $GLOBALS['BE_USER']->getTSConfigVal('options.clipboardNumberPads');
-               if (t3lib_div::testInt($clNP) && $clNP >= 0) {
+               if (t3lib_utility_Math::canBeInterpretedAsInteger($clNP) && $clNP >= 0) {
                        $this->numberTabs = t3lib_utility_Math::forceIntegerInRange($clNP, 0, 20);
                }
 
index 2514fb9..666c717 100644 (file)
@@ -75,7 +75,7 @@ class t3lib_Compressor {
                if (extension_loaded('zlib') && $compressionLevel) {
                        $this->createGzipped = TRUE;
                                // $compressionLevel can also be TRUE
-                       if (t3lib_div::testInt($compressionLevel)) {
+                       if (t3lib_utility_Math::canBeInterpretedAsInteger($compressionLevel)) {
                                $this->gzipCompressionLevel = intval($compressionLevel);
                        }
                }
index 4c40f58..12912c3 100644 (file)
@@ -191,7 +191,7 @@ class t3lib_loadDBGroup {
                                $theID = strrev($parts[0]);
 
                                        // Check that the id IS an integer:
-                               if (t3lib_div::testInt($theID)) {
+                               if (t3lib_utility_Math::canBeInterpretedAsInteger($theID)) {
                                                // Get the table name: If a part of the exploded string, use that. Otherwise if the id number is LESS than zero, use the second table, otherwise the first table
                                        $theTable = trim($parts[1]) ? strrev(trim($parts[1])) : ($this->secondTable && $theID < 0 ? $this->secondTable : $this->firstTable);
                                                // If the ID is not blank and the table name is among the names in the inputted tableList, then proceed:
@@ -591,9 +591,9 @@ class t3lib_loadDBGroup {
                $foreign_table_field = $conf['foreign_table_field'];
 
                        // if there are table items and we have a proper $parentUid
-               if (t3lib_div::testInt($parentUid) && count($this->tableArray)) {
+               if (t3lib_utility_Math::canBeInterpretedAsInteger($parentUid) && count($this->tableArray)) {
                                // if updateToUid is not a positive integer, set it to '0', so it will be ignored
-                       if (!(t3lib_div::testInt($updateToUid) && $updateToUid > 0)) {
+                       if (!(t3lib_utility_Math::canBeInterpretedAsInteger($updateToUid) && $updateToUid > 0)) {
                                $updateToUid = 0;
                        }
 
@@ -728,7 +728,7 @@ class t3lib_loadDBGroup {
                                $theID = strrev($parts[0]);
                                $theTable = strrev($parts[1]);
 
-                               if (t3lib_div::testInt($theID) && (!$theTable || !strcmp($theTable, $fTable) || !strcmp($theTable, $nfTable))) {
+                               if (t3lib_utility_Math::canBeInterpretedAsInteger($theID) && (!$theTable || !strcmp($theTable, $fTable) || !strcmp($theTable, $nfTable))) {
                                        $valueArray[$key] = $theTable && strcmp($theTable, $fTable) ? $theID * -1 : $theID;
                                }
                        }
@@ -837,7 +837,7 @@ class t3lib_loadDBGroup {
         * @return      boolean         Returns TRUE if looking from the symmetric ("other") side to the relation.
         */
        function isOnSymmetricSide($parentUid, $parentConf, $childRec) {
-               return t3lib_div::testInt($childRec['uid']) && $parentConf['symmetric_field'] && $parentUid == $childRec[$parentConf['symmetric_field']]
+               return t3lib_utility_Math::canBeInterpretedAsInteger($childRec['uid']) && $parentConf['symmetric_field'] && $parentUid == $childRec[$parentConf['symmetric_field']]
                                ? TRUE
                                : FALSE;
        }
index dbce62a..49eaa07 100644 (file)
@@ -1224,7 +1224,7 @@ class t3lib_parsehtml {
                        } else {
                                $attr = $meta[$k]['origTag'] ? $meta[$k]['origTag'] : $k;
                                if (strcmp($v, '') || isset($meta[$k]['dashType'])) {
-                                       $dash = $meta[$k]['dashType'] ? $meta[$k]['dashType'] : (t3lib_div::testInt($v) ? '' : '"');
+                                       $dash = $meta[$k]['dashType'] ? $meta[$k]['dashType'] : (t3lib_utility_Math::canBeInterpretedAsInteger($v) ? '' : '"');
                                        $attr .= '=' . $dash . $v . $dash;
                                }
                        }
index a9e8d43..29b59b8 100644 (file)
@@ -658,7 +658,7 @@ class t3lib_parsehtml_proc extends t3lib_parsehtml {
                                                        $idPart = $this->recPid;
                                                } // If no id or alias is given, set it to class record pid
                                                        // Checking if the id-parameter is an alias.
-                                               if (!t3lib_div::testInt($idPart)) {
+                                               if (!t3lib_utility_Math::canBeInterpretedAsInteger($idPart)) {
                                                        list($idPartR) = t3lib_BEfunc::getRecordsByField('pages', 'alias', $idPart);
                                                        $idPart = intval($idPartR['uid']);
                                                }
index af7a431..39c94b3 100644 (file)
@@ -200,7 +200,7 @@ class t3lib_refindex {
                                        // Word indexing:
                                t3lib_div::loadTCA($table);
                                foreach ($GLOBALS['TCA'][$table]['columns'] as $field => $conf) {
-                                       if (t3lib_div::inList('input,text', $conf['config']['type']) && strcmp($record[$field], '') && !t3lib_div::testInt($record[$field])) {
+                                       if (t3lib_div::inList('input,text', $conf['config']['type']) && strcmp($record[$field], '') && !t3lib_utility_Math::canBeInterpretedAsInteger($record[$field])) {
                                                $this->words_strings[$field] = $record[$field];
                                        }
                                }
index deade1d..e280e70 100644 (file)
@@ -658,7 +658,7 @@ class t3lib_softrefproc {
 
                                        // Checking if the id-parameter is an alias.
                                if (strlen($link_param)) {
-                                       if (!t3lib_div::testInt($link_param)) {
+                                       if (!t3lib_utility_Math::canBeInterpretedAsInteger($link_param)) {
                                                $finalTagParts['alias'] = $link_param;
                                                $link_param = $this->getPageIdFromAlias($link_param);
                                        }
@@ -751,7 +751,7 @@ class t3lib_softrefproc {
 
                                        // Add anchor if applicable
                                if (strlen($tLP['anchor'])) {
-                                       if (t3lib_div::testInt($tLP['anchor'])) { // Anchor is assumed to point to a content elements:
+                                       if (t3lib_utility_Math::canBeInterpretedAsInteger($tLP['anchor'])) { // Anchor is assumed to point to a content elements:
                                                        // Initialize a new entry because we have a new relation:
                                                $newTokenID = $this->makeTokenID('setTypoLinkPartsElement:anchor:' . $idx);
                                                $elements[$newTokenID . ':' . $idx] = array();
index beeaeff..19a2f74 100644 (file)
@@ -776,7 +776,7 @@ class t3lib_TCEforms {
 
                                                // If the record has been saved and the "linkTitleToSelf" is set, we make the field name into a link, which will load ONLY this field in alt_doc.php
                                        $label = t3lib_div::deHSCentities(htmlspecialchars($PA['label']));
-                                       if (t3lib_div::testInt($row['uid']) && $PA['fieldTSConfig']['linkTitleToSelf'] && !t3lib_div::_GP('columnsOnly')) {
+                                       if (t3lib_utility_Math::canBeInterpretedAsInteger($row['uid']) && $PA['fieldTSConfig']['linkTitleToSelf'] && !t3lib_div::_GP('columnsOnly')) {
                                                $lTTS_url = $this->backPath . 'alt_doc.php?edit[' . $table . '][' . $row['uid'] . ']=edit&columnsOnly=' . $field . '&returnUrl=' . rawurlencode($this->thisReturnUrl());
                                                $label = '<a href="' . htmlspecialchars($lTTS_url) . '">' . $label . '</a>';
                                        }
@@ -3091,7 +3091,7 @@ class t3lib_TCEforms {
                        if (is_array($GLOBALS['TCA'][$table]['types'][$typeNum]['bitmask_excludelist_bits'])) {
                                foreach ($GLOBALS['TCA'][$table]['types'][$typeNum]['bitmask_excludelist_bits'] as $bitKey => $eList) {
                                        $bit = substr($bitKey, 1);
-                                       if (t3lib_div::testInt($bit)) {
+                                       if (t3lib_utility_Math::canBeInterpretedAsInteger($bit)) {
                                                $bit = t3lib_utility_Math::forceIntegerInRange($bit, 0, 30);
                                                if (
                                                        (substr($bitKey, 0, 1) == '-' && !($sTValue & pow(2, $bit))) ||
@@ -3829,7 +3829,7 @@ class t3lib_TCEforms {
                                                case 'script':
                                                case 'popup':
                                                case 'colorbox':
-                                                       if (!$wConf['notNewRecords'] || t3lib_div::testInt($row['uid'])) {
+                                                       if (!$wConf['notNewRecords'] || t3lib_utility_Math::canBeInterpretedAsInteger($row['uid'])) {
 
                                                                        // Setting &P array contents:
                                                                $params = array();
@@ -6197,7 +6197,7 @@ class t3lib_TCEforms {
                }
 
                        // Convert sys_language_uid to sys_language_uid if input was in fact a string (ISO code expected then)
-               if (!t3lib_div::testInt($sys_language_uid)) {
+               if (!t3lib_utility_Math::canBeInterpretedAsInteger($sys_language_uid)) {
                        foreach ($this->cachedLanguageFlag[$mainKey] as $rUid => $cD) {
                                if ('v' . $cD['ISOcode'] === $sys_language_uid) {
                                        $sys_language_uid = $rUid;
index de1dbbc..394fda2 100644 (file)
@@ -145,7 +145,7 @@ class t3lib_TCEforms_inline {
                if (!isset($this->inlineFirstPid)) {
                                // if this record is not new, try to fetch the inlineView states
                                // @TODO: Add checking/cleaning for unused tables, records, etc. to save space in uc-field
-                       if (t3lib_div::testInt($row['uid'])) {
+                       if (t3lib_utility_Math::canBeInterpretedAsInteger($row['uid'])) {
                                $inlineView = unserialize($GLOBALS['BE_USER']->uc['inlineView']);
                                $this->inlineView = $inlineView[$table][$row['uid']];
                        }
@@ -319,7 +319,7 @@ class t3lib_TCEforms_inline {
                $this->inlineData['map'][$this->inlineNames['form']] = $this->inlineNames['object'];
 
                        // Set this variable if we handle a brand new unsaved record:
-               $isNewRecord = t3lib_div::testInt($rec['uid']) ? FALSE : TRUE;
+               $isNewRecord = t3lib_utility_Math::canBeInterpretedAsInteger($rec['uid']) ? FALSE : TRUE;
                        // Set this variable if the record is virtual and only show with header and not editable fields:
                $isVirtualRecord = (isset($rec['__virtual']) && $rec['__virtual']);
                        // If there is a selector field, normalize it:
@@ -693,7 +693,7 @@ class t3lib_TCEforms_inline {
                        $comboRecord = array();
 
                                // If record does already exist, load it:
-                       if ($rec[$foreign_selector] && t3lib_div::testInt($rec[$foreign_selector])) {
+                       if ($rec[$foreign_selector] && t3lib_utility_Math::canBeInterpretedAsInteger($rec[$foreign_selector])) {
                                $comboRecord = $this->getRecord(
                                        $this->inlineFirstPid,
                                        $comboConfig['foreign_table'],
@@ -1080,7 +1080,7 @@ class t3lib_TCEforms_inline {
                $this->fObj->pushToDynNestedStack('inline', $this->inlineNames['object']);
 
                        // dynamically create a new record using t3lib_transferData
-               if (!$foreignUid || !t3lib_div::testInt($foreignUid) || $config['foreign_selector']) {
+               if (!$foreignUid || !t3lib_utility_Math::canBeInterpretedAsInteger($foreignUid) || $config['foreign_selector']) {
                        $record = $this->getNewRecord($this->inlineFirstPid, $current['table']);
                                // Set language of new child record to the language of the parent record:
                        if ($config['localizationMode'] == 'select') {
@@ -1163,7 +1163,7 @@ class t3lib_TCEforms_inline {
         */
        protected function synchronizeLocalizeRecords($domObjectId, $type) {
                $jsonArray = FALSE;
-               if (t3lib_div::inList('localize,synchronize', $type) || t3lib_div::testInt($type)) {
+               if (t3lib_div::inList('localize,synchronize', $type) || t3lib_utility_Math::canBeInterpretedAsInteger($type)) {
                                // The current level:
                        $current = $this->inlineStructure['unstable'];
                                // The parent level:
@@ -1318,7 +1318,7 @@ class t3lib_TCEforms_inline {
                $top = $this->getStructureLevel(0);
 
                        // only do some action if the top record and the current record were saved before
-               if (t3lib_div::testInt($top['uid'])) {
+               if (t3lib_utility_Math::canBeInterpretedAsInteger($top['uid'])) {
                        $inlineView = (array) unserialize($GLOBALS['BE_USER']->uc['inlineView']);
                        $inlineViewCurrent =& $inlineView[$top['table']][$top['uid']];
 
@@ -1598,9 +1598,9 @@ class t3lib_TCEforms_inline {
        protected function getNewRecordPid($table, $parentPid = NULL) {
                $newRecordPid = $this->inlineFirstPid;
                $pageTS = t3lib_beFunc::getPagesTSconfig($parentPid, TRUE);
-               if (isset($pageTS['TCAdefaults.'][$table . '.']['pid']) && t3lib_div::testInt($pageTS['TCAdefaults.'][$table . '.']['pid'])) {
+               if (isset($pageTS['TCAdefaults.'][$table . '.']['pid']) && t3lib_utility_Math::canBeInterpretedAsInteger($pageTS['TCAdefaults.'][$table . '.']['pid'])) {
                        $newRecordPid = $pageTS['TCAdefaults.'][$table . '.']['pid'];
-               } elseif (isset($parentPid) && t3lib_div::testInt($parentPid)) {
+               } elseif (isset($parentPid) && t3lib_utility_Math::canBeInterpretedAsInteger($parentPid)) {
                        $newRecordPid = $parentPid;
                }
                return $newRecordPid;
@@ -1928,7 +1928,7 @@ class t3lib_TCEforms_inline {
                        // If the command is to create a NEW record...:
                if ($cmd == 'new') {
                                // If the pid is numerical, check if it's possible to write to this page:
-                       if (t3lib_div::testInt($this->inlineFirstPid)) {
+                       if (t3lib_utility_Math::canBeInterpretedAsInteger($this->inlineFirstPid)) {
                                $calcPRec = t3lib_BEfunc::getRecord('pages', $this->inlineFirstPid);
                                if (!is_array($calcPRec)) {
                                        return FALSE;
index 191e097..9beb7fd 100644 (file)
@@ -476,7 +476,7 @@ class t3lib_TCEmain {
                                                $old_pid_value = '';
                                                $this->autoVersioningUpdate = FALSE;
 
-                                               if (!t3lib_div::testInt($id)) { // Is it a new record? (Then Id is a string)
+                                               if (!t3lib_utility_Math::canBeInterpretedAsInteger($id)) { // Is it a new record? (Then Id is a string)
                                                        $fieldArray = $this->newFieldArray($table); // Get a fieldArray with default values
                                                        if (isset($incomingFieldArray['pid'])) { // A pid must be set for new records.
                                                                        // $value = the pid
@@ -1820,7 +1820,7 @@ class t3lib_TCEmain {
                        // Example for received data:
                        // $value = 45,NEW4555fdf59d154,12,123
                        // We need to decide whether we use the stack or can save the relation directly.
-               if (strpos($value, 'NEW') !== FALSE || !t3lib_div::testInt($id)) {
+               if (strpos($value, 'NEW') !== FALSE || !t3lib_utility_Math::canBeInterpretedAsInteger($id)) {
                        $this->remapStackRecords[$table][$id] = array('remapStackIndex' => count($this->remapStack));
                        $this->addNewValuesToRemapStackChildIds($valueArray);
                        $this->remapStack[] = array(
@@ -1830,7 +1830,7 @@ class t3lib_TCEmain {
                                'field' => $field
                        );
                        unset($res['value']);
-               } elseif ($value || t3lib_div::testInt($id)) {
+               } elseif ($value || t3lib_utility_Math::canBeInterpretedAsInteger($id)) {
                        $res['value'] = $this->checkValue_inline_processDBdata($valueArray, $tcaFieldConf, $id, $status, $table, $field);
                }
 
@@ -3013,7 +3013,7 @@ class t3lib_TCEmain {
                                                }
                                                        // If no language it set, this is a regular copy action:
                                        } else {
-                                               if (!t3lib_div::testInt($realDestPid)) {
+                                               if (!t3lib_utility_Math::canBeInterpretedAsInteger($realDestPid)) {
                                                        $newId = $this->copyRecord($v['table'], $v['id'], -$v['id']);
                                                } elseif ($realDestPid == -1 && t3lib_BEfunc::isTableWorkspaceEnabled($v['table'])) {
                                                        $workspaceVersion = t3lib_BEfunc::getWorkspaceVersionOfRecord(
@@ -3746,7 +3746,7 @@ class t3lib_TCEmain {
                $field = $parts[0];
                $type = $parts[1];
 
-               if ($field && (t3lib_div::inList('localize,synchronize', $type) || t3lib_div::testInt($type)) && isset($GLOBALS['TCA'][$table]['columns'][$field]['config'])) {
+               if ($field && (t3lib_div::inList('localize,synchronize', $type) || t3lib_utility_Math::canBeInterpretedAsInteger($type)) && isset($GLOBALS['TCA'][$table]['columns'][$field]['config'])) {
                        $config = $GLOBALS['TCA'][$table]['columns'][$field]['config'];
                        $foreignTable = $config['foreign_table'];
                        $localizationMode = t3lib_BEfunc::getInlineLocalizationMode($table, $config);
@@ -3792,7 +3792,7 @@ class t3lib_TCEmain {
                                                        }
                                                }
                                                        // Perform synchronization/localization: Possibly add unlocalized records for original language:
-                                               if (t3lib_div::testInt($type) && isset($elementsOriginal[$type])) {
+                                               if (t3lib_utility_Math::canBeInterpretedAsInteger($type) && isset($elementsOriginal[$type])) {
                                                        $item = $elementsOriginal[$type];
                                                        $item['id'] = $this->localize($item['table'], $item['id'], $language);
                                                        $item['id'] = $this->overlayAutoVersionId($item['table'], $item['id']);
@@ -5155,7 +5155,7 @@ class t3lib_TCEmain {
                $id = intval($id);
 
                        // Processing the incoming $perms (from possible string to integer that can be AND'ed)
-               if (!t3lib_div::testInt($perms)) {
+               if (!t3lib_utility_Math::canBeInterpretedAsInteger($perms)) {
                        if ($table != 'pages') {
                                switch ($perms) {
                                        case 'edit':
@@ -5828,13 +5828,13 @@ class t3lib_TCEmain {
                        $fieldArray['perms_groupid'] = intval($TSConfig_p['groupid']);
                }
                if (strcmp($TSConfig_p['user'], '')) {
-                       $fieldArray['perms_user'] = t3lib_div::testInt($TSConfig_p['user']) ? $TSConfig_p['user'] : $this->assemblePermissions($TSConfig_p['user']);
+                       $fieldArray['perms_user'] = t3lib_utility_Math::canBeInterpretedAsInteger($TSConfig_p['user']) ? $TSConfig_p['user'] : $this->assemblePermissions($TSConfig_p['user']);
                }
                if (strcmp($TSConfig_p['group'], '')) {
-                       $fieldArray['perms_group'] = t3lib_div::testInt($TSConfig_p['group']) ? $TSConfig_p['group'] : $this->assemblePermissions($TSConfig_p['group']);
+                       $fieldArray['perms_group'] = t3lib_utility_Math::canBeInterpretedAsInteger($TSConfig_p['group']) ? $TSConfig_p['group'] : $this->assemblePermissions($TSConfig_p['group']);
                }
                if (strcmp($TSConfig_p['everybody'], '')) {
-                       $fieldArray['perms_everybody'] = t3lib_div::testInt($TSConfig_p['everybody']) ? $TSConfig_p['everybody'] : $this->assemblePermissions($TSConfig_p['everybody']);
+                       $fieldArray['perms_everybody'] = t3lib_utility_Math::canBeInterpretedAsInteger($TSConfig_p['everybody']) ? $TSConfig_p['everybody'] : $this->assemblePermissions($TSConfig_p['everybody']);
                }
 
                return $fieldArray;
@@ -6107,7 +6107,7 @@ class t3lib_TCEmain {
                foreach ($this->dbAnalysisStore as $action) {
                        $id = t3lib_BEfunc::wsMapId(
                                $action[4],
-                               (t3lib_div::testInt($action[2]) ? $action[2] : $this->substNEWwithIDs[$action[2]])
+                               (t3lib_utility_Math::canBeInterpretedAsInteger($action[2]) ? $action[2] : $this->substNEWwithIDs[$action[2]])
                        );
                        if ($id) {
                                $action[0]->writeMM($action[1], $id, $action[3]);
@@ -6685,7 +6685,7 @@ class t3lib_TCEmain {
                }
 
                        // Clear cache for a page ID!
-               if (t3lib_div::testInt($cacheCmd)) {
+               if (t3lib_utility_Math::canBeInterpretedAsInteger($cacheCmd)) {
                        if (t3lib_extMgm::isLoaded('cms')) {
 
                                $list_cache = array($cacheCmd);
@@ -6854,7 +6854,7 @@ class t3lib_TCEmain {
                        switch ($GLOBALS['TCA'][$table]['columns'][$field]['config']['type']) {
                                case 'inline':
                                        if ($GLOBALS['TCA'][$table]['columns'][$field]['config']['foreign_field']) {
-                                               if (!t3lib_div::testInt($value)) {
+                                               if (!t3lib_utility_Math::canBeInterpretedAsInteger($value)) {
                                                        $result[$field] = count(t3lib_div::trimExplode(',', $value, TRUE));
                                                }
                                        }
index e16dbdc..66b00c1 100644 (file)
@@ -395,14 +395,14 @@ class t3lib_timeTrack {
                $c = 0;
                        // First, find number of entries
                foreach ($arr as $k => $v) {
-                       if (t3lib_div::testInt($k)) {
+                       if (t3lib_utility_Math::canBeInterpretedAsInteger($k)) {
                                $ac++;
                        }
                }
                        // Traverse through entries
                $subtime = 0;
                foreach ($arr as $k => $v) {
-                       if (t3lib_div::testInt($k)) {
+                       if (t3lib_utility_Math::canBeInterpretedAsInteger($k)) {
                                $c++;
 
                                $deeper = is_array($arr[$k . '.']) ? 1 : 0;
@@ -434,7 +434,7 @@ class t3lib_timeTrack {
 
                        // Traverse array again, this time substitute the unique hash with the red key
                foreach ($arr as $k => $v) {
-                       if (t3lib_div::testInt($k)) {
+                       if (t3lib_utility_Math::canBeInterpretedAsInteger($k)) {
                                if (strlen($this->tsStackLog[$v]['content'])) {
                                        $content = str_replace($v, '<strong style="color:red;">[' . $this->tsStackLog[$v]['key'] . ']</strong>', $content);
                                }
index 78e202c..7dcde6e 100644 (file)
@@ -307,7 +307,7 @@ class t3lib_tsparser_ext extends t3lib_TStemplate {
                        if (substr($key, -2) != '..') { // Don't do anything with comments / linenumber registrations...
                                $key = preg_replace('/\.$/', '', $key);
                                if (substr($key, -1) != '.') {
-                                       if (t3lib_div::testInt($key)) {
+                                       if (t3lib_utility_Math::canBeInterpretedAsInteger($key)) {
                                                $keyArr_num[$key] = $arr[$key];
                                        } else {
                                                $keyArr_alpha[$key] = $arr[$key];
@@ -941,7 +941,7 @@ class t3lib_tsparser_ext extends t3lib_TStemplate {
                                                $out[$key] = $val;
                                        break;
                                        default:
-                                               if (t3lib_div::testInt($key)) {
+                                               if (t3lib_utility_Math::canBeInterpretedAsInteger($key)) {
                                                        $constRefs = explode(',', $val);
                                                        foreach ($constRefs as $const) {
                                                                $const = trim($const);
index 38a9c44..4577470 100644 (file)
@@ -1259,7 +1259,7 @@ class t3lib_TStemplate {
                $keyArr = array();
                $setupArrKeys = array_keys($setupArr);
                foreach ($setupArrKeys as $key) {
-                       if ($acceptOnlyProperties || t3lib_div::testInt($key)) {
+                       if ($acceptOnlyProperties || t3lib_utility_Math::canBeInterpretedAsInteger($key)) {
                                $keyArr[] = intval($key);
                        }
                }
@@ -1348,7 +1348,7 @@ class t3lib_TStemplate {
 
                        // typeNum
                $typeNum = $this->setup[$LD['target'] . '.']['typeNum'];
-               if (!t3lib_div::testInt($typeOverride) && intval($GLOBALS['TSFE']->config['config']['forceTypeValue'])) {
+               if (!t3lib_utility_Math::canBeInterpretedAsInteger($typeOverride) && intval($GLOBALS['TSFE']->config['config']['forceTypeValue'])) {
                        $typeOverride = intval($GLOBALS['TSFE']->config['config']['forceTypeValue']);
                }
                if (strcmp($typeOverride, '')) {
index 13b93f4..cfebb39 100644 (file)
@@ -340,7 +340,7 @@ abstract class t3lib_matchCondition_abstract {
                                        // comp
                                $values = t3lib_div::trimExplode(',', $value, TRUE);
                                foreach ($values as $test) {
-                                       if (t3lib_div::testInt($test)) {
+                                       if (t3lib_utility_Math::canBeInterpretedAsInteger($test)) {
                                                $test = '=' . $test;
                                        }
                                        if ($this->compareNumber($test, $theTestValue)) {
index a703b94..1c332cd 100644 (file)
@@ -304,7 +304,7 @@ class t3lib_search_livesearch {
         */
        public function getRecordTitlePrep($title, $titleLength = 0) {
                        // If $titleLength is not a valid positive integer, use BE_USER->uc['titleLen']:
-               if (!$titleLength || !t3lib_div::testInt($titleLength) || $titleLength < 0) {
+               if (!$titleLength || !t3lib_utility_Math::canBeInterpretedAsInteger($titleLength) || $titleLength < 0) {
                        $titleLength = $GLOBALS['BE_USER']->uc['titleLen'];
                }
 
index 276613d..0ccc45d 100644 (file)
@@ -90,7 +90,7 @@ final class t3lib_utility_Math {
         *
         * @param $string string Input string, eg "123 + 456 / 789 - 4"
         * @return integer Calculated value. Or error string.
-        * @see calcParenthesis()
+        * @see t3lib_utility_Math::calculateWithParentheses()
         */
        public static function calculateWithPriorityToAdditionAndSubtraction($string) {
                $string = preg_replace('/[[:space:]]*/', '', $string); // removing all whitespace
@@ -147,7 +147,7 @@ final class t3lib_utility_Math {
         *
         * @param $string string Input string, eg "(123 + 456) / 789 - 4"
         * @return integer Calculated value. Or error string.
-        * @see calcPriority(), tslib_cObj::stdWrap()
+        * @see calculateWithPriorityToAdditionAndSubtraction(), tslib_cObj::stdWrap()
         */
        public static function calculateWithParentheses($string) {
                $securC = 100;
index c6bab23..dc96f10 100644 (file)
@@ -260,7 +260,7 @@ class t3lib_divTest extends tx_phpunit_testcase {
         * @dataProvider functionTestIntValidDataProvider
         */
        public function testIntReturnsTrue($int) {
-               $this->assertTrue(t3lib_div::testInt($int));
+               $this->assertTrue(t3lib_utility_Math::canBeInterpretedAsInteger($int));
        }
 
        /**
@@ -297,7 +297,7 @@ class t3lib_divTest extends tx_phpunit_testcase {
         * @dataProvider functionTestIntInvalidDataProvider
         */
        public function testIntReturnsFalse($int) {
-               $this->assertFalse(t3lib_div::testInt($int));
+               $this->assertFalse(t3lib_utility_Math::canBeInterpretedAsInteger($int));
        }
 
 
index 23f184e..6ad9c9e 100644 (file)
@@ -821,7 +821,7 @@ class SC_alt_doc {
 
                        // DELETE + UNDO buttons:
                if (!$this->errorC && !$GLOBALS['TCA'][$this->firstEl['table']]['ctrl']['readOnly'] && count($this->elementsData)==1)   {
-                       if ($this->firstEl['cmd']!='new' && t3lib_div::testInt($this->firstEl['uid']))  {
+                       if ($this->firstEl['cmd']!='new' && t3lib_utility_Math::canBeInterpretedAsInteger($this->firstEl['uid']))       {
 
                                        // Delete:
                                if ($this->firstEl['deleteAccess'] && !$GLOBALS['TCA'][$this->firstEl['table']]['ctrl']['readOnly'] && !$this->getNewIconMode($this->firstEl['table'],'disableDelete')) {
index da082ce..162a73c 100644 (file)
@@ -137,7 +137,7 @@ class SC_alt_shortcut {
 
                        // Lookup the title of this page and use it as default description
                $page_id = $this->getLinkedPageId($url);
-               if (t3lib_div::testInt($page_id))       {
+               if (t3lib_utility_Math::canBeInterpretedAsInteger($page_id))    {
                        if (preg_match('/\&edit\[(.*)\]\[(.*)\]=edit/',$url,$matches))  {
                                        // Edit record
                                $description = '';      // TODO: Set something useful
@@ -175,7 +175,7 @@ class SC_alt_shortcut {
 
                        // Deleting shortcuts:
                if (strcmp($this->deleteCategory,''))   {
-                       if (t3lib_div::testInt($this->deleteCategory))  {
+                       if (t3lib_utility_Math::canBeInterpretedAsInteger($this->deleteCategory))       {
                                $GLOBALS['TYPO3_DB']->exec_DELETEquery('sys_be_shortcuts', 'sc_group='.intval($this->deleteCategory).$addUSERWhere);
                        }
                }
@@ -317,7 +317,7 @@ class SC_alt_shortcut {
                                }
 
                                $page_id = $this->getLinkedPageId($row['url']);
-                               if (t3lib_div::testInt($page_id))       {
+                               if (t3lib_utility_Math::canBeInterpretedAsInteger($page_id))    {
                                                // Check for webmount access
                                        if (!$GLOBALS['BE_USER']->isInWebMount($page_id)) continue;
 
@@ -438,7 +438,7 @@ class SC_alt_shortcut {
                }
 
                        // Load alternative table/uid into editing form.
-               if (count($this->alternativeTableUid)==2 && isset($GLOBALS['TCA'][$this->alternativeTableUid[0]]) && t3lib_div::testInt($this->alternativeTableUid[1])) {
+               if (count($this->alternativeTableUid)==2 && isset($GLOBALS['TCA'][$this->alternativeTableUid[0]]) && t3lib_utility_Math::canBeInterpretedAsInteger($this->alternativeTableUid[1]))      {
                        $JSaction = t3lib_BEfunc::editOnClick('&edit['.$this->alternativeTableUid[0].']['.$this->alternativeTableUid[1].']=edit','','dummy.php');
                        $this->content.=$this->doc->wrapScriptTags('function editArbitraryElement() { top.content.'.$JSaction.'; } editArbitraryElement();');
                }
@@ -562,7 +562,7 @@ class SC_alt_shortcut {
                        if (!(count($this->alternativeTableUid)==2 && $GLOBALS['BE_USER']->isAdmin()))  {       // We restrict it to admins only just because I'm not really sure if alt_doc.php properly checks permissions of passed records for editing. If alt_doc.php does that, then we can remove this.
 
                                $where = ' AND ('.$GLOBALS['BE_USER']->getPagePermsClause(2).' OR '.$GLOBALS['BE_USER']->getPagePermsClause(16).')';
-                               if (t3lib_div::testInt($this->editPage))        {
+                               if (t3lib_utility_Math::canBeInterpretedAsInteger($this->editPage))     {
                                        $this->theEditRec = t3lib_BEfunc::getRecordWSOL('pages',$this->editPage,'*',$where);
                                } else {
                                        $records = t3lib_BEfunc::getRecordsByField('pages','alias',$this->editPage,$where);
@@ -631,7 +631,7 @@ class SC_alt_shortcut {
                                // edit alternative table/uid
                        if(count($this->alternativeTableUid) == 2
                        && isset($GLOBALS['TCA'][$this->alternativeTableUid[0]])
-                       && t3lib_div::testInt($this->alternativeTableUid[1])) {
+                       && t3lib_utility_Math::canBeInterpretedAsInteger($this->alternativeTableUid[1])) {
                                $data['type']             = 'alternative';
                                $data['alternativeTable'] = $this->alternativeTableUid[0];
                                $data['alternativeUid']   = $this->alternativeTableUid[1];
index 9115a81..b13cb28 100644 (file)
@@ -635,7 +635,7 @@ class TYPO3backend {
                        $where = ' AND ('.$GLOBALS['BE_USER']->getPagePermsClause(2)
                                        .' OR '.$GLOBALS['BE_USER']->getPagePermsClause(16).')';
 
-                       if(t3lib_div::testInt($editId)) {
+                       if(t3lib_utility_Math::canBeInterpretedAsInteger($editId))      {
                                $editRecord = t3lib_BEfunc::getRecordWSOL('pages', $editId, '*', $where);
                        } else {
                                $records = t3lib_BEfunc::getRecordsByField('pages', 'alias', $editId, $where);
index ab39b20..74b1553 100644 (file)
@@ -1766,7 +1766,7 @@ class browse_links {
                }
 
                        // Draw the record list IF there is a page id to expand:
-               if ($expPageId && t3lib_div::testInt($expPageId) && $GLOBALS['BE_USER']->isInWebMount($expPageId)) {
+               if ($expPageId && t3lib_utility_Math::canBeInterpretedAsInteger($expPageId) && $GLOBALS['BE_USER']->isInWebMount($expPageId)) {
 
                                // Set header:
                        $out.=$this->barheader($GLOBALS['LANG']->getLL('contentElements').':');
@@ -1837,7 +1837,7 @@ class browse_links {
         */
        function TBE_expandPage($tables)        {
                $out='';
-               if ($this->expandPage >= 0 && t3lib_div::testInt($this->expandPage) && $GLOBALS['BE_USER']->isInWebMount($this->expandPage)) {
+               if ($this->expandPage >= 0 && t3lib_utility_Math::canBeInterpretedAsInteger($this->expandPage) && $GLOBALS['BE_USER']->isInWebMount($this->expandPage)) {
 
                                // Set array with table names to list:
                        if (!strcmp(trim($tables),'*')) {
@@ -2565,7 +2565,7 @@ class browse_links {
                                                $id = array_shift($parameters);
                                                if ($id)        {
                                                                // Checking if the id-parameter is an alias.
-                                                       if (!t3lib_div::testInt($id))   {
+                                                       if (!t3lib_utility_Math::canBeInterpretedAsInteger($id))        {
                                                                list($idPartR) = t3lib_BEfunc::getRecordsByField('pages','alias',$id);
                                                                $id=intval($idPartR['uid']);
                                                        }
index 69d47d5..b0ae15a 100644 (file)
@@ -544,7 +544,7 @@ class recordList extends t3lib_recordList {
                                        // Loading full table description - we need to traverse fields:
                                t3lib_div::loadTCA($table);
 
-                               if (t3lib_div::testInt($this->searchString)) {
+                               if (t3lib_utility_Math::canBeInterpretedAsInteger($this->searchString)) {
                                        $whereParts = array(
                                                'uid=' . $this->searchString
                                        );
index aa9e80f..9e2bb74 100644 (file)
@@ -302,7 +302,7 @@ class ShortcutMenu implements backend_toolbarItem {
                                }
 
                                $pageId = $this->getLinkedPageId($row['url']);
-                               if(t3lib_div::testInt($pageId)) {
+                               if(t3lib_utility_Math::canBeInterpretedAsInteger($pageId)) {
                                                // check for webmount access
                                        if(!$GLOBALS['BE_USER']->isInWebMount($pageId)) {
                                                continue;
@@ -538,7 +538,7 @@ class ShortcutMenu implements backend_toolbarItem {
                                // Lookup the title of this page and use it as default description
                        $pageId = $shortcut['recordid'] ? $shortcut['recordid'] : $this->getLinkedPageId($url);
 
-                       if(t3lib_div::testInt($pageId)) {
+                       if(t3lib_utility_Math::canBeInterpretedAsInteger($pageId)) {
                                $page = t3lib_BEfunc::getRecord('pages', $pageId);
                                if(count($page)) {
                                                // set the name to the title of the page
index d679047..83c5289 100644 (file)
@@ -441,7 +441,7 @@ if (TYPO3_REQUESTTYPE & TYPO3_REQUESTTYPE_CLI) {
 // ****************
 ob_clean();
 if (extension_loaded('zlib') && $TYPO3_CONF_VARS['BE']['compressionLevel'])    {
-       if (t3lib_div::testInt($TYPO3_CONF_VARS['BE']['compressionLevel'])) {
+       if (t3lib_utility_Math::canBeInterpretedAsInteger($TYPO3_CONF_VARS['BE']['compressionLevel'])) {
                @ini_set('zlib.output_compression_level', $TYPO3_CONF_VARS['BE']['compressionLevel']);
        }
        ob_start('ob_gzhandler');
index addc8b0..d860174 100755 (executable)
@@ -1500,7 +1500,7 @@ class SC_mod_tools_be_user_index {
                $where_clause = '';
                $orderBy = 'u.username';
 
-               if (t3lib_div::testInt($GLOBALS['TYPO3_CONF_VARS']['BE']['sessionTimeout']))    {
+               if (t3lib_utility_Math::canBeInterpretedAsInteger($GLOBALS['TYPO3_CONF_VARS']['BE']['sessionTimeout'])) {
                        $where_clause .= 'ses_tstamp+' . $GLOBALS['TYPO3_CONF_VARS']['BE']['sessionTimeout'] . ' > ' . $GLOBALS['EXEC_TIME'];
                } else {
                        $timeout = intval($GLOBALS['TYPO3_CONF_VARS']['BE']['sessionTimeout']);
index 27a045d..08f9125 100755 (executable)
@@ -751,7 +751,7 @@ class SC_db_layout {
 
 
                        // Delete-button flag?
-               $this->deleteButton = (t3lib_div::testInt($this->eRParts[1]) && $edit_record && (($this->eRParts[0]!='pages'&&$this->EDIT_CONTENT) || ($this->eRParts[0]=='pages'&&($this->CALC_PERMS&4))));
+               $this->deleteButton = (t3lib_utility_Math::canBeInterpretedAsInteger($this->eRParts[1]) && $edit_record && (($this->eRParts[0]!='pages'&&$this->EDIT_CONTENT) || ($this->eRParts[0]=='pages'&&($this->CALC_PERMS&4))));
 
                        // If undo-button should be rendered (depends on available items in sys_history)
                $this->undoButton=0;
@@ -917,7 +917,7 @@ class SC_db_layout {
 
 
                        // Select element matrix:
-               if ($this->eRParts[0]=='tt_content' && t3lib_div::testInt($this->eRParts[1]))   {
+               if ($this->eRParts[0]=='tt_content' && t3lib_utility_Math::canBeInterpretedAsInteger($this->eRParts[1]))        {
                        $posMap = t3lib_div::makeInstance('ext_posMap');
                        $posMap->backPath = $GLOBALS['BACK_PATH'];
                        $posMap->cur_sys_language=$this->current_sys_language;
@@ -1212,7 +1212,7 @@ class SC_db_layout {
                                                t3lib_iconWorks::getSpriteIcon('actions-page-move') .
                                        '</a>';
                                // Move record
-                       if (t3lib_div::testInt($this->eRParts[1])) {
+                       if (t3lib_utility_Math::canBeInterpretedAsInteger($this->eRParts[1])) {
                                $buttons['move_record'] = '<a href="' . htmlspecialchars($GLOBALS['BACK_PATH'] . 'move_el.php?table=' . $this->eRParts[0] . '&uid=' . $this->eRParts[1] . '&returnUrl=' . rawurlencode(t3lib_div::getIndpEnv('REQUEST_URI'))) . '">' .
                                                t3lib_iconWorks::getSpriteIcon('actions-' . ($this->eRParts[0] == 'tt_content' ? 'document' : 'page') . '-move',array('class'=>'c-inputButton','title' => $GLOBALS['LANG']->getLL('move_' . ($this->eRParts[0] == 'tt_content' ? 'record' : 'page'), 1))) .
                                                '</a>';
index 9bbb712..37d8c16 100644 (file)
@@ -1765,7 +1765,7 @@ class tslib_cObj {
                } else {
                        if (is_array($row)) {
                                foreach ($row as $field => $value) {
-                                       if (!t3lib_div::testInt($field)) {
+                                       if (!t3lib_utility_Math::canBeInterpretedAsInteger($field)) {
                                                if ($HSC) {
                                                        $value = htmlspecialchars($value);
                                                }
@@ -2293,7 +2293,7 @@ class tslib_cObj {
         * @return      string          The processed input value
         */
        public function stdWrap_prioriCalc($content = '', $conf = array()) {
-               $content = t3lib_div::calcParenthesis($content);
+               $content = t3lib_utility_Math::calculateWithParentheses($content);
                if ($conf['prioriCalc'] == 'intval')
                        $content = intval($content);
                return $content;
@@ -3124,7 +3124,7 @@ class tslib_cObj {
         */
        function listNum($content, $listNum, $char) {
                $char = $char ? $char : ',';
-               if (t3lib_div::testInt($char)) {
+               if (t3lib_utility_Math::canBeInterpretedAsInteger($char)) {
                        $char = chr($char);
                }
                $temp = explode($char, $content);
@@ -4000,11 +4000,11 @@ class tslib_cObj {
        }
 
        /**
-        * Performs basic mathematical evaluation of the input string. Does NOT take parathesis and operator precedence into account! (for that, see t3lib_div::calcPriority())
+        * Performs basic mathematical evaluation of the input string. Does NOT take parathesis and operator precedence into account! (for that, see t3lib_utility_Math::calculateWithPriorityToAdditionAndSubtraction())
         *
         * @param       string          The string to evaluate. Example: "3+4*10/5" will generate "35". Only integer numbers can be used.
         * @return      integer         The result (might be a float if you did a division of the numbers).
-        * @see t3lib_div::calcPriority()
+        * @see t3lib_utility_Math::calculateWithPriorityToAdditionAndSubtraction()
         */
        function calc($val) {
                $parts = t3lib_div::splitCalc($val, '+-*/');
@@ -4078,7 +4078,7 @@ class tslib_cObj {
 
                $valArr = explode($conf['token'], $value);
 
-               if (count($valArr) && (t3lib_div::testInt($conf['returnKey']) || $conf['returnKey.'])) {
+               if (count($valArr) && (t3lib_utility_Math::canBeInterpretedAsInteger($conf['returnKey']) || $conf['returnKey.'])) {
                        $key = isset($conf['returnKey.'])
                                ? intval($this->stdWrap($conf['returnKey'], $conf['returnKey.']))
                                : intval($conf['returnKey']);
@@ -5319,7 +5319,7 @@ class tslib_cObj {
                $sectionMark = isset($conf['section.'])
                        ? trim($this->stdWrap($conf['section'], $conf['section.']))
                        : trim($conf['section']);
-               $sectionMark = $sectionMark ? (t3lib_div::testInt($sectionMark) ? '#c' : '#') . $sectionMark : '';
+               $sectionMark = $sectionMark ? (t3lib_utility_Math::canBeInterpretedAsInteger($sectionMark) ? '#c' : '#') . $sectionMark : '';
                $initP = '?id=' . $GLOBALS['TSFE']->id . '&type=' . $GLOBALS['TSFE']->type;
                $this->lastTypoLinkUrl = '';
                $this->lastTypoLinkTarget = '';
@@ -5401,7 +5401,7 @@ class tslib_cObj {
                                $urlChar = intval(strpos($link_param, '.'));
 
                                        // Firsts, test if $link_param is numeric and page with such id exists. If yes, do not attempt to link to file
-                               if (!t3lib_div::testInt($link_param) || count($GLOBALS['TSFE']->sys_page->getPage_noCheck($link_param)) == 0) {
+                               if (!t3lib_utility_Math::canBeInterpretedAsInteger($link_param) || count($GLOBALS['TSFE']->sys_page->getPage_noCheck($link_param)) == 0) {
                                                // Detects if a file is found in site-root (or is a 'virtual' simulateStaticDocument file!) and if so it will be treated like a normal file.
                                        list ($rootFileDat) = explode('?', rawurldecode($link_param));
                                        $containsSlash = strstr($rootFileDat, '/');
@@ -5492,7 +5492,7 @@ class tslib_cObj {
                                        } // If no id or alias is given
                                        if ($link_params_parts[1] && !$sectionMark) {
                                                $sectionMark = trim($link_params_parts[1]);
-                                               $sectionMark = (t3lib_div::testInt($sectionMark) ? '#c' : '#') . $sectionMark;
+                                               $sectionMark = (t3lib_utility_Math::canBeInterpretedAsInteger($sectionMark) ? '#c' : '#') . $sectionMark;
                                        }
 
                                        if (count($pairParts) > 1) {
@@ -5500,7 +5500,7 @@ class tslib_cObj {
                                                $conf['additionalParams'] .= isset($pairParts[2]) ? $pairParts[2] : '';
                                        }
                                                // Checking if the id-parameter is an alias.
-                                       if (!t3lib_div::testInt($link_param)) {
+                                       if (!t3lib_utility_Math::canBeInterpretedAsInteger($link_param)) {
                                                $link_param = $GLOBALS['TSFE']->sys_page->getPageIdFromAlias($link_param);
                                        }
 
@@ -6331,7 +6331,7 @@ class tslib_cObj {
         * @return      string          The formatted string
         */
        function calcAge($seconds, $labels) {
-               if (t3lib_div::testInt($labels)) {
+               if (t3lib_utility_Math::canBeInterpretedAsInteger($labels)) {
                        $labels = ' min| hrs| days| yrs| min| hour| day| year';
                } else {
                        $labels = str_replace('"', '', $labels);
index 49e0683..d7be9e0 100644 (file)
 
                                        // Now it's investigated if the raw page-id points to a hidden page and if so, the flag is set.
                                        // This does not require the preview flag to be set in the admin panel
-                               $idQ = t3lib_div::testInt($this->id) ? 'uid='.intval($this->id) : 'alias='.$GLOBALS['TYPO3_DB']->fullQuoteStr($this->id, 'pages').' AND pid>=0';        // pid>=0 added for the sake of versioning...
+                               $idQ = t3lib_utility_Math::canBeInterpretedAsInteger($this->id) ? 'uid='.intval($this->id) : 'alias='.$GLOBALS['TYPO3_DB']->fullQuoteStr($this->id, 'pages').' AND pid>=0';     // pid>=0 added for the sake of versioning...
                                $count = $GLOBALS['TYPO3_DB']->exec_SELECTcountRows('uid', 'pages', $idQ . ' AND hidden!=0 AND deleted=0');
                                if ($count) {
                                        $this->fePreview = 1;   // The preview flag is set only if the current page turns out to actually be hidden!
         * @access private
         */
        function checkAndSetAlias()     {
-               if ($this->id && !t3lib_div::testInt($this->id))        {
+               if ($this->id && !t3lib_utility_Math::canBeInterpretedAsInteger($this->id))     {
                        $aid = $this->sys_page->getPageIdFromAlias($this->id);
                        if ($aid)       {
                                $this->id = $aid;
@@ -4212,7 +4212,7 @@ if (version == "n3") {
         */
        function workspacePreviewInit() {
                $previewWS = t3lib_div::_GP('ADMCMD_previewWS');
-               if ($this->beUserLogin && is_object($GLOBALS['BE_USER']) && t3lib_div::testInt($previewWS))     {
+               if ($this->beUserLogin && is_object($GLOBALS['BE_USER']) && t3lib_utility_Math::canBeInterpretedAsInteger($previewWS))  {
                        if ($previewWS==0 || ($previewWS>=-1 && $GLOBALS['BE_USER']->checkWorkspace($previewWS))) {     // Check Access to workspace. Live (0) is OK to preview for all.
                                $this->workspacePreview = intval($previewWS);
                        } else {
index 8e43c5b..95b5936 100644 (file)
@@ -465,7 +465,7 @@ class tslib_menu {
                                                        $value=$GLOBALS['TSFE']->page['uid'];
                                                }
                                                $items=t3lib_div::intExplode(',',$value);
-                                               if (t3lib_div::testInt($this->conf['special.']['depth']))       {
+                                               if (t3lib_utility_Math::canBeInterpretedAsInteger($this->conf['special.']['depth']))    {
                                                        $depth = t3lib_utility_Math::forceIntegerInRange($this->conf['special.']['depth'],1,20);                // Tree depth
                                                } else {
                                                        $depth=20;
@@ -556,7 +556,7 @@ class tslib_menu {
                                                }
 
                                                        // depth, limit, extra where
-                                               if (t3lib_div::testInt($this->conf['special.']['depth']))       {
+                                               if (t3lib_utility_Math::canBeInterpretedAsInteger($this->conf['special.']['depth']))    {
                                                        $depth = t3lib_utility_Math::forceIntegerInRange($this->conf['special.']['depth'],0,20);                // Tree depth
                                                } else {
                                                        $depth=20;
@@ -608,7 +608,7 @@ class tslib_menu {
                                                        : $this->conf['special.']['range'];
                                                $begin_end = explode('|', $range);
                                                $begin_end[0] = intval($begin_end[0]);
-                                               if (!t3lib_div::testInt($begin_end[1])) {
+                                               if (!t3lib_utility_Math::canBeInterpretedAsInteger($begin_end[1])) {
                                                        $begin_end[1] = -1;
                                                }
 
@@ -1580,7 +1580,7 @@ class tslib_menu {
                $conf = array(
                        'parameter' => is_array($overrideArray) && $overrideArray['uid'] ? $overrideArray['uid'] : $page['uid'],
                );
-               if ($typeOverride && t3lib_div::testInt($typeOverride)) {
+               if ($typeOverride && t3lib_utility_Math::canBeInterpretedAsInteger($typeOverride)) {
                        $conf['parameter'] .= ',' . $typeOverride;
                }
                if ($addParams) {
index b201460..d6fb076 100644 (file)
@@ -1138,7 +1138,7 @@ See <a href="http://wiki.typo3.org/index.php/TYPO3_3.8.1" target="_blank">wiki.t
 
                if ($needle=='int' || $needle=='integer')       {       // Integer
 
-                       if (t3lib_div::testInt($haystack))      {
+                       if (t3lib_utility_Math::canBeInterpretedAsInteger($haystack))   {
                                $OK = TRUE;
                        }
 
@@ -1150,7 +1150,7 @@ See <a href="http://wiki.typo3.org/index.php/TYPO3_3.8.1" target="_blank">wiki.t
 
                } elseif (strstr($needle,'-'))  {       // Range
 
-                       if (t3lib_div::testInt($haystack))      {
+                       if (t3lib_utility_Math::canBeInterpretedAsInteger($haystack))   {
                                $range = explode('-',$needle);
                                if ($range[0] <= $haystack && $range[1] >= $haystack)   {
                                        $OK = TRUE;
index 21c4827..c893f70 100644 (file)
@@ -1284,7 +1284,7 @@ class tslib_pibase {
                $fList = t3lib_div::trimExplode(',',$fList,1);
                $tempPiVars = $this->piVars;
                foreach ($fList as $k) {
-                       if (!t3lib_div::testInt($tempPiVars[$k]) || $tempPiVars[$k]<$lowerThan)         unset($tempPiVars[$k]);
+                       if (!t3lib_utility_Math::canBeInterpretedAsInteger($tempPiVars[$k]) || $tempPiVars[$k]<$lowerThan)              unset($tempPiVars[$k]);
                }
                if (!count($tempPiVars))        return 1;
        }
@@ -1389,7 +1389,7 @@ class tslib_pibase {
 
                $tempArr=$sheetArray;
                foreach($fieldNameArr as $k => $v)      {
-                       if (t3lib_div::testInt($v))     {
+                       if (t3lib_utility_Math::canBeInterpretedAsInteger($v))  {
                                if (is_array($tempArr)) {
                                        $c=0;
                                        foreach($tempArr as $values)    {
index 3412923..ce8219b 100644 (file)
@@ -720,7 +720,7 @@ class tslib_content_Form extends tslib_content_Abstract {
                                '',
                                $this->cObj->getClosestMPvalueForPage($page['uid'])
                        );
-               } elseif (t3lib_div::testInt($theRedirect)) { // Internal: Submit to page with ID $theRedirect
+               } elseif (t3lib_utility_Math::canBeInterpretedAsInteger($theRedirect)) { // Internal: Submit to page with ID $theRedirect
                        $page = $GLOBALS['TSFE']->sys_page->getPage_noCheck($theRedirect);
                        $LD = $GLOBALS['TSFE']->tmpl->linkData(
                                $page,
@@ -751,7 +751,7 @@ class tslib_content_Form extends tslib_content_Abstract {
                                ? $this->cObj->stdWrap($conf['type'], $conf['type.'])
                                : $conf['type'];
                }
-               if (t3lib_div::testInt($formtype)) { // Submit to a specific page
+               if (t3lib_utility_Math::canBeInterpretedAsInteger($formtype)) { // Submit to a specific page
                        $page = $GLOBALS['TSFE']->sys_page->getPage_noCheck($formtype);
                        $LD_A = $GLOBALS['TSFE']->tmpl->linkData(
                                $page,
@@ -765,7 +765,7 @@ class tslib_content_Form extends tslib_content_Abstract {
                } elseif ($formtype) { // Submit to external script
                        $LD_A = $LD;
                        $action = $formtype;
-               } elseif (t3lib_div::testInt($theRedirect)) {
+               } elseif (t3lib_utility_Math::canBeInterpretedAsInteger($theRedirect)) {
                        $LD_A = $LD;
                        $action = $LD_A['totalURL'];
                } else { // Submit to "nothing" - which is current page
index 1ed860f..a8f718f 100644 (file)
@@ -49,7 +49,7 @@ class tslib_content_SearchResult extends tslib_content_Abstract {
                        $depth = 100;
                                // the startId is found
                        $theStartId = 0;
-                       if (t3lib_div::testInt(t3lib_div::_GP('stype'))) {
+                       if (t3lib_utility_Math::canBeInterpretedAsInteger(t3lib_div::_GP('stype'))) {
                                $temp_theStartId = t3lib_div::_GP('stype');
                                $rootLine = $GLOBALS['TSFE']->sys_page->getRootLine($temp_theStartId);
                                        // The page MUST have a rootline with the Level0-page of the current site inside!!
@@ -112,7 +112,7 @@ class tslib_content_SearchResult extends tslib_content_Abstract {
                        $search->build_search_query($endClause);
 
                                // count...
-                       if (t3lib_div::testInt(t3lib_div::_GP('scount'))) {
+                       if (t3lib_utility_Math::canBeInterpretedAsInteger(t3lib_div::_GP('scount'))) {
                                $search->res_count = t3lib_div::_GP('scount');
                        } else {
                                $search->count_query();
index bccdb77..91ccf85 100644 (file)
@@ -251,7 +251,7 @@ $TSFE->sendRedirect();
 // Remove any output produced until now
 ob_clean();
 if ($TYPO3_CONF_VARS['FE']['compressionLevel'] && extension_loaded('zlib'))    {
-       if (t3lib_div::testInt($TYPO3_CONF_VARS['FE']['compressionLevel'])) {
+       if (t3lib_utility_Math::canBeInterpretedAsInteger($TYPO3_CONF_VARS['FE']['compressionLevel'])) {
                // Prevent errors if ini_set() is unavailable (safe mode)
                @ini_set('zlib.output_compression_level', $TYPO3_CONF_VARS['FE']['compressionLevel']);
        }
index 8687e06..6caac21 100755 (executable)
@@ -1288,7 +1288,7 @@ class user_feAdmin        {
                                }
 
                                        // Getting records
-                               if (t3lib_div::testInt($fetch)) {
+                               if (t3lib_utility_Math::canBeInterpretedAsInteger($fetch))      {
                                        $DBrows = $GLOBALS['TSFE']->sys_page->getRecordsByField($this->theTable,'uid',$fetch,$pidLock,'','','1');
                                } elseif ($fetch) {     // $this->conf['email.']['field'] must be a valid field in the table!
                                        $DBrows = $GLOBALS['TSFE']->sys_page->getRecordsByField($this->theTable,$this->conf['email.']['field'],$fetch,$pidLock,'','','100');
@@ -1342,7 +1342,7 @@ class user_feAdmin        {
                if ($userContent['all'])        $userContent['final'] .=$this->cObj->substituteSubpart($userContent['all'], '###SUB_RECORD###', $userContent['accum']);
                if ($adminContent['all'])       $adminContent['final'].=$this->cObj->substituteSubpart($adminContent['all'], '###SUB_RECORD###', $adminContent['accum']);
 
-               if (t3lib_div::testInt($recipient))     {
+               if (t3lib_utility_Math::canBeInterpretedAsInteger($recipient))  {
                        $fe_userRec = $GLOBALS['TSFE']->sys_page->getRawRecord('fe_users',$recipient);
                        $recipient=$fe_userRec['email'];
                }
index 76c64f6..616de29 100644 (file)
@@ -679,7 +679,7 @@ final class tx_em_Tools {
                        if (strlen($k) && is_array($v)) {
                                $lines .= str_repeat(TAB, $level) . "'" . $k . "' => " . self::arrayToCode($v, $level);
                        } elseif (strlen($k)) {
-                               $lines .= str_repeat(TAB, $level) . "'" . $k . "' => " . (t3lib_div::testInt($v) ? intval($v) : "'" . t3lib_div::slashJS(trim($v), 1) . "'") . ',' . LF;
+                               $lines .= str_repeat(TAB, $level) . "'" . $k . "' => " . (t3lib_utility_Math::canBeInterpretedAsInteger($v) ? intval($v) : "'" . t3lib_div::slashJS(trim($v), 1) . "'") . ',' . LF;
                        }
                }
 
index cc517bd..0653084 100644 (file)
@@ -240,7 +240,7 @@ class tx_feedit_editpanel {
                                $out = $this->editPanelLinkWrap_doWrap($string, $adminURL . 'db_new.php?id=' . $rParts[1] . '&pagesOnly=1', $currentRecord);
                        } else {
                                if (!intval($nPid)) {
-                                       $nPid = t3lib_div::testInt($rParts[1]) ? -$rParts[1] : $GLOBALS['TSFE']->id;
+                                       $nPid = t3lib_utility_Math::canBeInterpretedAsInteger($rParts[1]) ? -$rParts[1] : $GLOBALS['TSFE']->id;
                                }
                                $out = $this->editPanelLinkWrap_doWrap($string, $adminURL . 'alt_doc.php?edit[' . $rParts[0] . '][' . $nPid . ']=new&noView=' . $nV, $currentRecord);
                        }
index 5529853..9830f6d 100755 (executable)
@@ -1239,7 +1239,7 @@ class tx_impexp {
                        foreach($this->dat['header']['pid_lookup'] as $pid => $recList) {
                                $newPid = isset($this->import_mapId['pages'][$pid]) ? $this->import_mapId['pages'][$pid] : $mainPid;
 
-                               if (t3lib_div::testInt($newPid))        {
+                               if (t3lib_utility_Math::canBeInterpretedAsInteger($newPid))     {
                                        foreach($recList as $tableName => $uidList)     {
                                                if (($tableName!='pages' || !$pagesFromTree[$pid]) && is_array($uidList))       {               // If $mainPid===$newPid then we are on root level and we can consider to move pages as well! (they will not be in the page tree!)
                                                        $uidList = array_reverse(array_keys($uidList));
@@ -1313,7 +1313,7 @@ class tx_impexp {
 
                                        // PID and UID:
                                unset($this->import_data[$table][$ID]['uid']);
-                               if (t3lib_div::testInt($ID))    {       // Updates:
+                               if (t3lib_utility_Math::canBeInterpretedAsInteger($ID)) {       // Updates:
                                        unset($this->import_data[$table][$ID]['pid']);
                                } else {        // Inserts:
                                        $this->import_data[$table][$ID]['pid'] = $pid;
@@ -1823,7 +1823,7 @@ class tx_impexp {
                                                                        $insertValue = t3lib_BEfunc::wsMapId($tempTable,$this->import_mapId[$tempTable][$tempUid]);
 
                                                                                // Look if reference is to a page and the original token value was NOT an integer - then we assume is was an alias and try to look up the new one!
-                                                                       if ($tempTable==='pages' && !t3lib_div::testInt($cfg['subst']['tokenValue']))   {
+                                                                       if ($tempTable==='pages' && !t3lib_utility_Math::canBeInterpretedAsInteger($cfg['subst']['tokenValue']))        {
                                                                                $recWithUniqueValue = t3lib_BEfunc::getRecord($tempTable,$insertValue, 'alias');
                                                                                if ($recWithUniqueValue['alias'])       {
                                                                                        $insertValue = $recWithUniqueValue['alias'];
index daf807f..0657e64 100755 (executable)
@@ -1695,7 +1695,7 @@ REMOTE_ADDR was '".t3lib_div::getIndpEnv('REMOTE_ADDR')."' (".t3lib_div::getIndp
                                        $ok = 0;
                                        $fileCounter++;
                                        if ($tt) {
-                                               if (t3lib_div::testInt($tt)) {
+                                               if (t3lib_utility_Math::canBeInterpretedAsInteger($tt)) {
                                                        if (filesize($theFile) > $tt*1024)      $ok=1;
                                                } else {
                                                        if (fileatime($theFile) < $GLOBALS['EXEC_TIME'] - (intval($tmap[$tt]) * 60 * 60 * 24)) {
@@ -2285,7 +2285,7 @@ REMOTE_ADDR was '".t3lib_div::getIndpEnv('REMOTE_ADDR')."' (".t3lib_div::getIndp
                        else {
                                $smtp_addr = $smtp;
                        }
-                       if (!$smtp || $bad_smtp || !t3lib_div::testInt(ini_get('smtp_port'))) {
+                       if (!$smtp || $bad_smtp || !t3lib_utility_Math::canBeInterpretedAsInteger(ini_get('smtp_port'))) {
                                $this->message($ext, 'Mail configuration is not set correctly', '
                                        <p>
                                                Mail configuration is not set
@@ -5405,7 +5405,7 @@ REMOTE_ADDR was '".t3lib_div::getIndpEnv('REMOTE_ADDR')."' (".t3lib_div::getIndp
                        if ($this->mode=="123" && !count($whichTables) && strstr($file,'_testsite')) {
                                $directJump = $this->action.'&TYPO3_INSTALL[database_type]=import|'.rawurlencode($file);
                        }
-                       $lf=t3lib_div::testInt($k);
+                       $lf=t3lib_utility_Math::canBeInterpretedAsInteger($k);
                        $fShortName = substr($file,strlen(PATH_site));
 
                        $spec1 = $spec2 = '';
@@ -7196,7 +7196,7 @@ REMOTE_ADDR was '".t3lib_div::getIndpEnv('REMOTE_ADDR')."' (".t3lib_div::getIndp
                if (is_array($arr)) {
                        $type[] = $intSize[] = 0;
                        foreach ($arr as $item) {
-                               if (!t3lib_div::testInt($item[1]) && $item[1]!='--div--') {
+                               if (!t3lib_utility_Math::canBeInterpretedAsInteger($item[1]) && $item[1]!='--div--') {
                                        $type[]=strlen($item[1]);
                                } else {
                                        $intSize[]=$item[1];
index 318acdb..8493d49 100644 (file)
@@ -155,7 +155,7 @@ class tx_recycler_model_deletedRecords {
                                // create the filter WHERE-clause
                        if (trim($filter) != '') {
                                $filterWhere = ' AND (' .
-                                       (t3lib_div::testInt($filter) ? 'uid = ' . $filter . ' OR pid = ' . $filter . ' OR ' : '') .
+                                       (t3lib_utility_Math::canBeInterpretedAsInteger($filter) ? 'uid = ' . $filter . ' OR pid = ' . $filter . ' OR ' : '') .
                                        $tcaCtrl['label'] . ' LIKE "%' . $this->escapeValueForLike($filter, $table) . '%"' .
                                ')';
                        }
index 5c28879..047e20a 100644 (file)
@@ -56,7 +56,7 @@ class tx_rsaauth_split_storage extends tx_rsaauth_abstract_storage {
                $result = NULL;
 
                list($keyId, $keyPart1) = $_SESSION['tx_rsaauth_key'];
-               if (t3lib_div::testInt($keyId)) {
+               if (t3lib_utility_Math::canBeInterpretedAsInteger($keyId)) {
 
                        // Remove expired keys (more than 30 minutes old)
                        $GLOBALS['TYPO3_DB']->exec_DELETEquery('tx_rsaauth_keys',
@@ -84,7 +84,7 @@ class tx_rsaauth_split_storage extends tx_rsaauth_abstract_storage {
                        // Remove existing key
                        list($keyId) = $_SESSION['tx_rsaauth_key'];
 
-                       if (t3lib_div::testInt($keyId)) {
+                       if (t3lib_utility_Math::canBeInterpretedAsInteger($keyId)) {
                                $GLOBALS['TYPO3_DB']->exec_DELETEquery('tx_rsaauth_keys',
                                        'uid=' . $keyId);
                                unset($_SESSION['tx_rsaauth_key']);
index 66da7dc..39925e6 100644 (file)
@@ -1290,7 +1290,7 @@ class user_feAdmin        {
                                }
 
                                        // Getting records
-                               if (t3lib_div::testInt($fetch)) {
+                               if (t3lib_utility_Math::canBeInterpretedAsInteger($fetch))      {
                                        $DBrows = $GLOBALS['TSFE']->sys_page->getRecordsByField($this->theTable,'uid',$fetch,$pidLock,'','','1');
                                } elseif ($fetch) {     // $this->conf['email.']['field'] must be a valid field in the table!
                                        $DBrows = $GLOBALS['TSFE']->sys_page->getRecordsByField($this->theTable,$this->conf['email.']['field'],$fetch,$pidLock,'','','100');
@@ -1344,7 +1344,7 @@ class user_feAdmin        {
                if ($userContent['all'])        $userContent['final'] .=$this->cObj->substituteSubpart($userContent['all'], '###SUB_RECORD###', $userContent['accum']);
                if ($adminContent['all'])       $adminContent['final'].=$this->cObj->substituteSubpart($adminContent['all'], '###SUB_RECORD###', $adminContent['accum']);
 
-               if (t3lib_div::testInt($recipient))     {
+               if (t3lib_utility_Math::canBeInterpretedAsInteger($recipient))  {
                        $fe_userRec = $GLOBALS['TSFE']->sys_page->getRawRecord('fe_users',$recipient);
                        $recipient=$fe_userRec['email'];
                }
index 3a21f3b..2fe3ed1 100644 (file)
@@ -500,7 +500,7 @@ page.10.value = HELLO WORLD!
                        reset($pArray);
                        static $i;
                        foreach ($pArray as $k => $v) {
-                               if (t3lib_div::testInt($k)) {
+                               if (t3lib_utility_Math::canBeInterpretedAsInteger($k)) {
                                        if (isset($pArray[$k . "_"])) {
                                                $lines[] = '<tr class="' . ($i++ % 2 == 0 ? 'bgColor4' : 'bgColor6') . '">
                                                        <td nowrap><img src="clear.gif" width="1" height="1" hspace=' . ($c * 10) . ' align="top">' .
index 3a1a490..f165434 100644 (file)
@@ -110,7 +110,7 @@ class tx_tstemplateceditor extends t3lib_extobjbase {
                        $saveId = $tplRow['_ORIG_uid'] ? $tplRow['_ORIG_uid'] : $tplRow['uid'];
 
                                // Update template ?
-                       if (t3lib_div::_POST('submit') || (t3lib_div::testInt(t3lib_div::_POST('submit_x')) && t3lib_div::testInt(t3lib_div::_POST('submit_y')))) {
+                       if (t3lib_div::_POST('submit') || (t3lib_utility_Math::canBeInterpretedAsInteger(t3lib_div::_POST('submit_x')) && t3lib_utility_Math::canBeInterpretedAsInteger(t3lib_div::_POST('submit_y')))) {
                                $tmpl->changed=0;
                                $tmpl->ext_procesInput(t3lib_div::_POST(),$_FILES,$theConstants,$tplRow);
                //              debug($tmpl->changed);
index b94f26a..f7c4e87 100644 (file)
@@ -222,8 +222,8 @@ class tx_tstemplateinfo extends t3lib_extobjbase {
                if ($existTemplate)     {
                                // Update template ?
                        $POST = t3lib_div::_POST();
-                       if ($POST['submit'] || (t3lib_div::testInt($POST['submit_x']) && t3lib_div::testInt($POST['submit_y']))
-                               || $POST['saveclose'] || (t3lib_div::testInt($POST['saveclose_x']) && t3lib_div::testInt($POST['saveclose_y']))) {
+                       if ($POST['submit'] || (t3lib_utility_Math::canBeInterpretedAsInteger($POST['submit_x']) && t3lib_utility_Math::canBeInterpretedAsInteger($POST['submit_y']))
+                               || $POST['saveclose'] || (t3lib_utility_Math::canBeInterpretedAsInteger($POST['saveclose_x']) && t3lib_utility_Math::canBeInterpretedAsInteger($POST['saveclose_y']))) {
                                        // Set the data to be saved
                                $recData = array();
                                $alternativeFileName = array();
@@ -376,8 +376,8 @@ class tx_tstemplateinfo extends t3lib_extobjbase {
                        $numberOfRows = 35;
 
                                // If abort pressed, nothing should be edited:
-                       if ($POST['abort'] || (t3lib_div::testInt($POST['abort_x']) && t3lib_div::testInt($POST['abort_y']))
-                               || $POST['saveclose'] || (t3lib_div::testInt($POST['saveclose_x']) && t3lib_div::testInt($POST['saveclose_y']))) {
+                       if ($POST['abort'] || (t3lib_utility_Math::canBeInterpretedAsInteger($POST['abort_x']) && t3lib_utility_Math::canBeInterpretedAsInteger($POST['abort_y']))
+                               || $POST['saveclose'] || (t3lib_utility_Math::canBeInterpretedAsInteger($POST['saveclose_x']) && t3lib_utility_Math::canBeInterpretedAsInteger($POST['saveclose_y']))) {
                                unset($e);
                        }
 
index 5132544..b7a349f 100644 (file)
@@ -145,7 +145,7 @@ class tx_tstemplateobjbrowser extends t3lib_extobjbase {
                        $result=array();
                        if (is_array($propertyArray))           {
                                foreach ($propertyArray as $key => $val) {
-                                       if (t3lib_div::testInt($key))   {       // If num-arrays
+                                       if (t3lib_utility_Math::canBeInterpretedAsInteger($key))        {       // If num-arrays
                                                $result[$key]=$TSobjTable[$ObjectKind]["prop"]["1,2,3"];
                                        } else {        // standard
                                                $result[$key]=$TSobjTable[$ObjectKind]["prop"][$key];
index c7bae51..fecce2d 100644 (file)
@@ -114,7 +114,7 @@ class SC_wizard_add {
                        // Else proceed:
                if ($this->returnEditConf)      {       // If a new id has returned from a newly created record...
                        $eC = unserialize($this->returnEditConf);
-                       if (is_array($eC[$this->table]) && t3lib_div::testInt($this->P['uid'])) {
+                       if (is_array($eC[$this->table]) && t3lib_utility_Math::canBeInterpretedAsInteger($this->P['uid']))      {
 
                                        // Getting id and cmd from returning editConf array.
                                reset($eC[$this->table]);
index 1d2dd57..2637a91 100644 (file)
@@ -85,7 +85,7 @@ class SC_wizard_edit {
                        $fTable = $this->P['currentValue']<0 ? $config['neg_foreign_table'] : $config['foreign_table'];
 
                                // Detecting the various allowed field type setups and acting accordingly.
-                       if (is_array($config) && $config['type']=='select' && !$config['MM'] && $config['maxitems']<=1 && t3lib_div::testInt($this->P['currentValue']) && $this->P['currentValue'] && $fTable)  {       // SINGLE value:
+                       if (is_array($config) && $config['type']=='select' && !$config['MM'] && $config['maxitems']<=1 && t3lib_utility_Math::canBeInterpretedAsInteger($this->P['currentValue']) && $this->P['currentValue'] && $fTable)       {       // SINGLE value:
                                $redirectUrl = 'alt_doc.php?returnUrl=' . rawurlencode('wizard_edit.php?doClose=1') . '&edit[' . $fTable . '][' . $this->P['currentValue'] . ']=edit';
                                t3lib_utility_Http::redirect($redirectUrl);
                        } elseif (is_array($config) && $this->P['currentSelectedValues'] && (($config['type']=='select' && $config['foreign_table']) || ($config['type']=='group' && $config['internal_type']=='db')))  {       // MULTIPLE VALUES:
index c39f406..3efd823 100644 (file)
@@ -676,7 +676,7 @@ class SC_wizard_forms {
                        $cmd='row_down';
                }
 
-               if ($cmd && t3lib_div::testInt($kk)) {
+               if ($cmd && t3lib_utility_Math::canBeInterpretedAsInteger($kk)) {
                        if (substr($cmd,0,4)=='row_')   {
                                switch($cmd)    {
                                        case 'row_remove':
index 0f94995..683c783 100644 (file)
@@ -490,7 +490,7 @@ class SC_wizard_table {
                        $cmd='row_down';
                }
 
-               if ($cmd && t3lib_div::testInt($kk)) {
+               if ($cmd && t3lib_utility_Math::canBeInterpretedAsInteger($kk)) {
                        if (substr($cmd,0,4)=='row_')   {
                                switch($cmd)    {
                                        case 'row_remove':