Project

General

Profile

Bug #23114 » 15021_v1.diff

Administrator Admin, 2010-07-06 23:57

View differences:

typo3/class.browse_links.php (working copy)
}
// Draw the record list IF there is a page id to expand:
if ($expPageId && t3lib_div::testInt($expPageId) && $BE_USER->isInWebMount($expPageId)) {
if ($expPageId && is_int($expPageId) && $BE_USER->isInWebMount($expPageId)) {
// Set header:
$out.=$this->barheader($GLOBALS['LANG']->getLL('contentElements').':');
......
global $TCA,$BE_USER, $BACK_PATH;
$out='';
if ($this->expandPage>=0 && t3lib_div::testInt($this->expandPage) && $BE_USER->isInWebMount($this->expandPage)) {
if ($this->expandPage>=0 && is_int($this->expandPage) && $BE_USER->isInWebMount($this->expandPage)) {
// Set array with table names to list:
if (!strcmp(trim($tables),'*')) {
......
$id = array_shift($parameters);
if ($id) {
// Checking if the id-parameter is an alias.
if (!t3lib_div::testInt($id)) {
if (!is_int($id)) {
list($idPartR) = t3lib_BEfunc::getRecordsByField('pages','alias',$id);
$id=intval($idPartR['uid']);
}
typo3/sysext/recycler/classes/model/class.tx_recycler_model_deletedRecords.php (working copy)
// create the filter WHERE-clause
if (trim($filter) != '') {
$filterWhere = ' AND (' .
(t3lib_div::testInt($filter) ? 'uid = ' . $filter . ' OR pid = ' . $filter . ' OR ' : '') .
(is_int($filter) ? 'uid = ' . $filter . ' OR pid = ' . $filter . ' OR ' : '') .
$tcaCtrl['label'] . ' LIKE "%' . $this->escapeValueForLike($filter, $table) . '%"' .
')';
}
typo3/sysext/install/mod/class.tx_install.php (working copy)
$ok = 0;
$fileCounter++;
if ($tt) {
if (t3lib_div::testInt($tt)) {
if (is_int($tt)) {
if (filesize($theFile) > $tt*1024) $ok=1;
} else {
if (fileatime($theFile) < $GLOBALS['EXEC_TIME'] - (intval($tmap[$tt]) * 60 * 60 * 24)) {
......
else {
$smtp_addr = $smtp;
}
if (!$smtp || $bad_smtp || !t3lib_div::testInt(ini_get('smtp_port'))) {
if (!$smtp || $bad_smtp || !is_int(ini_get('smtp_port'))) {
$this->message($ext, 'Mail configuration is not set correctly', '
<p>
Mail configuration is not set
......
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=is_int($k);
$fShortName = substr($file,strlen(PATH_site));
$spec1 = $spec2 = '';
......
if (is_array($arr)) {
$type[] = $intSize[] = 0;
foreach ($arr as $item) {
if (!t3lib_div::testInt($item[1]) && $item[1]!='--div--') {
if (!is_int($item[1]) && $item[1]!='--div--') {
$type[]=strlen($item[1]);
} else {
$intSize[]=$item[1];
typo3/sysext/tstemplate_info/class.tx_tstemplateinfo.php (working copy)
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'] || (is_int($POST['submit_x']) && is_int($POST['submit_y']))
|| $POST['saveclose'] || (is_int($POST['saveclose_x']) && is_int($POST['saveclose_y']))) {
// Set the data to be saved
$recData = array();
$alternativeFileName = array();
......
$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'] || (is_int($POST['abort_x']) && is_int($POST['abort_y']))
|| $POST['saveclose'] || (is_int($POST['saveclose_x']) && is_int($POST['saveclose_y']))) {
unset($e);
}
typo3/sysext/tstemplate_objbrowser/class.tx_tstemplateobjbrowser.php (working copy)
$result=array();
if (is_array($propertyArray)) {
foreach ($propertyArray as $key => $val) {
if (t3lib_div::testInt($key)) { // If num-arrays
if (is_int($key)) { // If num-arrays
$result[$key]=$TSobjTable[$ObjectKind]["prop"]["1,2,3"];
} else { // standard
$result[$key]=$TSobjTable[$ObjectKind]["prop"][$key];
typo3/sysext/feedit/view/class.tx_feedit_editpanel.php (working copy)
$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 = is_int($rParts[1]) ? -$rParts[1] : $GLOBALS['TSFE']->id;
}
$out = $this->editPanelLinkWrap_doWrap($string, $adminURL . 'alt_doc.php?edit[' . $rParts[0] . '][' . $nPid . ']=new&noView=' . $nV, $currentRecord);
}
typo3/sysext/tstemplate/ts/index.php (working copy)
reset($pArray);
static $i;
foreach ($pArray as $k => $v) {
if (t3lib_div::testInt($k)) {
if (is_int($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">' .
typo3/sysext/extbase/Classes/Persistence/Storage/Typo3DbBackend.php (working copy)
$clearCacheCommands = t3lib_div::trimExplode(',',strtolower($this->pageTSConfigCache[$storagePage]['TCEMAIN.']['clearCacheCmd']),1);
$clearCacheCommands = array_unique($clearCacheCommands);
foreach ($clearCacheCommands as $clearCacheCommand) {
if (t3lib_div::testInt($clearCacheCommand)) {
if (is_int($clearCacheCommand)) {
$pageIdsToClear[] = $clearCacheCommand;
}
}
typo3/sysext/beuser/mod/index.php (working copy)
$where_clause = '';
$orderBy = 'u.username';
if (t3lib_div::testInt($GLOBALS['TYPO3_CONF_VARS']['BE']['sessionTimeout'])) {
if (is_int($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']);
typo3/sysext/rsaauth/sv1/storage/class.tx_rsaauth_split_storage.php (working copy)
$result = null;
list($keyId, $keyPart1) = $_SESSION['tx_rsaauth_key'];
if (t3lib_div::testInt($keyId)) {
if (is_int($keyId)) {
// Remove expired keys (more than 30 minutes old)
$GLOBALS['TYPO3_DB']->exec_DELETEquery('tx_rsaauth_keys',
......
// Remove existing key
list($keyId) = $_SESSION['tx_rsaauth_key'];
if (t3lib_div::testInt($keyId)) {
if (is_int($keyId)) {
$GLOBALS['TYPO3_DB']->exec_DELETEquery('tx_rsaauth_keys',
'uid=' . $keyId);
unset($_SESSION['tx_rsaauth_key']);
typo3/sysext/cms/tslib/class.tslib_pagegen.php (working copy)
if ($needle=='int' || $needle=='integer') { // Integer
if (t3lib_div::testInt($haystack)) {
if (is_int($haystack)) {
$OK = true;
}
......
} elseif (strstr($needle,'-')) { // Range
if (t3lib_div::testInt($haystack)) {
if (is_int($haystack)) {
$range = explode('-',$needle);
if ($range[0] <= $haystack && $range[1] >= $haystack) {
$OK = true;
typo3/sysext/cms/tslib/class.tslib_menu.php (working copy)
$value=$GLOBALS['TSFE']->page['uid'];
}
$items=t3lib_div::intExplode(',',$value);
if (t3lib_div::testInt($this->conf['special.']['depth'])) {
if (is_int($this->conf['special.']['depth'])) {
$depth = t3lib_div::intInRange($this->conf['special.']['depth'],1,20); // Tree depth
} else {
$depth=20;
......
}
// depth, limit, extra where
if (t3lib_div::testInt($this->conf['special.']['depth'])) {
if (is_int($this->conf['special.']['depth'])) {
$depth = t3lib_div::intInRange($this->conf['special.']['depth'],0,20); // Tree depth
} else {
$depth=20;
......
case 'rootline':
$begin_end = explode('|', $this->parent_cObj->stdWrap($this->conf['special.']['range'], $this->conf['special.']['range.']));
$begin_end[0] = intval($begin_end[0]);
if (!t3lib_div::testInt($begin_end[1])) {
if (!is_int($begin_end[1])) {
$begin_end[1] = -1;
}
......
$conf = array(
'parameter' => is_array($overrideArray) && $overrideArray['uid'] ? $overrideArray['uid'] : $page['uid'],
);
if ($typeOverride && t3lib_div::testInt($typeOverride)) {
if ($typeOverride && is_int($typeOverride)) {
$conf['parameter'] .= ',' . $typeOverride;
}
if ($addParams) {
typo3/sysext/cms/tslib/class.tslib_content.php (working copy)
$page = $GLOBALS['TSFE']->page;
if (!$theRedirect) { // Internal: Just submit to current page
$LD = $GLOBALS['TSFE']->tmpl->linkData($page, $conf['target'], $conf['no_cache'],'index.php', '', $this->getClosestMPvalueForPage($page['uid']));
} elseif (t3lib_div::testInt($theRedirect)) { // Internal: Submit to page with ID $theRedirect
} elseif (is_int($theRedirect)) { // Internal: Submit to page with ID $theRedirect
$page = $GLOBALS['TSFE']->sys_page->getPage_noCheck($theRedirect);
$LD = $GLOBALS['TSFE']->tmpl->linkData($page, $conf['target'], $conf['no_cache'],'index.php', '', $this->getClosestMPvalueForPage($page['uid']));
} else { // External URL, redirect-hidden field is rendered!
......
// Formtype (where to submit to!):
$formtype = $propertyOverride['type'] ? $propertyOverride['type'] : $this->stdWrap($conf['type'], $conf['type.']);
if (t3lib_div::testInt($formtype)) { // Submit to a specific page
if (is_int($formtype)) { // Submit to a specific page
$page = $GLOBALS['TSFE']->sys_page->getPage_noCheck($formtype);
$LD_A = $GLOBALS['TSFE']->tmpl->linkData($page, $conf['target'], $conf['no_cache'], '', '', $this->getClosestMPvalueForPage($page['uid']));
$action = $LD_A['totalURL'];
} elseif ($formtype) { // Submit to external script
$LD_A = $LD;
$action = $formtype;
} elseif (t3lib_div::testInt($theRedirect)) {
} elseif (is_int($theRedirect)) {
$LD_A = $LD;
$action = $LD_A['totalURL'];
} else { // Submit to "nothing" - which is current page
......
$depth=100;
// the startId is found
$theStartId=0;
if (t3lib_div::testInt(t3lib_div::_GP('stype'))) {
if (is_int(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!!
......
$search->build_search_query($endClause);
// count...
if (t3lib_div::testInt(t3lib_div::_GP('scount'))) {
if (is_int(t3lib_div::_GP('scount'))) {
$search->res_count = t3lib_div::_GP('scount');
} else {
$search->count_query();
......
} else {
if (is_array($row)) {
foreach ($row as $field => $value) {
if (!t3lib_div::testInt($field)) {
if (!is_int($field)) {
if ($HSC) {
$value = htmlspecialchars($value);
}
......
*/
function listNum($content,$listNum,$char) {
$char = $char ? $char : ',';
if (t3lib_div::testInt($char)) {
if (is_int($char)) {
$char = chr($char);
}
$temp = explode($char,$content);
......
$valArr=explode($conf['token'],$value);
if (count($valArr) && (t3lib_div::testInt($conf['returnKey']) || $conf['returnKey.'])) {
if (count($valArr) && (is_int($conf['returnKey']) || $conf['returnKey.'])) {
$key = intval($this->stdWrap($conf['returnKey'],$conf['returnKey.']));
$content = isset($valArr[$key]) ? $valArr[$key] : '';
} else {
......
$link_param = trim($this->stdWrap($conf['parameter'],$conf['parameter.']));
$sectionMark = trim($this->stdWrap($conf['section'],$conf['section.']));
$sectionMark = $sectionMark ? (t3lib_div::testInt($sectionMark)?'#c':'#').$sectionMark : '';
$sectionMark = $sectionMark ? (is_int($sectionMark)?'#c':'#').$sectionMark : '';
$initP = '?id='.$GLOBALS['TSFE']->id.'&type='.$GLOBALS['TSFE']->type;
$this->lastTypoLinkUrl = '';
$this->lastTypoLinkTarget = '';
......
$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 (!is_int($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,'/');
......
if (!strcmp($link_param,'')) {$link_param=$GLOBALS['TSFE']->id;} // 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 = (is_int($sectionMark)?'#c':'#').$sectionMark;
}
unset($theTypeP);
if (count($pairParts)>1) {
......
$conf['additionalParams'].= isset($pairParts[2]) ? $pairParts[2] : '';
}
// Checking if the id-parameter is an alias.
if (!t3lib_div::testInt($link_param)) {
if (!is_int($link_param)) {
$link_param = $GLOBALS['TSFE']->sys_page->getPageIdFromAlias($link_param);
}
......
* @return string The formatted string
*/
function calcAge($seconds,$labels) {
if (t3lib_div::testInt($labels)) {
if (is_int($labels)) {
$labels = ' min| hrs| days| yrs';
} else {
$labels=str_replace('"','',$labels);
typo3/sysext/cms/tslib/class.tslib_pibase.php (working copy)
$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 (!is_int($tempPiVars[$k]) || $tempPiVars[$k]<$lowerThan) unset($tempPiVars[$k]);
}
if (!count($tempPiVars)) return 1;
}
......
$tempArr=$sheetArray;
foreach($fieldNameArr as $k => $v) {
if (t3lib_div::testInt($v)) {
if (is_int($v)) {
if (is_array($tempArr)) {
$c=0;
foreach($tempArr as $values) {
typo3/sysext/cms/tslib/class.tslib_fe.php (working copy)
// 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 = is_int($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 && !is_int($this->id)) {
$aid = $this->sys_page->getPageIdFromAlias($this->id);
if ($aid) {
$this->id = $aid;
......
*/
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']) && is_int($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 {
typo3/sysext/cms/tslib/index_ts.php (working copy)
// 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 (is_int($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']);
}
typo3/sysext/cms/layout/db_layout.php (working copy)
// 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 = (is_int($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;
......
// Select element matrix:
if ($this->eRParts[0]=='tt_content' && t3lib_div::testInt($this->eRParts[1])) {
if ($this->eRParts[0]=='tt_content' && is_int($this->eRParts[1])) {
$posMap = t3lib_div::makeInstance('ext_posMap');
$posMap->backPath = $BACK_PATH;
$posMap->cur_sys_language=$this->current_sys_language;
......
t3lib_iconWorks::getSpriteIcon('actions-page-move') .
'</a>';
// Move record
if (t3lib_div::testInt($this->eRParts[1])) {
if (is_int($this->eRParts[1])) {
$buttons['move_record'] = '<a href="' . htmlspecialchars($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' => $LANG->getLL('move_' . ($this->eRParts[0] == 'tt_content' ? 'record' : 'page'), 1))) .
'</a>';
typo3/sysext/impexp/class.tx_impexp.php (working copy)
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 (is_int($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));
......
// PID and UID:
unset($this->import_data[$table][$ID]['uid']);
if (t3lib_div::testInt($ID)) { // Updates:
if (is_int($ID)) { // Updates:
unset($this->import_data[$table][$ID]['pid']);
} else { // Inserts:
$this->import_data[$table][$ID]['pid'] = $pid;
......
$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' && !is_int($cfg['subst']['tokenValue'])) {
$recWithUniqueValue = t3lib_BEfunc::getRecord($tempTable,$insertValue, 'alias');
if ($recWithUniqueValue['alias']) {
$insertValue = $recWithUniqueValue['alias'];
typo3/sysext/tstemplate_ceditor/class.tx_tstemplateceditor.php (working copy)
$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') || (is_int(t3lib_div::_POST('submit_x')) && is_int(t3lib_div::_POST('submit_y')))) {
$tmpl->changed=0;
$tmpl->ext_procesInput(t3lib_div::_POST(),$_FILES,$theConstants,$tplRow);
// debug($tmpl->changed);
typo3/wizard_forms.php (working copy)
$cmd='row_down';
}
if ($cmd && t3lib_div::testInt($kk)) {
if ($cmd && is_int($kk)) {
if (substr($cmd,0,4)=='row_') {
switch($cmd) {
case 'row_remove':
typo3/wizard_add.php (working copy)
// 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]) && is_int($this->P['uid'])) {
// Getting id and cmd from returning editConf array.
reset($eC[$this->table]);
typo3/wizard_table.php (working copy)
$cmd='row_down';
}
if ($cmd && t3lib_div::testInt($kk)) {
if ($cmd && is_int($kk)) {
if (substr($cmd,0,4)=='row_') {
switch($cmd) {
case 'row_remove':
typo3/mod/tools/em/class.em_index.php (working copy)
if(strlen($k) && is_array($v)) {
$lines .= str_repeat(TAB,$level)."'".$k."' => ".$this->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."' => ".(is_int($v) ? intval($v) : "'".t3lib_div::slashJS(trim($v),1)."'").','.LF;
}
}
typo3/mod/user/ws/index.php (working copy)
foreach($post['items'] as $item => $v) {
list($table,$uid) = explode(':',$item,2);
if ($GLOBALS['TCA'][$table] && t3lib_div::testInt($uid)) {
if ($GLOBALS['TCA'][$table] && is_int($uid)) {
switch($post['_with_selected_do']) {
case "stage_-1":
$cmdArray[$table][$uid]['version']['action'] = 'setStage';
typo3/mod/user/ws/class.wslib_gui.php (working copy)
// Traverse $pArray
if (is_array($pArray)) {
foreach($pArray as $k => $v) {
if (t3lib_div::testInt($k)) {
if (is_int($k)) {
// If there are elements on this level, output a divider row which just creates a little visual space.
if (is_array($pArray[$k.'_'])) {
......
// Traverse $pArray
if (is_array($pArray)) {
foreach($pArray as $k => $v) {
if (t3lib_div::testInt($k)) {
if (is_int($k)) {
if (is_array($pArray[$k.'_'])) {
foreach($pArray[$k.'_'] as $table => $oidArray) {
typo3/classes/class.shortcutmenu.php (working copy)
}
$pageId = $this->getLinkedPageId($row['url']);
if(t3lib_div::testInt($pageId)) {
if(is_int($pageId)) {
// check for webmount access
if(!$GLOBALS['BE_USER']->isInWebMount($pageId)) {
continue;
......
// 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(is_int($pageId)) {
$page = t3lib_BEfunc::getRecord('pages', $pageId);
if(count($page)) {
// set the name to the title of the page
typo3/alt_doc.php (working copy)
// DELETE + UNDO buttons:
if (!$this->errorC && !$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' && is_int($this->firstEl['uid'])) {
// Delete:
if ($this->firstEl['deleteAccess'] && !$TCA[$this->firstEl['table']]['ctrl']['readOnly'] && !$this->getNewIconMode($this->firstEl['table'],'disableDelete')) {
typo3/alt_shortcut.php (working copy)
// Lookup the title of this page and use it as default description
$page_id = $this->getLinkedPageId($url);
if (t3lib_div::testInt($page_id)) {
if (is_int($page_id)) {
if (preg_match('/\&edit\[(.*)\]\[(.*)\]=edit/',$url,$matches)) {
// Edit record
$description = ''; // TODO: Set something useful
......
// Deleting shortcuts:
if (strcmp($this->deleteCategory,'')) {
if (t3lib_div::testInt($this->deleteCategory)) {
if (is_int($this->deleteCategory)) {
$GLOBALS['TYPO3_DB']->exec_DELETEquery('sys_be_shortcuts', 'sc_group='.intval($this->deleteCategory).$addUSERWhere);
}
}
......
}
$page_id = $this->getLinkedPageId($row['url']);
if (t3lib_div::testInt($page_id)) {
if (is_int($page_id)) {
// Check for webmount access
if (!$GLOBALS['BE_USER']->isInWebMount($page_id)) continue;
......
}
// Load alternative table/uid into editing form.
if (count($this->alternativeTableUid)==2 && isset($TCA[$this->alternativeTableUid[0]]) && t3lib_div::testInt($this->alternativeTableUid[1])) {
if (count($this->alternativeTableUid)==2 && isset($TCA[$this->alternativeTableUid[0]]) && is_int($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();');
}
......
if (!(count($this->alternativeTableUid)==2 && $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 ('.$BE_USER->getPagePermsClause(2).' OR '.$BE_USER->getPagePermsClause(16).')';
if (t3lib_div::testInt($this->editPage)) {
if (is_int($this->editPage)) {
$this->theEditRec = t3lib_BEfunc::getRecordWSOL('pages',$this->editPage,'*',$where);
} else {
$records = t3lib_BEfunc::getRecordsByField('pages','alias',$this->editPage,$where);
......
// edit alternative table/uid
if(count($this->alternativeTableUid) == 2
&& isset($GLOBALS['TCA'][$this->alternativeTableUid[0]])
&& t3lib_div::testInt($this->alternativeTableUid[1])) {
&& is_int($this->alternativeTableUid[1])) {
$data['type'] = 'alternative';
$data['alternativeTable'] = $this->alternativeTableUid[0];
$data['alternativeUid'] = $this->alternativeTableUid[1];
typo3/init.php (working copy)
// ****************
ob_clean();
if (extension_loaded('zlib') && $TYPO3_CONF_VARS['BE']['compressionLevel']) {
if (t3lib_div::testInt($TYPO3_CONF_VARS['BE']['compressionLevel'])) {
if (is_int($TYPO3_CONF_VARS['BE']['compressionLevel'])) {
@ini_set('zlib.output_compression_level', $TYPO3_CONF_VARS['BE']['compressionLevel']);
}
ob_start('ob_gzhandler');
typo3/backend.php (working copy)
$where = ' AND ('.$GLOBALS['BE_USER']->getPagePermsClause(2)
.' OR '.$GLOBALS['BE_USER']->getPagePermsClause(16).')';
if(t3lib_div::testInt($editId)) {
if(is_int($editId)) {
$editRecord = t3lib_BEfunc::getRecordWSOL('pages', $editId, '*', $where);
} else {
$records = t3lib_BEfunc::getRecordsByField('pages', 'alias', $editId, $where);
typo3/wizard_edit.php (working copy)
$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 && is_int($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:
t3lib/class.t3lib_tsparser_ext.php (working copy)
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 (is_int($key)) {
$keyArr_num[$key]=$arr[$key];
} else {
$keyArr_alpha[$key]=$arr[$key];
......
$out[$key] = $val;
break;
default:
if (t3lib_div::testInt($key)) {
if (is_int($key)) {
$constRefs = explode(',',$val);
foreach ($constRefs as $const) {
$const=trim($const);
t3lib/class.t3lib_tceforms_inline.php (working copy)
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 (is_int($row['uid'])) {
$inlineView = unserialize($GLOBALS['BE_USER']->uc['inlineView']);
$this->inlineView = $inlineView[$table][$row['uid']];
}
......
$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 = is_int($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:
......
$comboRecord = array();
// If record does already exist, load it:
if ($rec[$foreign_selector] && t3lib_div::testInt($rec[$foreign_selector])) {
if ($rec[$foreign_selector] && is_int($rec[$foreign_selector])) {
$comboRecord = $this->getRecord(
$this->inlineFirstPid,
$comboConfig['foreign_table'],
......
$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 || !is_int($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') {
......
*/
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) || is_int($type)) {
// The current level:
$current = $this->inlineStructure['unstable'];
// The parent level:
......
$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 (is_int($top['uid'])) {
$inlineView = (array)unserialize($GLOBALS['BE_USER']->uc['inlineView']);
$inlineViewCurrent =& $inlineView[$top['table']][$top['uid']];
......
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']) && is_int($pageTS['TCAdefaults.'][$table.'.']['pid'])) {
$newRecordPid = $pageTS['TCAdefaults.'][$table.'.']['pid'];
} elseif (isset($parentPid) && t3lib_div::testInt($parentPid)) {
} elseif (isset($parentPid) && is_int($parentPid)) {
$newRecordPid = $parentPid;
}
return $newRecordPid;
......
// 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 (is_int($this->inlineFirstPid)) {
$calcPRec = t3lib_BEfunc::getRecord('pages', $this->inlineFirstPid);
if(!is_array($calcPRec)) {
return false;
t3lib/class.t3lib_compressor.php (working copy)
if (extension_loaded('zlib') && $compressionLevel) {
$this->createGzipped = TRUE;
// $compressionLevel can also be TRUE
if (t3lib_div::testInt($compressionLevel)) {
if (is_int($compressionLevel)) {
$this->gzipCompressionLevel = $compressionLevel;
}
}
t3lib/class.t3lib_parsehtml_proc.php (working copy)
$sectionMark = trim($link_params_parts[1]);
if (!strcmp($idPart,'')) { $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 (!is_int($idPart)) {
list($idPartR) = t3lib_BEfunc::getRecordsByField('pages','alias',$idPart);
$idPart = intval($idPartR['uid']);
}
t3lib/class.t3lib_loaddbgroup.php (working copy)
$theID = strrev($parts[0]);
// Check that the id IS an integer:
if (t3lib_div::testInt($theID)) {
if (is_int($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:
......
$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 (is_int($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 (!(is_int($updateToUid) && $updateToUid > 0)) {
$updateToUid = 0;
}
$fields = 'uid,'.$foreign_field.($symmetric_field ? ','.$symmetric_field : '');
......
$theID = strrev($parts[0]);
$theTable = strrev($parts[1]);
if ( t3lib_div::testInt($theID) && (!$theTable || !strcmp($theTable,$fTable) || !strcmp($theTable,$nfTable)) ) {
if ( is_int($theID) && (!$theTable || !strcmp($theTable,$fTable) || !strcmp($theTable,$nfTable)) ) {
$valueArray[$key]= $theTable && strcmp($theTable,$fTable) ? $theID*-1 : $theID;
}
}
......
* @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 is_int($childRec['uid']) && $parentConf['symmetric_field'] && $parentUid == $childRec[$parentConf['symmetric_field']]
? true
: false;
}
t3lib/matchcondition/class.t3lib_matchcondition_abstract.php (working copy)
// comp
$values = t3lib_div::trimExplode(',', $value, true);
foreach ($values as $test) {
if (t3lib_div::testInt($test)) {
if (is_int($test)) {
$test = '=' . $test;
}
if ($this->compareNumber($test, $theTestValue)) {
t3lib/class.t3lib_div.php (working copy)
*
* @param mixed Any input variable to test.
* @return boolean Returns true if string is an integer
* @ignore
* @deprecated since TYPO3 4.5 - Use the PHP function is_int instead
*/
public static function testInt($var) {
return !strcmp($var,intval($var));
public static function testInt($var) {
return is_int($var);
}
/**
......
if(isset($options['grandParentTagMap'][$stackData['grandParentTagName'].'/'.$stackData['parentTagName']])) { // Use tag based on grand-parent + parent tag name
$attr.=' index="'.htmlspecialchars($tagName).'"';
$tagName = (string)$options['grandParentTagMap'][$stackData['grandParentTagName'].'/'.$stackData['parentTagName']];
}elseif(isset($options['parentTagMap'][$stackData['parentTagName'].':_IS_NUM']) && self::testInt($tagName)) { // Use tag based on parent tag name + if current tag is numeric
}elseif(isset($options['parentTagMap'][$stackData['parentTagName'].':_IS_NUM']) && is_int($tagName)) { // Use tag based on parent tag name + if current tag is numeric
$attr.=' index="'.htmlspecialchars($tagName).'"';
$tagName = (string)$options['parentTagMap'][$stackData['parentTagName'].':_IS_NUM'];
}elseif(isset($options['parentTagMap'][$stackData['parentTagName'].':'.$tagName])) { // Use tag based on parent tag name + current tag
t3lib/class.t3lib_cli.php (working copy)
$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}==='-' && !is_int($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;
t3lib/class.t3lib_softrefproc.php (working copy)
// Checking if the id-parameter is an alias.
if (strlen($link_param)) {
if (!t3lib_div::testInt($link_param)) {
if (!is_int($link_param)) {
$finalTagParts['alias'] = $link_param;
$link_param = $this->getPageIdFromAlias($link_param);
}
......
// Add anchor if applicable
if (strlen($tLP['anchor'])) {
if (t3lib_div::testInt($tLP['anchor'])) { // Anchor is assumed to point to a content elements:
if (is_int($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();
t3lib/class.t3lib_parsehtml.php (working copy)
} 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']:(is_int($v)?'':'"');
$attr.='='.$dash.$v.$dash;
}
}
t3lib/class.t3lib_arraybrowser.php (working copy)
// If varname is set:
if ($this->varName && !$this->dontLinkVar) {
$variableName = $this->varName.'[\''.str_replace('.','\'][\'',$depth).'\'] = '.(!t3lib_div::testInt($theValue) ? '\''.addslashes($theValue).'\'' : $theValue).'; ';
$variableName = $this->varName.'[\''.str_replace('.','\'][\'',$depth).'\'] = '.(!is_int($theValue) ? '\''.addslashes($theValue).'\'' : $theValue).'; ';
$label = '<a href="index.php?varname=' . urlencode($variableName) . '#varname">' . $label . '</a>';
}
t3lib/class.t3lib_tstemplate.php (working copy)
$keyArr = array();
$setupArrKeys = array_keys($setupArr);
foreach ($setupArrKeys as $key) {
if ($acceptOnlyProperties || t3lib_div::testInt($key)) {
if ($acceptOnlyProperties || is_int($key)) {
$keyArr[] = intval($key);
}
}
......
// typeNum
$typeNum = $this->setup[$LD['target'].'.']['typeNum'];
if (!t3lib_div::testInt($typeOverride) && intval($GLOBALS['TSFE']->config['config']['forceTypeValue'])) {
if (!is_int($typeOverride) && intval($GLOBALS['TSFE']->config['config']['forceTypeValue'])) {
$typeOverride = intval($GLOBALS['TSFE']->config['config']['forceTypeValue']);
}
if (strcmp($typeOverride,'')) { $typeNum = $typeOverride; } // Override...
t3lib/class.t3lib_refindex.php (working copy)
// Word indexing:
t3lib_div::loadTCA($table);
foreach($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],'') && !is_int($record[$field])) {
$this->words_strings[$field] = $record[$field];
}
}
t3lib/class.t3lib_timetrack.php (working copy)
$c=0;
// First, find number of entries
foreach ($arr as $k => $v) {
if (t3lib_div::testInt($k)) {
if (is_int($k)) {
$ac++;
}
}
// Traverse through entries
$subtime=0;
foreach ($arr as $k => $v) {
if (t3lib_div::testInt($k)) {
if (is_int($k)) {
$c++;
$deeper = is_array($arr[$k.'.']) ? 1 : 0;
......
// Traverse array again, this time substitute the unique hash with the red key
foreach ($arr as $k => $v) {
if (t3lib_div::testInt($k)) {
if (is_int($k)) {
if (strlen($this->tsStackLog[$v]['content'])) {
$content = str_replace($v, '<strong style="color:red;">['.$this->tsStackLog[$v]['key'].']</strong>', $content);
}
t3lib/class.t3lib_befunc.php (working copy)
// If there is a srcPointer value:
if ($srcPointer) {
if (t3lib_div::testInt($srcPointer)) { // If integer, then its a record we will look up:
if (is_int($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);
......
*/
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 || !is_int($titleLength) || $titleLength < 0) {
$titleLength = $GLOBALS['BE_USER']->uc['titleLen'];
}
$titleOrig = htmlspecialchars($title);
......
*/
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 (is_int($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');
......
* @see t3lib_TCEforms::getTSCpid()
*/
public static function getPidForModTSconfig($table, $uid, $pid) {
$retVal = ($table=='pages' && t3lib_div::testInt($uid)) ? $uid : $pid;
$retVal = ($table=='pages' && is_int($uid)) ? $uid : $pid;
return $retVal;
}
t3lib/class.t3lib_tceforms.php (working copy)
// 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
$PA['label'] = t3lib_div::deHSCentities(htmlspecialchars($PA['label']));
if (t3lib_div::testInt($row['uid']) && $PA['fieldTSConfig']['linkTitleToSelf'] && !t3lib_div::_GP('columnsOnly')) {
if (is_int($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());
$PA['label'] = '<a href="'.htmlspecialchars($lTTS_url).'">'.$PA['label'].'</a>';
}
......
if (is_array($TCA[$table]['types'][$typeNum]['bitmask_excludelist_bits'])) {
foreach($TCA[$table]['types'][$typeNum]['bitmask_excludelist_bits'] as $bitKey => $eList) {
$bit=substr($bitKey,1);
if (t3lib_div::testInt($bit)) {
if (is_int($bit)) {
$bit = t3lib_div::intInRange($bit,0,30);
if (
(substr($bitKey,0,1)=='-' && !($sTValue&pow(2,$bit))) ||
......
case 'script':
case 'popup':
case 'colorbox':
if (!$wConf['notNewRecords'] || t3lib_div::testInt($row['uid'])) {
if (!$wConf['notNewRecords'] || is_int($row['uid'])) {
// Setting &P array contents:
$params = array();
......
}
// 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 (!is_int($sys_language_uid)) {
foreach($this->cachedLanguageFlag[$mainKey] as $rUid => $cD) {
if ('v'.$cD['ISOcode']===$sys_language_uid) {
$sys_language_uid = $rUid;
t3lib/class.t3lib_clipboard.php (working copy)
// NumberTabs
$clNP = $BE_USER->getTSConfigVal('options.clipboardNumberPads');
if (t3lib_div::testInt($clNP) && $clNP>=0) {
if (is_int($clNP) && $clNP>=0) {
$this->numberTabs = t3lib_div::intInRange($clNP,0,20);
}
t3lib/class.t3lib_tcemain.php (working copy)
$old_pid_value = '';
$this->autoVersioningUpdate = FALSE;
if (!t3lib_div::testInt($id)) { // Is it a new record? (Then Id is a string)
if (!is_int($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
......
// 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 || !is_int($id)) {
$this->remapStackRecords[$table][$id] = array('remapStackIndex' => count($this->remapStack));
$this->remapStack[] = array(
'func' => 'checkValue_inline_processDBdata',
......
'field' => $field
);
unset($res['value']);
} elseif($value || t3lib_div::testInt($id)) {
} elseif($value || is_int($id)) {
$res['value'] = $this->checkValue_inline_processDBdata($valueArray, $tcaFieldConf, $id, $status, $table, $field);
}
......
}
// If no language it set, this is a regular copy action:
} else {
if (!t3lib_div::testInt($realDestPid)) {
if (!is_int($realDestPid)) {
$newId = $this->copyRecord($v['table'], $v['id'], -$v['id']);
} elseif ($realDestPid == -1) {
$newId = $this->versionizeRecord($v['table'], $v['id'], 'Auto-created for WS #'.$this->BE_USER->workspace);
......
$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) || is_int($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);
......
}
}
// Perform synchronization/localization: Possibly add unlocalized records for original language:
if (t3lib_div::testInt($type) && isset($elementsOriginal[$type])) {
if (is_int($type) && isset($elementsOriginal[$type])) {
$item = $elementsOriginal[$type];
$item['id'] = $this->localize($item['table'], $item['id'], $language);
$dbAnalysisCurrent->itemArray[] = $item;
......
$id = intval($id);
// Processing the incoming $perms (from possible string to integer that can be AND'ed)
if (!t3lib_div::testInt($perms)) {
if (!is_int($perms)) {
if ($table!='pages') {
switch($perms) {
case 'edit':
......
function setTSconfigPermissions($fieldArray,$TSConfig_p) {
if (strcmp($TSConfig_p['userid'],'')) $fieldArray['perms_userid']=intval($TSConfig_p['userid']);
if (strcmp($TSConfig_p['groupid'],'')) $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']);
if (strcmp($TSConfig_p['group'],'')) $fieldArray['perms_group']=t3lib_div::testInt($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']);
if (strcmp($TSConfig_p['user'],'')) $fieldArray['perms_user']=is_int($TSConfig_p['user']) ? $TSConfig_p['user'] : $this->assemblePermissions($TSConfig_p['user']);
if (strcmp($TSConfig_p['group'],'')) $fieldArray['perms_group']=is_int($TSConfig_p['group']) ? $TSConfig_p['group'] : $this->assemblePermissions($TSConfig_p['group']);
if (strcmp($TSConfig_p['everybody'],'')) $fieldArray['perms_everybody']=is_int($TSConfig_p['everybody']) ? $TSConfig_p['everybody'] : $this->assemblePermissions($TSConfig_p['everybody']);
return $fieldArray;
}
......
foreach ($this->dbAnalysisStore as $action) {
$id = t3lib_BEfunc::wsMapId(
$action[4],
(t3lib_div::testInt($action[2]) ? $action[2] : $this->substNEWwithIDs[$action[2]])
(is_int($action[2]) ? $action[2] : $this->substNEWwithIDs[$action[2]])
);
if ($id) {
$action[0]->writeMM($action[1], $id, $action[3]);
......
}
// Clear cache for a page ID!
if (t3lib_div::testInt($cacheCmd)) {
if (is_int($cacheCmd)) {
if (t3lib_extMgm::isLoaded('cms')) {
$list_cache = array($cacheCmd);
......
switch ($TCA[$table]['columns'][$field]['config']['type']) {
case 'inline':
if ($TCA[$table]['columns'][$field]['config']['foreign_field']) {
if (!t3lib_div::testInt($value)) {
if (!is_int($value)) {
$result[$field] = count(t3lib_div::trimExplode(',', $value, TRUE));
}
}
(1-1/2)