Project

General

Profile

Bug #19728 » 9994.KD.v4.patch

Administrator Admin, 2009-05-15 22:21

View differences:

t3lib/class.t3lib_stdgraphic.php (Arbeitskopie)
// Finding the RGB definitions of the color:
$string=$cParts[0];
if (strstr($string,'#')) {
$string = ereg_replace('[^A-Fa-f0-9]*','',$string);
$string = preg_replace('/[^A-Fa-f0-9]*/','',$string);
$col[]=HexDec(substr($string,0,2));
$col[]=HexDec(substr($string,2,2));
$col[]=HexDec(substr($string,4,2));
} elseif (strstr($string,',')) {
$string = ereg_replace('[^,0-9]*','',$string);
$string = preg_replace('/[^,0-9]*/','',$string);
$strArr = explode(',',$string);
$col[]=intval($strArr[0]);
$col[]=intval($strArr[1]);
......
* @see imageMagickConvert(), tslib_cObj::getImgResource()
*/
function getImageDimensions($imageFile) {
ereg('([^\.]*)$',$imageFile,$reg);
preg_match('/([^\.]*)$/',$imageFile,$reg);
if (file_exists($imageFile) && t3lib_div::inList($this->imageFileExt,strtolower($reg[0]))) {
if ($returnArr = $this->getCachedImageDimensions($imageFile)) {
return $returnArr;
......
global $TYPO3_DB;
// Create a md5 hash of the filename
$md5Hash = md5_file($imageFile);
ereg('([^\.]*)$',$imageFile,$reg);
preg_match('/([^\.]*)$/',$imageFile,$reg);
$res = $TYPO3_DB->exec_SELECTquery ('md5hash, imagewidth, imageheight', 'cache_imagesizes', 'md5filename='.$TYPO3_DB->fullQuoteStr(md5($imageFile),'cache_imagesizes'));
if ($res) {
if ($row = $TYPO3_DB->sql_fetch_assoc($res)) {
......
$splitstring=$returnVal[0];
$this->IM_commands[] = Array ('identify',$cmd,$returnVal[0]);
if ($splitstring) {
ereg('([^\.]*)$',$imagefile,$reg);
preg_match('/([^\.]*)$/',$imagefile,$reg);
$splitinfo = explode(' ', $splitstring);
while (list($key,$val) = each($splitinfo)) {
$temp = '';
......
function output($file) {
if ($file) {
$reg = array();
ereg('([^\.]*)$',$file,$reg);
preg_match('/([^\.]*)$/',$file,$reg);
$ext=strtolower($reg[0]);
switch($ext) {
case 'gif':
t3lib/class.t3lib_foldertree.php (Arbeitskopie)
$treeKey = key($this->tree); // Get the key for this space
$LN = ($a==$c)?'blank':'line';
$val = ereg_replace('^\./','',$val);
$val = preg_replace('/^\.\//','',$val);
$title = $val;
$path = $files_path.$val.'/';
$webpath=t3lib_BEfunc::getPathType_web_nonweb($path);
t3lib/class.t3lib_cs.php (Arbeitskopie)
* - trim/ltrim/rtrim: the second parameter 'charlist' won't work for characters not contained in 7-bit ASCII
* - strpos/strrpos: they return the BYTE position, if you need the CHARACTER position use utf8_strpos/utf8_strrpos
* - htmlentities: charset support for UTF-8 only since PHP 4.3.0
* - preg_*: Support compiled into PHP by default nowadays, but could be unavailable, need to use modifier
*
* Functions NOT working on UTF-8 strings:
*
......
* - stripos
* - substr
* - strrev
* - ereg/eregi
* - split/spliti
* - preg_*
* - ...
*
*/
......
}
$token = md5(microtime());
$parts = explode($token,ereg_replace('(&([#[:alnum:]]*);)',$token.'\2'.$token,$str));
$parts = explode($token,preg_replace('/(&([#[:alnum:]]*);)/',$token.'\2'.$token,$str));
foreach($parts as $k => $v) {
if ($k%2) {
if (substr($v,0,1)=='#') { // Dec or hex entities:
......
// Detect type if not done yet: (Done on first real line)
// The "whitespaced" type is on the syntax "0x0A 0x000A #LINE FEED" while "ms-token" is like "B9 = U+00B9 : SUPERSCRIPT ONE"
if (!$detectedType) $detectedType = ereg('[[:space:]]*0x([[:alnum:]]*)[[:space:]]+0x([[:alnum:]]*)[[:space:]]+',$value) ? 'whitespaced' : 'ms-token';
if (!$detectedType) $detectedType = preg_match('/[[:space:]]*0x([[:alnum:]]*)[[:space:]]+0x([[:alnum:]]*)[[:space:]]+/',$value) ? 'whitespaced' : 'ms-token';
if ($detectedType=='ms-token') {
list($hexbyte, $utf8) = preg_split('/[=:]/', $value, 3);
} elseif ($detectedType=='whitespaced') {
$regA=array();
ereg('[[:space:]]*0x([[:alnum:]]*)[[:space:]]+0x([[:alnum:]]*)[[:space:]]+',$value,$regA);
preg_match('/[[:space:]]*0x([[:alnum:]]*)[[:space:]]+0x([[:alnum:]]*)[[:space:]]+/',$value,$regA);
$hexbyte = $regA[1];
$utf8 = 'U+'.$regA[2];
}
......
// accented Latin letters without "official" decomposition
$match = array();
if (ereg('^LATIN (SMALL|CAPITAL) LETTER ([A-Z]) WITH',$name,$match) && !$decomp) {
if (preg_match('/^LATIN (SMALL|CAPITAL) LETTER ([A-Z]) WITH/',$name,$match) && !$decomp) {
$c = ord($match[2]);
if ($match[1] == 'SMALL') $c += 32;
......
}
$match = array();
if (ereg('(<.*>)? *(.+)',$decomp,$match)) {
if (preg_match('/(<.*>)? *(.+)/',$decomp,$match)) {
switch($match[1]) {
case '<circle>': // add parenthesis as circle replacement, eg (1)
$match[2] = '0028 '.$match[2].' 0029';
......
break;
case '<compat>': // ignore multi char decompositions that start with a space
if (ereg('^0020 ',$match[2])) continue 2;
if (preg_match('/^0020 /',$match[2])) continue 2;
break;
// ignore Arabic and vertical layout presentation decomposition
t3lib/class.t3lib_loadmodules.php (Arbeitskopie)
global $TYPO3_LOADED_EXT;
if (isset($this->absPathArray[$name])) {
return ereg_replace ('\/$', '', substr($this->absPathArray[$name],strlen(PATH_site)));
return rtrim(substr($this->absPathArray[$name],strlen(PATH_site)), '/');
}
}
......
*/
function checkMod($name, $fullpath) {
$modconf=Array();
$path = ereg_replace ('/[^/.]+/\.\./', '/', $fullpath); // because 'path/../path' does not work
$path = preg_replace('/\/[^\/.]+\/\.\.\//', '/', $fullpath); // because 'path/../path' does not work
if (@is_dir($path) && file_exists($path.'/conf.php')) {
$MCONF = array();
$MLANG = array();
......
return './';
}
$baseDir = ereg_replace ('^/', '', $baseDir); // remove beginning
$destDir = ereg_replace ('^/', '', $destDir);
$baseDir = ltrim($baseDir, '/'); // remove beginning
$destDir = ltrim($destDir, '/');
$found = true;
$slash_pos=0;
t3lib/config_default.php (Arbeitskopie)
'ftpspace' => array('allow'=>'*', 'deny'=>'')
),
'customPermOptions' => array(), // Array with sets of custom permission options. Syntax is; 'key' => array('header' => 'header string, language splitted', 'items' => array('key' => array('label, language splitted', 'icon reference', 'Description text, language splitted'))). Keys cannot contain ":|," characters.
'fileDenyPattern' => FILE_DENY_PATTERN_DEFAULT , // A regular expression that - if it matches a filename - will deny the file upload/rename or whatever in the webspace. For security reasons, files with multiple extensions have to be denied on an Apache environment with mod_alias, if the filename contains a valid php handler in an arbitary position. Also, ".htaccess" files have to be denied. Matching with eregi() (case-insensitive). Default value is stored in constant FILE_DENY_PATTERN_DEFAULT
'fileDenyPattern' => FILE_DENY_PATTERN_DEFAULT , // A perl-compatible regular expression (without delimiters!) that - if it matches a filename - will deny the file upload/rename or whatever in the webspace. For security reasons, files with multiple extensions have to be denied on an Apache environment with mod_alias, if the filename contains a valid php handler in an arbitary position. Also, ".htaccess" files have to be denied. Matching is done case-insensitive. Default value is stored in constant FILE_DENY_PATTERN_DEFAULT
'interfaces' => 'backend', // This determines which interface options is available in the login prompt and in which order (All options: ",backend,backend_old,frontend")
'useOnContextMenuHandler' => 1, // Boolean. If set, the context menus (clickmenus) in the backend are activated on right-click - although this is not a XHTML attribute!
'loginLabels' => 'Username|Password|Interface|Log In|Log Out|Backend,Front End,Traditional Backend|Administration Login on ###SITENAME###|(Note: Cookies and JavaScript must be enabled!)|Important Messages:|Your login attempt did not succeed. Make sure to spell your username and password correctly, including upper/lowercase characters.', // Language labels of the login prompt.
t3lib/class.t3lib_syntaxhl.php (Arbeitskopie)
$token = md5(microtime());
// Markup all tag names with token.
$markUpStr = ereg_replace('<([[:alnum:]_]+)[^>]*>',$token.'\1'.$token,$str);
$markUpStr = preg_replace('/<([[:alnum:]_]+)[^>]*>/',$token.'\1'.$token,$str);
// Splitting by token:
$parts = explode($token,$markUpStr);
t3lib/class.t3lib_sqlparser.php (Arbeitskopie)
// Removing SELECT:
$parseString = $this->trimSQL($parseString);
$parseString = ltrim(substr($parseString,6)); // REMOVE eregi_replace('^SELECT[[:space:]]+','',$parseString);
$parseString = ltrim(substr($parseString,6));
// Init output variable:
$result = array();
......
// Removing UPDATE
$parseString = $this->trimSQL($parseString);
$parseString = ltrim(substr($parseString,6)); // REMOVE eregi_replace('^UPDATE[[:space:]]+','',$parseString);
$parseString = ltrim(substr($parseString,6));
// Init output variable:
$result = array();
......
// Removing INSERT
$parseString = $this->trimSQL($parseString);
$parseString = ltrim(substr(ltrim(substr($parseString,6)),4)); // REMOVE eregi_replace('^INSERT[[:space:]]+INTO[[:space:]]+','',$parseString);
$parseString = ltrim(substr(ltrim(substr($parseString,6)),4));
// Init output variable:
$result = array();
......
// Removing DELETE
$parseString = $this->trimSQL($parseString);
$parseString = ltrim(substr(ltrim(substr($parseString,6)),4)); // REMOVE eregi_replace('^DELETE[[:space:]]+FROM[[:space:]]+','',$parseString);
$parseString = ltrim(substr(ltrim(substr($parseString,6)),4));
// Init output variable:
$result = array();
......
// Removing EXPLAIN
$parseString = $this->trimSQL($parseString);
$parseString = ltrim(substr($parseString,6)); // REMOVE eregi_replace('^EXPLAIN[[:space:]]+','',$parseString);
$parseString = ltrim(substr($parseString,6));
// Init output variable:
$result = $this->parseSELECT($parseString);
......
// Removing CREATE TABLE
$parseString = $this->trimSQL($parseString);
$parseString = ltrim(substr(ltrim(substr($parseString,6)),5)); // REMOVE eregi_replace('^CREATE[[:space:]]+TABLE[[:space:]]+','',$parseString);
$parseString = ltrim(substr(ltrim(substr($parseString,6)),5));
// Init output variable:
$result = array();
......
// Removing ALTER TABLE
$parseString = $this->trimSQL($parseString);
$parseString = ltrim(substr(ltrim(substr($parseString,5)),5)); // REMOVE eregi_replace('^ALTER[[:space:]]+TABLE[[:space:]]+','',$parseString);
$parseString = ltrim(substr(ltrim(substr($parseString,5)),5));
// Init output variable:
$result = array();
......
// Removing DROP TABLE
$parseString = $this->trimSQL($parseString);
$parseString = ltrim(substr(ltrim(substr($parseString,4)),5)); // eregi_replace('^DROP[[:space:]]+TABLE[[:space:]]+','',$parseString);
$parseString = ltrim(substr(ltrim(substr($parseString,4)),5));
// Init output variable:
$result = array();
......
// Removing CREATE DATABASE
$parseString = $this->trimSQL($parseString);
$parseString = ltrim(substr(ltrim(substr($parseString,6)),8)); // eregi_replace('^CREATE[[:space:]]+DATABASE[[:space:]]+','',$parseString);
$parseString = ltrim(substr(ltrim(substr($parseString,6)),8));
// Init output variable:
$result = array();
......
$reg = array();
//preg_match('/[\]*$/',$v,$reg); // does not work. what is the *exact* meaning of the next line?
ereg('[\]*$',$v,$reg);
//ereg('[\]*$',$v,$reg);
preg_match('/\\*$/',$v,$reg);
if ($reg AND strlen($reg[0])%2) {
$buffer.=$quote;
} else {
......
*/
function trimSQL($str) {
return trim(rtrim($str, "; \r\n\t")).' ';
//return trim(ereg_replace('[[:space:];]*$','',$str)).' ';
}
t3lib/class.t3lib_tceforms.php (Arbeitskopie)
$recursivityLevels = isset($fieldValue['config']['fileFolder_recursions']) ? t3lib_div::intInRange($fieldValue['config']['fileFolder_recursions'],0,99) : 99;
// Get files:
$fileFolder = ereg_replace('\/$','',$fileFolder).'/';
$fileFolder = rtrim($fileFolder, '/').'/';
$fileArr = t3lib_div::getAllFilesAndFoldersInPath(array(),$fileFolder,$extList,0,$recursivityLevels);
$fileArr = t3lib_div::removePrefixPathFromList($fileArr, $fileFolder);
......
// Item configuration:
$items[] = array(
ereg_replace(':$','',$theTypeArrays[0]),
rtrim($theTypeArrays[0], ':'),
$theTypeArrays[1],
'',
$descr
......
// Add item to be selected:
$items[] = array(
'['.$itemContent[2].'] '.$itemContent[1],
$tableFieldKey.':'.ereg_replace('[:|,]','',$itemValue).':'.$itemContent[0],
$tableFieldKey.':'.preg_replace('/[:|,]/','',$itemValue).':'.$itemContent[0],
$icons[$itemContent[0]]
);
}
......
// Add item to be selected:
$items[] = array(
$GLOBALS['LANG']->sl($itemCfg[0]),
$coKey.':'.ereg_replace('[:|,]','',$itemKey),
$coKey.':'.preg_replace('/[:|,]/','',$itemKey),
$icon,
$GLOBALS['LANG']->sl($itemCfg[2]),
);
t3lib/class.gzip_encode.php (Arbeitskopie)
function freebsd_loadavg() {
$buffer= `uptime`;
$load = array();
ereg("averag(es|e): ([0-9][.][0-9][0-9]), ([0-9][.][0-9][0-9]), ([0-9][.][0-9][0-9]*)", $buffer, $load);
preg_match('/averag(es|e): ([0-9][.][0-9][0-9]), ([0-9][.][0-9][0-9]), ([0-9][.][0-9][0-9]*)/', $buffer, $load);
return max((float)$load[2], (float)$load[3], (float)$load[4]);
}
t3lib/class.t3lib_tsstyleconfig.php (Arbeitskopie)
$fV="";
}
$fV=htmlspecialchars($fV);
#debug(array($params,$fN,$fV,isset($this->ext_realValues[$params["name"]])));
return array($fN,$fV,$params);
}
......
function ext_loadResources($absPath) {
$this->ext_readDirResources($GLOBALS["TYPO3_CONF_VARS"]["MODS"]["web_ts"]["onlineResourceDir"]);
if (is_dir($absPath)) {
$absPath = ereg_replace("\/$","",$absPath);
$absPath = rtrim($absPath, '/');
$this->readDirectory($absPath);
}
$this->ext_resourceDims();
t3lib/thumbs.php (Arbeitskopie)
define('TYPO3_OS', stristr(PHP_OS,'win')&&!stristr(PHP_OS,'darwin')?'WIN':'');
define('TYPO3_MODE','BE');
if(!defined('PATH_thisScript')) define('PATH_thisScript',str_replace('//','/', str_replace('\\','/', (php_sapi_name()=='cgi'||php_sapi_name()=='isapi' ||php_sapi_name()=='cgi-fcgi')&&($_SERVER['ORIG_PATH_TRANSLATED']?$_SERVER['ORIG_PATH_TRANSLATED']:$_SERVER['PATH_TRANSLATED'])? ($_SERVER['ORIG_PATH_TRANSLATED']?$_SERVER['ORIG_PATH_TRANSLATED']:$_SERVER['PATH_TRANSLATED']):($_SERVER['ORIG_SCRIPT_FILENAME']?$_SERVER['ORIG_SCRIPT_FILENAME']:$_SERVER['SCRIPT_FILENAME']))));
if(!defined('PATH_site')) define('PATH_site', ereg_replace('[^/]*.[^/]*$','',PATH_thisScript)); // the path to the website folder (see init.php)
if(!defined('PATH_site')) define('PATH_site', preg_replace('/[^\/]*.[^\/]*$/','',PATH_thisScript)); // the path to the website folder (see init.php)
if(!defined('PATH_t3lib')) define('PATH_t3lib', PATH_site.'t3lib/');
define('PATH_typo3conf', PATH_site.'typo3conf/');
define('TYPO3_mainDir', 'typo3/'); // This is the directory of the backend administration for the sites of this TYPO3 installation.
......
// Check file extension:
$reg = array();
if (ereg('(.*)\.([^\.]*$)',$this->input,$reg)) {
if (preg_match('/(.*)\.([^\.]*$)/',$this->input,$reg)) {
$ext=strtolower($reg[2]);
$ext=($ext=='jpeg')?'jpg':$ext;
if ($ext=='ttf') {
t3lib/class.t3lib_install.php (Arbeitskopie)
}
if (substr(trim($lineContent),-1)==';') {
if (isset($statementArray[$statementArrayPointer])) {
if (!trim($statementArray[$statementArrayPointer]) || ($query_regex && !eregi($query_regex,trim($statementArray[$statementArrayPointer])))) {
if (!trim($statementArray[$statementArrayPointer]) || ($query_regex && !preg_match('/'.$query_regex.'/i',trim($statementArray[$statementArrayPointer])))) {
unset($statementArray[$statementArrayPointer]);
}
}
......
$insertCount = array();
foreach ($statements as $line => $lineContent) {
$reg = array();
if (eregi('^create[[:space:]]*table[[:space:]]*[`]?([[:alnum:]_]*)[`]?',substr($lineContent,0,100),$reg)) {
if (preg_match('/^create[[:space:]]*table[[:space:]]*[`]?([[:alnum:]_]*)[`]?/i',substr($lineContent,0,100),$reg)) {
$table = trim($reg[1]);
if ($table) {
// table names are always lowercase on Windows!
......
$lineContent = implode(chr(10), $sqlLines);
$crTables[$table] = $lineContent;
}
} elseif ($insertCountFlag && eregi('^insert[[:space:]]*into[[:space:]]*[`]?([[:alnum:]_]*)[`]?',substr($lineContent,0,100),$reg)) {
} elseif ($insertCountFlag && preg_match('/^insert[[:space:]]*into[[:space:]]*[`]?([[:alnum:]_]*)[`]?/i',substr($lineContent,0,100),$reg)) {
$nTable = trim($reg[1]);
$insertCount[$nTable]++;
}
t3lib/class.t3lib_querygenerator.php (Arbeitskopie)
$this->fields[$fN] = $fC['config'];
$this->fields[$fN]['exclude'] = $fC['exclude'];
if (is_array($fC) && $fC['label']) {
$this->fields[$fN]['label'] = ereg_replace(':$','',trim($GLOBALS['LANG']->sL($fC['label'])));
$this->fields[$fN]['label'] = rtrim(trim($GLOBALS['LANG']->sL($fC['label'])), ':');
switch ($this->fields[$fN]['type']) {
case 'input':
if (eregi('int|year', $this->fields[$fN]['eval'])) {
if (preg_match('/int|year/i', $this->fields[$fN]['eval'])) {
$this->fields[$fN]['type']='number';
} elseif (eregi('time', $this->fields[$fN]['eval'])) {
} elseif (preg_match('/time/i', $this->fields[$fN]['eval'])) {
$this->fields[$fN]['type'] = 'time';
} elseif (eregi('date', $this->fields[$fN]['eval'])) {
} elseif (preg_match('/date/i', $this->fields[$fN]['eval'])) {
$this->fields[$fN]['type']='date';
} else {
$this->fields[$fN]['type']='text';
t3lib/class.t3lib_transferdata.php (Arbeitskopie)
foreach($theExcludeFields as $theExcludeFieldsArrays) {
foreach($elements as $eKey => $value) {
if (!strcmp($theExcludeFieldsArrays[1],$value)) {
$dataAcc[$eKey]=rawurlencode($value).'|'.rawurlencode(ereg_replace(':$','',$theExcludeFieldsArrays[0]));
$dataAcc[$eKey]=rawurlencode($value).'|'.rawurlencode(rtrim($theExcludeFieldsArrays[0], ':'));
}
}
}
t3lib/class.t3lib_readmail.php (Arbeitskopie)
while(list(,$ppstr)=each($parts)) {
$mparts = explode('=',$ppstr,2);
if (count($mparts)>1) {
$cTypes[strtolower(trim($mparts[0]))]=ereg_replace('^"','',trim(ereg_replace('"$','',trim($mparts[1]))));
$cTypes[strtolower(trim($mparts[0]))]=preg_replace('/^"/','',trim(preg_replace('/"$/','',trim($mparts[1]))));
} else {
$cTypes[]=$ppstr;
}
......
$parts = explode('>:',$c,2);
$cp['reason_text']=trim($parts[1]);
$cp['mailserver']='Qmail';
if (eregi('550|no mailbox|account does not exist',$cp['reason_text'])) {
if (preg_match('/550|no mailbox|account does not exist/i',$cp['reason_text'])) {
$cp['reason']=550; // 550 Invalid recipient
} elseif (stristr($cp['reason_text'],'couldn\'t find any host named')) {
$cp['reason']=2; // Bad host
} elseif (eregi('Error in Header|invalid Message-ID header',$cp['reason_text'])) {
} elseif (preg_match('/Error in Header|invalid Message-ID header/i',$cp['reason_text'])) {
$cp['reason']=554;
} else {
$cp['reason']=-1;
......
$cp['content']=trim($c);
$cp['reason_text']=trim(substr($c,0,1000));
$cp['mailserver']='unknown';
if (eregi('Unknown Recipient|Delivery failed 550|Receiver not found|User not listed|recipient problem|Delivery to the following recipients failed|User unknown|recipient name is not recognized',$cp['reason_text'])) {
if (preg_match('/Unknown Recipient|Delivery failed 550|Receiver not found|User not listed|recipient problem|Delivery to the following recipients failed|User unknown|recipient name is not recognized/i',$cp['reason_text'])) {
$cp['reason']=550; // 550 Invalid recipient, User unknown
} elseif (eregi('over quota|mailbox full',$cp['reason_text'])) {
} elseif (preg_match('/over quota|mailbox full/i',$cp['reason_text'])) {
$cp['reason']=551;
} elseif (eregi('Error in Header',$cp['reason_text'])) {
} elseif (preg_match('/Error in Header/i',$cp['reason_text'])) {
$cp['reason']=554;
} else {
$cp['reason']=-1;
......
// Email:
$reg='';
ereg('<([^>]*)>',$str,$reg);
preg_match('/<([^>]*)>/',$str,$reg);
if (t3lib_div::validEmail($str)) {
$outArr['email']=$str;
} elseif ($reg[1] && t3lib_div::validEmail($reg[1])) {
......
list($namePart)=explode($reg[0],$str);
if (trim($namePart)) {
$reg='';
ereg('"([^"]*)"',$str,$reg);
preg_match('/"([^"]*)"/',$str,$reg);
if (trim($reg[1])) {
$outArr['name']=trim($reg[1]);
} else $outArr['name']=trim($namePart);
......
next($cTypeParts);
while(list(,$v)=Each($cTypeParts)) {
$reg='';
eregi('([^=]*)="(.*)"',$v,$reg);
preg_match('/([^=]*)="(.*)"/i',$v,$reg);
if (trim($reg[1]) && trim($reg[2])) {
$outValue[strtolower($reg[1])] = $reg[2];
}
t3lib/class.t3lib_iconworks.php (Arbeitskopie)
}
// Create tagged icon file name:
$iconFileName_stateTagged = ereg_replace('.([[:alnum:]]+)$', '__'.$flags.'.\1', basename($iconfile));
$iconFileName_stateTagged = preg_replace('/.([[:alnum:]]+)$/', '__'.$flags.'.\1', basename($iconfile));
// Check if tagged icon file name exists (a tagget icon means the icon base name with the flags added between body and extension of the filename, prefixed with underscore)
if (@is_file(dirname($absfile).'/'.$iconFileName_stateTagged)) { // Look for [iconname]_xxxx.[ext]
return dirname($iconfile).'/'.$iconFileName_stateTagged;
} elseif ($doNotGenerateIcon) { // If no icon generation can be done, try to look for the _X icon:
$iconFileName_X = ereg_replace('.([[:alnum:]]+)$', '__x.\1', basename($iconfile));
$iconFileName_X = preg_replace('/.([[:alnum:]]+)$/', '__x.\1', basename($iconfile));
if (@is_file(dirname($absfile).'/'.$iconFileName_X)) {
return dirname($iconfile).'/'.$iconFileName_X;
} else {
......
public static function skinImg($backPath, $src, $wHattribs = '', $outputMode = 0) {
// Setting source key. If the icon is refered to inside an extension, we homogenize the prefix to "ext/":
$srcKey = ereg_replace('^(\.\.\/typo3conf\/ext|sysext|ext)\/', 'ext/', $src);
$srcKey = preg_replace('/^(\.\.\/typo3conf\/ext|sysext|ext)\//', 'ext/', $src);
#if ($src!=$srcKey)debug(array($src, $srcKey));
// LOOKING for alternative icons:
......
// Search for alternative icon automatically:
$fExt = $GLOBALS['TBE_STYLES']['skinImgAutoCfg']['forceFileExtension'];
$scaleFactor = $GLOBALS['TBE_STYLES']['skinImgAutoCfg']['scaleFactor'] ? $GLOBALS['TBE_STYLES']['skinImgAutoCfg']['scaleFactor'] : 1; // Scaling factor
$lookUpName = $fExt ? ereg_replace('\.[[:alnum:]]+$', '', $srcKey).'.'.$fExt : $srcKey; // Set filename to look for
$lookUpName = $fExt ? preg_replace('/\.[[:alnum:]]+$/', '', $srcKey).'.'.$fExt : $srcKey; // Set filename to look for
if ($fExt && !@is_file($GLOBALS['TBE_STYLES']['skinImgAutoCfg']['absDir'] . $lookUpName)) {
// fallback to original filename if icon with forced extension doesn't exists
......
}
// DEBUG: This doubles the size of all icons - for testing/debugging:
# if (ereg('^width="([0-9]+)" height="([0-9]+)"$', $wHattribs, $reg)) $wHattribs='width="'.($reg[1]*2).'" height="'.($reg[2]*2).'"';
# if (preg_match('/^width="([0-9]+)" height="([0-9]+)"$/', $wHattribs, $reg)) $wHattribs='width="'.($reg[1]*2).'" height="'.($reg[2]*2).'"';
// rendering disabled (greyed) icons using _i (inactive) as name suffix ("_d" is already used)
t3lib/class.t3lib_tstemplate.php (Arbeitskopie)
if (substr($ISF_file,0,4)=='EXT:') {
list($ISF_extKey,$ISF_localPath) = explode('/',substr($ISF_file,4),2);
if (strcmp($ISF_extKey,'') && t3lib_extMgm::isLoaded($ISF_extKey) && strcmp($ISF_localPath,'')) {
$ISF_localPath = ereg_replace('\/$','',$ISF_localPath).'/';
$ISF_localPath = rtrim($ISF_localPath, '/').'/';
$ISF_filePath = t3lib_extMgm::extPath($ISF_extKey).$ISF_localPath;
if (@is_dir($ISF_filePath)) {
$mExtKey = str_replace('_','',$ISF_extKey.'/'.$ISF_localPath);
......
$c=count($fileparts);
$files = t3lib_div::trimExplode(',', $res);
foreach ($files as $file) {
if (ereg('^'.quotemeta($fileparts[0]).'.*'.quotemeta($fileparts[$c-1]).'$', $file)) {
if (preg_match('/^'.quotemeta($fileparts[0]).'.*'.quotemeta($fileparts[$c-1]).'$/', $file)) {
$outFile = $file;
break;
}
t3lib/class.t3lib_rteapi.php (Arbeitskopie)
*/
function triggerField($fieldName) {
$triggerFieldName = ereg_replace('\[([^]]+)\]$','[_TRANSFORM_\1]', $fieldName);
$triggerFieldName = preg_replace('/\[([^]]+)\]$/','[_TRANSFORM_\1]', $fieldName);
return '<input type="hidden" name="'.htmlspecialchars($triggerFieldName).'" value="RTE" />';
}
}
t3lib/class.t3lib_treeview.php (Arbeitskopie)
* @return string Image tag, modified with $attr attributes added.
*/
function addTagAttributes($icon,$attr) {
return ereg_replace(' ?\/?>$','',$icon).' '.$attr.' />';
return preg_replace('/ ?\/?>$/','',$icon).' '.$attr.' />';
}
/**
t3lib/class.t3lib_softrefproc.php (Arbeitskopie)
$elements[$k]['matchString'] = $v;
// If the image seems to be from fileadmin/ folder or an RTE image, then proceed to set up substitution token:
if (t3lib_div::isFirstPartOfStr($srcRef,$this->fileAdminDir.'/') || (t3lib_div::isFirstPartOfStr($srcRef,'uploads/') && ereg('^RTEmagicC_',basename($srcRef)))) {
if (t3lib_div::isFirstPartOfStr($srcRef,$this->fileAdminDir.'/') || (t3lib_div::isFirstPartOfStr($srcRef,'uploads/') && preg_match('/^RTEmagicC_/',basename($srcRef)))) {
// Token and substitute value:
if (strstr($splitContent[$k], $attribs[0]['src'])) { // Make sure the value we work on is found and will get substituted in the content (Very important that the src-value is not DeHSC'ed)
$splitContent[$k] = str_replace($attribs[0]['src'], '{softref:'.$tokenID.'}', $splitContent[$k]); // Substitute value with token (this is not be an exact method if the value is in there twice, but we assume it will not)
......
$elements = array();
foreach($linkTags as $k => $foundValue) {
if ($k%2) {
$typolinkValue = eregi_replace('<LINK[[:space:]]+','',substr($foundValue,0,-1));
$typolinkValue = preg_replace('/<LINK[[:space:]]+/i','',substr($foundValue,0,-1));
$tLP = $this->getTypoLinkParts($typolinkValue);
$linkTags[$k] = '<LINK '.$this->setTypoLinkPartsElement($tLP, $elements, $typolinkValue, $k).'>';
}
......
// Detecting the kind of reference:
if(strstr($link_param,'@') && !$pU['scheme']) { // If it's a mail address:
$link_param = eregi_replace('^mailto:','',$link_param);
$link_param = preg_replace('/^mailto:/i','',$link_param);
$finalTagParts['LINK_TYPE'] = 'mailto';
$finalTagParts['url'] = trim($link_param);
t3lib/class.t3lib_befunc.php (Arbeitskopie)
if (count($specConfParts)) {
foreach($specConfParts as $k2 => $v2) {
unset($specConfParts[$k2]);
if (ereg('(.*)\[(.*)\]', $v2, $reg)) {
if (preg_match('/(.*)\[(.*)\]/', $v2, $reg)) {
$specConfParts[trim($reg[1])] = array(
'parameters' => t3lib_div::trimExplode('|', $reg[2], 1)
);
......
$parts[] = $LANG->sL($TCA['pages']['columns']['mount_pid_ol']['label']);
}
}
if ($row['nav_hide']) $parts[] = ereg_replace(':$', '', $LANG->sL($TCA['pages']['columns']['nav_hide']['label']));
if ($row['nav_hide']) $parts[] = rtrim($LANG->sL($TCA['pages']['columns']['nav_hide']['label']), ':');
if ($row['hidden']) $parts[] = $LANG->sL('LLL:EXT:lang/locallang_core.php:labels.hidden');
if ($row['starttime']) $parts[] = $LANG->sL($TCA['pages']['columns']['starttime']['label']).' '.t3lib_BEfunc::dateTimeAge($row['starttime'], -1, 'date');
if ($row['endtime']) $parts[] = $LANG->sL($TCA['pages']['columns']['endtime']['label']).' '.t3lib_BEfunc::dateTimeAge($row['endtime'], -1, 'date');
......
if (is_array($dRec)) {
reset($dRec);
$dRecord = current($dRec);
return ereg_replace('\/$', '', $dRecord['domainName']);
return rtrim($dRecord['domainName'], '/');
}
}
}
......
public static function getDomainStartPage($domain, $path = '') {
if (t3lib_extMgm::isLoaded('cms')) {
$domain = explode(':', $domain);
$domain = strtolower(ereg_replace('\.$', '', $domain[0]));
$domain = strtolower(preg_replace('/\.$/', '', $domain[0]));
// path is calculated.
$path = trim(ereg_replace('\/[^\/]*$', '', $path));
$path = trim(preg_replace('/\/[^\/]*$/', '', $path));
// stuff:
$domain.=$path;
......
foreach($keyList as $val) {
$reg = array();
if (ereg('^([[:alnum:]_-]+)\[(.*)\]$', $val, $reg)) {
if (preg_match('/^([[:alnum:]_-]+)\[(.*)\]$/', $val, $reg)) {
$output[$reg[1]] = t3lib_div::trimExplode(';', $reg[2], 1);
} else {
$output[$val] = '';
t3lib/class.t3lib_superadmin.php (Arbeitskopie)
$content = '';
foreach($this->parentDirs as $k => $v) {
$dir = ereg_replace('/$','',$v['dir']);
$baseUrl=ereg_replace('/$','',$v['url']);
$dir = rtrim($v['dir'], '/');
$baseUrl=rtrim($v['url'], '/');
$content.='<br /><br /><br />';
$content.=$this->headerParentDir($dir);
if (@is_dir($dir)) {
t3lib/class.t3lib_htmlmail.php (Arbeitskopie)
for ($i = 1; $i < $pieces; $i++) {
$tag = strtolower(strtok(substr($html_code,$len+1,10),' '));
$len += strlen($tag)+strlen($codepieces[$i])+2;
$dummy = eregi("[^>]*", $codepieces[$i], $reg);
$dummy = preg_match('/[^>]*/', $codepieces[$i], $reg);
$attributes = $this->get_tag_attributes($reg[0]); // Fetches the attributes for the tag
$imageData = array();
......
$codepieces = preg_split($attribRegex, $html_code);
$pieces = count($codepieces);
for ($i = 1; $i < $pieces; $i++) {
$dummy = eregi("[^>]*", $codepieces[$i], $reg);
$dummy = preg_match('/[^>]*/', $codepieces[$i], $reg);
// fetches the attributes for the tag
$attributes = $this->get_tag_attributes($reg[0]);
$imageData = array();
......
// fixes javascript rollovers
$codepieces = preg_split('/' . quotemeta(".src") . '/', $html_code);
$pieces = count($codepieces);
$expr = "^[^".quotemeta("\"").quotemeta("'")."]*";
$expr = '/^[^'.quotemeta('"'.quotemeta("'").']*/';
for($i = 1; $i < $pieces; $i++) {
$temp = $codepieces[$i];
$temp = trim(ereg_replace("=","",trim($temp)));
ereg($expr,substr($temp,1,strlen($temp)),$reg);
$temp = trim(str_replace('=','',trim($temp)));
preg_match($expr,substr($temp,1,strlen($temp)),$reg);
$imageData['ref'] = $reg[0];
$imageData['quotes'] = substr($temp,0,1);
// subst_str is the string to look for, when substituting lateron
......
$tag = strtolower(strtok(substr($html_code,$len+1,10)," "));
$len += strlen($tag) + strlen($codepieces[$i]) + 2;
$dummy = eregi("[^>]*", $codepieces[$i], $reg);
$dummy = preg_match('/[^>]*/', $codepieces[$i], $reg);
// Fetches the attributes for the tag
$attributes = $this->get_tag_attributes($reg[0]);
$hrefData = array();
......
$codepieces = preg_split($attribRegex, $htmlCode, 1000000);
$pieces = count($codepieces);
for($i = 1; $i < $pieces; $i++) {
$dummy = eregi("[^>]*", $codepieces[$i], $reg);
$dummy = preg_match('/[^>]*/', $codepieces[$i], $reg);
// Fetches the attributes for the tag
$attributes = $this->get_tag_attributes($reg[0]);
$frame = array();
......
$len = strcspn($textpieces[$i],chr(32).chr(9).chr(13).chr(10));
if (trim(substr($textstr,-1)) == '' && $len) {
$lastChar = substr($textpieces[$i],$len-1,1);
if (!ereg("[A-Za-z0-9\/#]",$lastChar)) {
// Included "\/" 3/12
if (!preg_match('/[A-Za-z0-9\/#]/',$lastChar)) {
$len--;
}
......
foreach($items as $key => $part) {
$sub = substr($part, 0, 200);
if (ereg("cid:part[^ \"']*",$sub,$reg)) {
if (preg_match('/cid:part[^ "\']*/',$sub,$reg)) {
// The position of the string
$thePos = strpos($part,$reg[0]);
// Finds the id of the media...
ereg("cid:part([^\.]*).*",$sub,$reg2);
preg_match('/cid:part([^\.]*).*/',$sub,$reg2);
$theSubStr = $this->theParts['html']['media'][intval($reg2[1])]['absRef'];
if ($thePos && $theSubStr) {
// ... and substitutes the javaScript rollover image with this instead
......
$info = parse_url($ref);
if ($info['scheme']) {
return $ref;
} elseif (eregi("^/",$ref)) {
} elseif (preg_match('/^\//',$ref)) {
$addr = parse_url($this->theParts['html']['path']);
return $addr['scheme'].'://'.$addr['host'].($addr['port']?':'.$addr['port']:'').$ref;
} else {
......
*/
public function split_fileref($fileref) {
$info = array();
if (ereg("(.*/)(.*)$", $fileref, $reg)) {
if (preg_match('/(.*/)(.*)$/', $fileref, $reg)) {
$info['path'] = $reg[1];
$info['file'] = $reg[2];
} else {
......
$info['file'] = $fileref;
}
$reg = '';
if (ereg("(.*)\.([^\.]*$)", $info['file'], $reg)) {
if (preg_match('/(.*)\.([^\.]*$)/', $info['file'], $reg)) {
$info['filebody'] = $reg[1];
$info['fileext'] = strtolower($reg[2]);
$info['realFileext'] = $reg[2];
......
*/
public function extParseUrl($path) {
$res = parse_url($path);
ereg("(.*/)([^/]*)$", $res['path'], $reg);
preg_match('/(.*\/)([^\/]*)$/', $res['path'], $reg);
$res['filepath'] = $reg[1];
$res['filename'] = $reg[2];
return $res;
......
*/
public function get_tag_attributes($tag) {
$attributes = array();
$tag = ltrim(eregi_replace ("^<[^ ]*","",trim($tag)));
$tag = ltrim(preg_replace('/^<[^ ]*/','',trim($tag)));
$tagLen = strlen($tag);
$safetyCounter = 100;
// Find attribute
......
$value = $reg[0];
} else {
// No quotes around value
ereg("^([^[:space:]>]*)(.*)",$tag,$reg);
preg_match('/^([^[:space:]>]*)(.*)/',$tag,$reg);
$value = trim($reg[1]);
$tag = ltrim($reg[2]);
if (substr($tag,0,1) == '>') {
t3lib/class.t3lib_page.php (Arbeitskopie)
*/
function getDomainStartPage($domain, $path='',$request_uri='') {
$domain = explode(':',$domain);
$domain = strtolower(ereg_replace('\.$','',$domain[0]));
$domain = strtolower(preg_replace('/\.$/','',$domain[0]));
// Removing extra trailing slashes
$path = trim(ereg_replace('\/[^\/]*$','',$path));
$path = trim(preg_replace('/\/[^\/]*$/','',$path));
// Appending to domain string
$domain.= $path;
$domain = ereg_replace('\/*$','',$domain);
$domain = preg_replace('/\/*$/','',$domain);
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery(
'pages.uid,sys_domain.redirectTo,sys_domain.redirectHttpStatusCode,sys_domain.prepend_params',
......
if ($row['redirectTo']) {
$redirectUrl = $row['redirectTo'];
if ($row['prepend_params']) {
$redirectUrl = ereg_replace('\/$', '', $redirectUrl);
$prependStr = ereg_replace('^\/','',substr($request_uri,strlen($path)));
$redirectUrl = rtrim($redirectUrl, '/');
$prependStr = ltrim(substr($request_uri,strlen($path)), '/');
$redirectUrl .= '/' . $prependStr;
}
t3lib/class.t3lib_div.php (Arbeitskopie)
*/
public static function split_fileref($fileref) {
$reg = array();
if ( ereg('(.*/)(.*)$',$fileref,$reg) ) {
if (preg_match('/(.*\/)(.*)$/',$fileref,$reg) ) {
$info['path'] = $reg[1];
$info['file'] = $reg[2];
} else {
......
$info['file'] = $fileref;
}
$reg='';
if ( ereg('(.*)\.([^\.]*$)',$info['file'],$reg) ) {
if ( preg_match('/(.*)\.([^\.]*$)/',$info['file'],$reg) ) {
$info['filebody'] = $reg[1];
$info['fileext'] = strtolower($reg[2]);
$info['realFileext'] = $reg[2];
......
* @return string
*/
public static function rm_endcomma($string) {
return ereg_replace(',$','',$string);
return rtrim($string, ',');
}
/**
......
* @see calcParenthesis()
*/
public static function calcPriority($string) {
$string=ereg_replace('[[:space:]]*','',$string); // removing all whitespace
$string=preg_replace('/[[:space:]]*/','',$string); // removing all whitespace
$string='+'.$string; // Ensuring an operator for the first entrance
$qm='\*\/\+-^%';
$regex = '(['.$qm.'])(['.$qm.']?[0-9\.]*)';
......
* @return string Converted result.
*/
public static function deHSCentities($str) {
return ereg_replace('&amp;([#[:alnum:]]*;)','&\1',$str);
return preg_replace('/&amp;([#[:alnum:]]*;)/','&\1',$str);
}
/**
......
$name = '';
}
} else {
if ($key = strtolower(ereg_replace('[^a-zA-Z0-9]','',$val))) {
if ($key = strtolower(preg_replace('/[^a-zA-Z0-9]/','',$val))) {
$attributes[$key] = '';
$name = $key;
}
......
* @return array Array with the attribute values.
*/
public static function split_tag_attributes($tag) {
$tag_tmp = trim(eregi_replace ('^<[^[:space:]]*','',trim($tag)));
$tag_tmp = trim(preg_replace('/^<[^[:space:]]*/','',trim($tag)));
// Removes any > in the end of the string
$tag_tmp = trim(eregi_replace ('>$','',$tag_tmp));
$tag_tmp = trim(rtrim($tag_tmp, '>'));
$value = array();
while (strcmp($tag_tmp,'')) { // Compared with empty string instead , 030102
......
}
// The tag name is cleaned up so only alphanumeric chars (plus - and _) are in there and not longer than 100 chars either.
$tagName = substr(ereg_replace('[^[:alnum:]_-]','',$tagName),0,100);
$tagName = substr(preg_replace('/[^[:alnum:]_-]/','',$tagName),0,100);
// If the value is an array then we will call this function recursively:
if (is_array($v)) {
......
// Checking if the "subdir" is found:
$subdir = substr($fI['dirname'],strlen($dirName));
if ($subdir) {
if (ereg('^[[:alnum:]_]+\/$',$subdir) || ereg('^[[:alnum:]_]+\/[[:alnum:]_]+\/$',$subdir)) {
if (preg_match('/^[[:alnum:]_]+\/$/',$subdir) || preg_match('/^[[:alnum:]_]+\/[[:alnum:]_]+\/$/',$subdir)) {
$dirName.= $subdir;
if (!@is_dir($dirName)) {
t3lib_div::mkdir_deep(PATH_site.'typo3temp/', $subdir);
......
// Initialize variabels:
$filearray = array();
$sortarray = array();
$path = ereg_replace('\/$','',$path);
$path = rtrim($path, '/');
// Find files+directories:
if (@is_dir($path)) {
......
$pString = t3lib_div::implodeArrayForUrl('', $params);
return $pString ? $parts . '?' . ereg_replace('^&', '', $pString) : $parts;
return $pString ? $parts . '?' . preg_replace('/^&/', '', $pString) : $parts;
}
/**
......
list($v,$n) = explode('|',$GLOBALS['TYPO3_CONF_VARS']['SYS']['requestURIvar']);
$retVal = $GLOBALS[$v][$n];
} elseif (!$_SERVER['REQUEST_URI']) { // This is for ISS/CGI which does not have the REQUEST_URI available.
$retVal = '/'.ereg_replace('^/','',t3lib_div::getIndpEnv('SCRIPT_NAME')).
$retVal = '/'.ltrim(t3lib_div::getIndpEnv('SCRIPT_NAME'), '/').
($_SERVER['QUERY_STRING']?'?'.$_SERVER['QUERY_STRING']:'');
} else {
$retVal = $_SERVER['REQUEST_URI'];
......
break;
case 'msie':
$tmp = strstr($useragent,'MSIE');
$bInfo['VERSION'] = doubleval(ereg_replace('^[^0-9]*','',substr($tmp,4)));
$bInfo['VERSION'] = doubleval(preg_replace('/^[^0-9]*/','',substr($tmp,4)));
break;
case 'opera':
$tmp = strstr($useragent,'Opera');
$bInfo['VERSION'] = doubleval(ereg_replace('^[^0-9]*','',substr($tmp,5)));
$bInfo['VERSION'] = doubleval(preg_replace('/^[^0-9]*/','',substr($tmp,5)));
break;
case 'konqu':
$tmp = strstr($useragent,'Konqueror/');
......
*/
public static function verifyFilenameAgainstDenyPattern($filename) {
if (strcmp($filename,'') && strcmp($GLOBALS['TYPO3_CONF_VARS']['BE']['fileDenyPattern'],'')) {
$result = eregi($GLOBALS['TYPO3_CONF_VARS']['BE']['fileDenyPattern'],$filename);
$result = preg_match('/'.$GLOBALS['TYPO3_CONF_VARS']['BE']['fileDenyPattern'].'/i',$filename);
if ($result) return false; // so if a matching filename is found, return false;
}
return true;
......
if($quoteActive > -1) {
$paramsArr[$quoteActive] .= ' '.$v;
unset($paramsArr[$k]);
if(ereg('"$', $v)) { $quoteActive = -1; }
if(preg_match('/"$/', $v)) { $quoteActive = -1; }
} elseif(!trim($v)) {
unset($paramsArr[$k]); // Remove empty elements
} elseif(ereg('^"', $v)) {
} elseif(preg_match('/^"/', $v)) {
$quoteActive = $k;
}
}
t3lib/class.t3lib_fullsearch.php (Arbeitskopie)
$fields = $fC['config'];
$fields['exclude'] = $fC['exclude'];
if (is_array($fC) && $fC['label']) {
$fields['label'] = ereg_replace(":$", '', trim($GLOBALS['LANG']->sL($fC['label'])));
$fields['label'] = preg_replace('/:$/', '', trim($GLOBALS['LANG']->sL($fC['label'])));
switch ($fields['type']) {
case 'input':
if (eregi('int|year', $fields['eval'])) {
if (preg_match('/int|year/i', $fields['eval'])) {
$fields['type'] = 'number';
} elseif (eregi('time', $fields['eval'])) {
} elseif (preg_match('/time/i', $fields['eval'])) {
$fields['type'] = 'time';
} elseif (eregi('date', $fields['eval'])) {
} elseif (preg_match('/date/i', $fields['eval'])) {
$fields['type'] = 'date';
} else {
$fields['type'] = 'text';
t3lib/class.t3lib_parsehtml.php (Arbeitskopie)
$parts = $this->splitIntoBlock('style',$content);
foreach($parts as $k => $v) {
if ($k%2) {
$parts[$k] = eregi_replace('(url[[:space:]]*\([[:space:]]*["\']?)([^"\')]*)(["\']?[[:space:]]*\))','\1'.$prefix.'\2'.$suffix.'\3',$parts[$k]);
$parts[$k] = preg_replace('/(url[[:space:]]*\([[:space:]]*["\']?)([^"\')]*)(["\']?[[:space:]]*\))/i','\1'.$prefix.'\2'.$suffix.'\3',$parts[$k]);
}
}
$content = implode('',$parts);
t3lib/class.t3lib_modsettings.php (Arbeitskopie)
reset($SOBE->MOD_SETTINGS);
while(list($key)=each($SOBE->MOD_SETTINGS)) {
if (ereg('^'.$prefix,$key)) {
if (preg_match('/^'.$prefix.'/',$key)) {
$this->storeList[$key]=$key;
}
}
t3lib/class.t3lib_xml.php (Arbeitskopie)
* @return string Processed input value
*/
function substNewline($string) {
return ereg_replace(chr(10),'<newline/>',$string);
return str_replace(chr(10),'<newline/>',$string);
}
/**
t3lib/class.t3lib_userauthgroup.php (Arbeitskopie)
if (!strcmp($value,'')) return TRUE;
// Certain characters are not allowed in the value
if (ereg('[:|,]',$value)) {
if (preg_match('/[:|,]/',$value)) {
return FALSE;
}
t3lib/class.t3lib_tcemain.php (Arbeitskopie)
break;
}
}
$theDec = ereg_replace('[^0-9]','',$theDec).'00';
$theDec = preg_replace('/[^0-9]/','',$theDec).'00';
$value = intval(str_replace(' ','',$value)).'.'.substr($theDec,0,2);
break;
case 'md5':
......
$value = str_replace(' ','',$value);
break;
case 'alpha':
$value = ereg_replace('[^a-zA-Z]','',$value);
$value = preg_replace('/[^a-zA-Z]/','',$value);
break;
case 'num':
$value = ereg_replace('[^0-9]','',$value);
$value = preg_replace('/[^0-9]/','',$value);
break;
case 'alphanum':
$value = ereg_replace('[^a-zA-Z0-9]','',$value);
$value = preg_replace('/[^a-zA-Z0-9]/','',$value);
break;
case 'alphanum_x':
$value = ereg_replace('[^a-zA-Z0-9_-]','',$value);
$value = preg_replace('/[^a-zA-Z0-9_-]/','',$value);
break;
default:
if (substr($func, 0, 3) == 'tx_') {
......
if (t3lib_div::isFirstPartOfStr($filename,'RTEmagicC_')) {
$fileInfo['exists'] = @is_file(PATH_site.$rec['ref_string']);
$fileInfo['original'] = substr($rec['ref_string'],0,-strlen($filename)).'RTEmagicP_'.ereg_replace('\.[[:alnum:]]+$','',substr($filename,10));
$fileInfo['original'] = substr($rec['ref_string'],0,-strlen($filename)).'RTEmagicP_'.preg_replace('/\.[[:alnum:]]+$/','',substr($filename,10));
$fileInfo['original_exists'] = @is_file(PATH_site.$fileInfo['original']);
// CODE from tx_impexp and class.rte_images.php adapted for use here:
......
* @return string Output string with any comma in the end removed, if any.
*/
function rmComma($input) {
return ereg_replace(',$','',$input);
return rtrim($input, ',');
}
/**
......
*/
function convNumEntityToByteValue($input) {
$token = md5(microtime());
$parts = explode($token,ereg_replace('(&#([0-9]+);)',$token.'\2'.$token,$input));
$parts = explode($token,preg_replace('/(&#([0-9]+);)/',$token.'\2'.$token,$input));
foreach($parts as $k => $v) {
if ($k%2) {
......
*/
function clearPrefixFromValue($table,$value) {
global $TCA;
$regex = sprintf(quotemeta($this->prependLabel($table)),'[0-9]*').'$';
return @ereg_replace($regex,'',$value);
$regex = '/'.sprintf(quotemeta($this->prependLabel($table)),'[0-9]*').'$/';
return @preg_replace($regex,'',$value);
}
/**
......
// Clearing additional cache tables:
if (is_array($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearAllCache_additionalTables'])) {
foreach($TYPO3_CONF_VARS['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['clearAllCache_additionalTables'] as $tableName) {
if (!ereg('[^[:alnum:]_]',$tableName) && substr($tableName,-5)=='cache') {
if (!preg_match('/[^[:alnum:]_]/',$tableName) && substr($tableName,-5)=='cache') {
$GLOBALS['TYPO3_DB']->exec_DELETEquery($tableName,'');
} else {
die('Fatal Error: Trying to flush table "'.$tableName.'" with "Clear All Cache"');
t3lib/class.t3lib_parsehtml_proc.php (Arbeitskopie)
*/
function setRelPath($path) {
$path = trim($path);
$path = ereg_replace('^/','',$path);
$path = ereg_replace('/$','',$path);
$path = preg_replace('/^\//','',$path);
$path = preg_replace('/\/$/','',$path);
if ($path) {
$this->relPath = $path;
$this->relBackPath = '';
......
$siteUrl = $this->siteUrl();
// Parsing the typolink data. This parsing is roughly done like in tslib_content->typolink()
if(strstr($link_param,'@')) { // mailadr
$href = 'mailto:'.eregi_replace('^mailto:','',$link_param);
$href = 'mailto:'.preg_replace('/^mailto:/i','',$link_param);
} elseif (substr($link_param,0,1)=='#') { // check if anchor
$href = $siteUrl.$link_param;
} else {
......
if (trim($rootFileDat) && !strstr($link_param,'/') && (@is_file(PATH_site.$rootFileDat) || t3lib_div::inList('php,html,htm',strtolower($rFD_fI['extension'])))) {
$href = $siteUrl.$link_param;
} elseif($urlChar && (strstr($link_param,'//') || !$fileChar || $urlChar<$fileChar)) { // url (external): If doubleSlash or if a '.' comes before a '/'.
if (!ereg('^[a-z]*://',trim(strtolower($link_param)))) {$scheme='http://';} else {$scheme='';}
if (!preg_match('/^[a-z]*:\/\//',trim(strtolower($link_param)))) {$scheme='http://';} else {$scheme='';}
$href = $scheme.$link_param;
} elseif($fileChar) { // file (internal)
$href = $siteUrl.$link_param;
......
case 'typolist': // Transform typolist blocks into OL/UL lists. Type 1 is expected to be numerical block
if (!isset($this->procOptions['typolist']) || $this->procOptions['typolist']) {
$tListContent = $this->removeFirstAndLastTag($blockSplit[$k]);
$tListContent = ereg_replace('^[ ]*'.chr(10),'',$tListContent);
$tListContent = ereg_replace(chr(10).'[ ]*$','',$tListContent);
$tListContent = preg_replace('/^[ ]*'.chr(10).'/','',$tListContent);
$tListContent = preg_replace('/'.chr(10).'[ ]*$/','',$tListContent);
$lines = explode(chr(10),$tListContent);
$typ = $attribArray['type']==1 ? 'ol' : 'ul';
$blockSplit[$k] = '<'.$typ.'>'.chr(10).
......
}
break;
}
$blockSplit[$k+1] = ereg_replace('^[ ]*'.chr(10),'',$blockSplit[$k+1]); // Removing linebreak if typohead
$blockSplit[$k+1] = preg_replace('/^[ ]*'.chr(10).'/','',$blockSplit[$k+1]); // Removing linebreak if typohead
} else { // NON-block:
$nextFTN = $this->getFirstTagName($blockSplit[$k+1]);
$singleLineBreak = $blockSplit[$k]==chr(10);
if (t3lib_div::inList('TABLE,BLOCKQUOTE,TYPOLIST,TYPOHEAD,'.($this->procOptions['preserveDIVSections']?'DIV,':'').$this->blockElementList,$nextFTN)) { // Removing linebreak if typolist/typohead
$blockSplit[$k] = ereg_replace(chr(10).'[ ]*$','',$blockSplit[$k]);
$blockSplit[$k] = preg_replace('/'.chr(10).'[ ]*$/','',$blockSplit[$k]);
}
// If $blockSplit[$k] is blank then unset the line. UNLESS the line happend to be a single line break.
if (!strcmp($blockSplit[$k],'') && !$singleLineBreak) {
......
}
// Remove any line break char (10 or 13)
$subLines[$sk]=ereg_replace(chr(10).'|'.chr(13),'',$subLines[$sk]);
$subLines[$sk]=preg_replace('/'.chr(10).'|'.chr(13).'/','',$subLines[$sk]);
// If there are any attributes or if we are supposed to remap the tag, then do so:
if (count($newAttribs) && strcmp($remapParagraphTag,'1')) {
......
$regex='[[:space:]]*:[[:space:]]*([0-9]*)[[:space:]]*px';
// Width
$reg = array();
eregi('width'.$regex,$style,$reg);
preg_match('/width'.$regex.'/i',$style,$reg);
$w = intval($reg[1]);
// Height
eregi('height'.$regex,$style,$reg);
preg_match('/height'.$regex.'/i',$style,$reg);
$h = intval($reg[1]);
}
if (!$w) {
t3lib/class.t3lib_arraybrowser.php (Arbeitskopie)
$deeper = is_array($keyArr[$key]);
if ($this->regexMode) {
if (ereg($searchString,$keyArr[$key]) || ($this->searchKeysToo && ereg($searchString,$key))) { $this->searchKeys[$depth]=1; }
if (preg_match('/'.$searchString.'/',$keyArr[$key]) || ($this->searchKeysToo && preg_match('/'.$searchString.'/',$key))) { $this->searchKeys[$depth]=1; }
} else {
if (stristr($keyArr[$key],$searchString) || ($this->searchKeysToo && stristr($key,$searchString))) { $this->searchKeys[$depth]=1; }
}
t3lib/class.t3lib_tsparser_ext.php (Arbeitskopie)
$keyArr_alpha=array();
while (list($key,)=each($arr)) {
if (substr($key,-2)!='..') { // Don't do anything with comments / linenumber registrations...
$key=ereg_replace('\.$','',$key);
$key=preg_replace('/\.$/','',$key);
if (substr($key,-1)!='.') {
if (t3lib_div::testInt($key)) {
$keyArr_num[$key]=$arr[$key];
......
reset($arr);
$keyArr=array();
while (list($key,)=each($arr)) {
$key=ereg_replace('\.$','',$key);
$key=preg_replace('/\.$/','',$key);
if (substr($key,-1)!='.') {
$keyArr[$key]=1;
}
......
$deeper = is_array($arr[$key.'.']);
if ($this->regexMode) {
if (ereg($searchString,$arr[$key])) { // The value has matched
if (preg_match('/'.$searchString.'/',$arr[$key])) { // The value has matched
$this->tsbrowser_searchKeys[$depth]+=2;
}
if (ereg($searchString,$key)) { // The key has matched
if (preg_match('/'.$searchString.'/',$key)) { // The key has matched
$this->tsbrowser_searchKeys[$depth]+=4;
}
if (ereg($searchString,$depth_in)) { // Just open this subtree if the parent key has matched the search
if (preg_match('/'.$searchString.'/',$depth_in)) { // Just open this subtree if the parent key has matched the search
$this->tsbrowser_searchKeys[$depth]=1;
}
} else {
......
reset($arr);
$keyArr=array();
while (list($key,)=each($arr)) {
$key=ereg_replace('\.$','',$key);
$key=preg_replace('/\.$/','',$key);
if (substr($key,-1)!='.') {
$keyArr[$key]=1;
}
......
}
if ($syntaxHL) {
$all = ereg_replace('^[^'.chr(10).']*.','',$all);
$all = preg_replace('/^[^'.chr(10).']*./','',$all);
$all = chop($all);
$tsparser = t3lib_div::makeInstance('t3lib_TSparser');
$tsparser->lineNumberOffset=$this->ext_lineNumberOffset+1;
......
* @return [type] ...
*/
function ext_formatTS($input, $ln, $comments=1, $crop=0) {
$input = ereg_replace('^[^'.chr(10).']*.','',$input);
$input = preg_replace('/^[^'.chr(10).']*./','',$input);
$input = chop($input);
$cArr = explode(chr(10),$input);
......
$comment = trim($this->flatSetup[$const.'..']);
$c_arr = explode(chr(10),$comment);
while(list($k,$v)=each($c_arr)) {
$line=trim(ereg_replace('^[#\/]*','',$v));
$line=trim(preg_replace('/^[#\/]*/','',$v));
if ($line) {
$parts = explode(';', $line);
while(list(,$par)=each($parts)) {
......
if (t3lib_div::inList('int,options,file,boolean,offset,user', $retArr['type'])) {
$p=trim(substr($type,$m));
$reg = array();
ereg('\[(.*)\]',$p,$reg);
preg_match('/\[(.*)\]/',$p,$reg);
$p=trim($reg[1]);
if ($p) {
$retArr['paramstr']=$p;
......
function ext_readDirResources($path) {
$path=trim($path);
if ($path && substr($path,0,10)=='fileadmin/') {
$path = ereg_replace('\/$','',$path);
$path = rtrim($path, '/');
$this->readDirectory(PATH_site.$path);
}
}
......
function ext_fNandV($params) {
$fN='data['.$params['name'].']';
$fV=$params['value'];
if (ereg('^{[\$][a-zA-Z0-9\.]*}$',trim($fV),$reg)) { // Values entered from the constantsedit cannot be constants! 230502; removed \{ and set {
if (preg_match('/^{[\$][a-zA-Z0-9\.]*}$/',trim($fV),$reg)) { // Values entered from the constantsedit cannot be constants! 230502; removed \{ and set {
$fV='';
}
$fV=htmlspecialchars($fV);
......
case 'color':
$col=array();
if($var && !t3lib_div::inList($this->HTMLcolorList,strtolower($var))) {
$var = ereg_replace('[^A-Fa-f0-9]*','',$var);
$var = preg_replace('/[^A-Fa-f0-9]*/','',$var);
$useFullHex = strlen($var) > 3;
$col[]=HexDec(substr($var,0,1));
......
*/
function ext_setStar($val) {
$fParts = explode('.',strrev($val),2);
$val=ereg_replace('_[0-9][0-9]$','',strrev($fParts[1])).'*.'.strrev($fParts[0]);
$val=preg_replace('/_[0-9][0-9]$/','',strrev($fParts[1])).'*.'.strrev($fParts[0]);
return $val;
}
typo3/class.filelistfoldertree.php (Arbeitskopie)
end($this->tree);
$treeKey = key($this->tree); // Get the key for this space
$val = ereg_replace('^\./','',$val);
$val = preg_replace('/^\.\//','',$val);
$title = $val;
$path = $files_path.$val.'/';
typo3/class.browse_links.php (Arbeitskopie)
* @return boolean If the input path is found in PATH_site then it returns true.
*/
function isWebFolder($folder) {
$folder = ereg_replace('\/$','',$folder).'/';
$folder = rtrim($folder, '/').'/';
return t3lib_div::isFirstPartOfStr($folder,PATH_site) ? TRUE : FALSE;
}
......
* @return boolean If the input path is found in the backend users filemounts, then return true.
*/
function checkFolder($folder) {
return $this->fileProcessor->checkPathAgainstMounts(ereg_replace('\/$', '', $folder) . '/') ? true : false;
return $this->fileProcessor->checkPathAgainstMounts(rtrim($folder, '/') . '/') ? true : false;
}
/**
......
* @return boolean If the input path is found in the backend users filemounts and if the filemount is of type readonly, then return true.
*/
function isReadOnlyFolder($folder) {
return ($GLOBALS['FILEMOUNTS'][$this->fileProcessor->checkPathAgainstMounts(ereg_replace('\/$', '', $folder) . '/')]['type'] == 'readonly');
return ($GLOBALS['FILEMOUNTS'][$this->fileProcessor->checkPathAgainstMounts(rtrim($folder, '/') . '/')]['type'] == 'readonly');
}
/**
typo3/show_item.php (Arbeitskopie)
} else {
// if the filereference $this->file is relative, we correct the path
if (substr($this->table,0,3)=='../') {
$this->file = PATH_site.ereg_replace('^\.\./','',$this->table);
$this->file = PATH_site.preg_replace('/^\.\.\//','',$this->table);
} else {
$this->file = $this->table;
}
typo3/template.php (Arbeitskopie)
// Setting default scriptID:
if (($temp_M = (string) t3lib_div::_GET('M')) && $GLOBALS['TBE_MODULES']['_PATHS'][$temp_M]) {
$this->scriptID = ereg_replace('^.*\/(sysext|ext)\/', 'ext/', $GLOBALS['TBE_MODULES']['_PATHS'][$temp_M] . 'index.php');
$this->scriptID = preg_replace('/^.*\/(sysext|ext)\//', 'ext/', $GLOBALS['TBE_MODULES']['_PATHS'][$temp_M] . 'index.php');
} else {
$this->scriptID = ereg_replace('^.*\/(sysext|ext)\/', 'ext/', substr(PATH_thisScript, strlen(PATH_site)));
$this->scriptID = preg_replace('/^.*\/(sysext|ext)\//', 'ext/', substr(PATH_thisScript, strlen(PATH_site)));
}
if (TYPO3_mainDir!='typo3/' && substr($this->scriptID,0,strlen(TYPO3_mainDir)) == TYPO3_mainDir) {
$this->scriptID = 'typo3/'.substr($this->scriptID,strlen(TYPO3_mainDir)); // This fixes if TYPO3_mainDir has been changed so the script ids are STILL "typo3/..."
}
$this->bodyTagId = ereg_replace('[^[:alnum:]-]','-',$this->scriptID);
$this->bodyTagId = preg_replace('/[^A-Za-z0-9-]/','-',$this->scriptID);
// Individual configuration per script? If so, make a recursive merge of the arrays:
if (is_array($TBE_STYLES['scriptIDindex'][$this->scriptID])) {
......
$pathInfo = parse_url(t3lib_div::getIndpEnv('REQUEST_URI'));
... This diff was truncated because it exceeds the maximum size that can be displayed.
(5-5/6)