Index: typo3/wizard_forms.php
===================================================================
--- typo3/wizard_forms.php (revision 4585)
+++ typo3/wizard_forms.php (working copy)
@@ -811,7 +811,7 @@
}
// Compile the final line:
- $inLines[]=ereg_replace("[\n\r]*",'',implode(' | ',$thisLine));
+ $inLines[] = preg_replace('/[\n\r]*/', '', implode(' | ', $thisLine));
}
}
// Finally, implode the lines into a string, and return it:
@@ -857,7 +857,7 @@
if ($confData['type']) {
if (count($typeParts)==1) {
- $confData['fieldname'] = substr(ereg_replace('[^a-zA-Z0-9_]','',str_replace(' ','_',trim($parts[0]))),0,30);
+ $confData['fieldname'] = substr(preg_replace('/[^a-zA-Z0-9_]/', '', str_replace(' ', '_', trim($parts[0]))), 0, 30);
// Attachment names...
if ($confData['type']=='file') {
Index: typo3/class.filelistfoldertree.php
===================================================================
--- typo3/class.filelistfoldertree.php (revision 4585)
+++ typo3/class.filelistfoldertree.php (working copy)
@@ -375,7 +375,7 @@
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.'/';
Index: typo3/sysext/lowlevel/clmods/class.rte_images.php
===================================================================
--- typo3/sysext/lowlevel/clmods/class.rte_images.php (revision 4585)
+++ typo3/sysext/lowlevel/clmods/class.rte_images.php (working copy)
@@ -135,7 +135,7 @@
foreach($recs as $rec) {
$filename = basename($rec['ref_string']);
if (t3lib_div::isFirstPartOfStr($filename,'RTEmagicC_')) {
- $original = 'RTEmagicP_'.ereg_replace('\.[[:alnum:]]+$','',substr($filename,10));
+ $original = 'RTEmagicP_' . preg_replace('/\.\w+$/', '', substr($filename, 10));
$infoString = $this->infoStr($rec);
// Build index:
Index: typo3/sysext/cms/layout/class.tx_cms_layout.php
===================================================================
--- typo3/sysext/cms/layout/class.tx_cms_layout.php (revision 4585)
+++ typo3/sysext/cms/layout/class.tx_cms_layout.php (working copy)
@@ -318,7 +318,7 @@
foreach($this->fieldArray as $field) {
if ($editIdList && isset($TCA['pages']['columns'][$field]) && $field!='uid' && !$this->pages_noEditColumns) {
$params='&edit[pages]['.$editIdList.']=edit&columnsOnly='.$field.'&disHelp=1';
- $iTitle = sprintf($GLOBALS['LANG']->getLL('editThisColumn'),ereg_replace(':$','',trim($GLOBALS['LANG']->sL(t3lib_BEfunc::getItemLabel('pages',$field)))));
+ $iTitle = sprintf($GLOBALS['LANG']->getLL('editThisColumn'), preg_replace('/:$/', '', trim($GLOBALS['LANG']->sL(t3lib_BEfunc::getItemLabel('pages', $field)))));
$eI= ''.
'
backPath,'gfx/edit2.gif','width="11" height="12"').' title="'.htmlspecialchars($iTitle).'" alt="" />'.
'';
Index: typo3/sysext/cms/tslib/class.tslib_fe.php
===================================================================
--- typo3/sysext/cms/tslib/class.tslib_fe.php (revision 4585)
+++ typo3/sysext/cms/tslib/class.tslib_fe.php (working copy)
@@ -1698,7 +1698,7 @@
$message = 'You logged out from Workspace preview mode. Click this link to go back to the website';
}
die(sprintf($message,
- htmlspecialchars(ereg_replace('\&?ADMCMD_prev=[[:alnum:]]+','',t3lib_div::_GET('returnUrl')))
+ htmlspecialchars(preg_replace('/\&?ADMCMD_prev=\w+/', '', t3lib_div::_GET('returnUrl')))
));
}
Index: typo3/sysext/cms/tslib/class.tslib_gifbuilder.php
===================================================================
--- typo3/sysext/cms/tslib/class.tslib_gifbuilder.php (revision 4585)
+++ typo3/sysext/cms/tslib/class.tslib_gifbuilder.php (working copy)
@@ -218,7 +218,7 @@
case 'IMAGE':
$fileInfo = $this->getResource($conf['file'],$conf['file.']);
if ($fileInfo) {
- $this->combinedFileNames[] = ereg_replace('\.[[:alnum:]]+$','',basename($fileInfo[3]));
+ $this->combinedFileNames[] = preg_replace('/\.\w+$/', '', basename($fileInfo[3]));
$this->setup[$theKey.'.']['file'] = $fileInfo[3];
$this->setup[$theKey.'.']['BBOX'] = $fileInfo;
$this->objBB[$theKey] = $fileInfo;
Index: typo3/sysext/cms/tslib/class.tslib_search.php
===================================================================
--- typo3/sysext/cms/tslib/class.tslib_search.php (revision 4585)
+++ typo3/sysext/cms/tslib/class.tslib_search.php (working copy)
@@ -231,28 +231,28 @@
// As long as $sword is true (that means $sword MUST be reduced little by little until its empty inside the loop!)
while ($sword) {
if (ereg('^"',$sword)) { // There was a double-quote and we will then look for the ending quote.
- $sword = ereg_replace('^"','',$sword); // Removes first double-quote
+ $sword = preg_replace('/^"/', '', $sword); // Removes first double-quote
ereg('^[^"]*',$sword,$reg); // Removes everything till next double-quote
$value[] = $reg[0]; // reg[0] is the value, should not be trimmed
- $sword = ereg_replace('^'.$this->quotemeta($reg[0]),'',$sword);
- $sword = trim(ereg_replace('^"','',$sword)); // Removes last double-quote
+ $sword = preg_replace('/^' . $this->quotemeta($reg[0]) . '/', '', $sword);
+ $sword = trim(preg_replace('/^"/', '', $sword)); // Removes last double-quote
} elseif (ereg('^'.$specs,$sword,$reg)) {
$value[] = $reg[0];
- $sword = trim(ereg_replace('^'.$specs,'',$sword)); // Removes = sign
+ $sword = trim(preg_replace('/^' . $specs . '/', '', $sword)); // Removes = sign
} elseif (ereg('[\+\-]',$sword)) { // Check if $sword contains + or -
// + and - shall only be interpreted as $specchars when there's whitespace before it
// otherwise it's included in the searchword (e.g. "know-how")
$a_sword = explode(' ',$sword); // explode $sword to single words
$word = array_shift($a_sword); // get first word
- $word = ereg_replace($delchars.'$','',$word); // Delete $delchars at end of string
+ $word = preg_replace('/' . $delchars . '$/', '', $word); // Delete $delchars at end of string
$value[] = $word; // add searchword to values
$sword = implode(' ',$a_sword); // re-build $sword
} else {
// There are no double-quotes around the value. Looking for next (space) or special char.
ereg('^[^ '.$this->quotemeta($specchars).']*',$sword,$reg);
- $word = ereg_replace($delchars.'$','',trim($reg[0])); // Delete $delchars at end of string
+ $word = preg_replace('/' . $delchars . '$/', '', trim($reg[0])); // Delete $delchars at end of string
$value[] = $word;
- $sword = trim(ereg_replace('^'.$this->quotemeta($reg[0]),'',$sword));
+ $sword = trim(preg_replace('/^' . $this->quotemeta($reg[0]) . '/', '', $sword));
}
}
Index: typo3/sysext/cms/tslib/class.tslib_content.php
===================================================================
--- typo3/sysext/cms/tslib/class.tslib_content.php (revision 4585)
+++ typo3/sysext/cms/tslib/class.tslib_content.php (working copy)
@@ -1788,7 +1788,7 @@
$confData['type'] = trim(strtolower(end($typeParts)));
if (count($typeParts)==1) {
$confData['fieldname'] = $this->cleanFormName($parts[0]);
- if (strtolower(ereg_replace('[^[:alnum:]]','',$confData['fieldname']))=='email') {$confData['fieldname']='email';}
+ if (strtolower(preg_replace('/[^\w]/', '', $confData['fieldname'])) == 'email') {$confData['fieldname'] = 'email';}
// Duplicate fieldnames resolved
if (isset($fieldname_hashArray[md5($confData['fieldname'])])) {
$confData['fieldname'].='_'.$cc;
@@ -3388,10 +3388,10 @@
}
if ($conf['doubleBrTag']) {
- $content=ereg_replace("\r?\n[\t ]*\r?\n",$conf['doubleBrTag'],$content);
+ $content = preg_replace('/\r?\n[\t ]*\r?\n/', $conf['doubleBrTag'], $content);
}
if ($conf['br']) {$content=nl2br($content);}
- if ($conf['brTag']) {$content= ereg_replace(chr(10),$conf['brTag'],$content);}
+ if ($conf['brTag']) {$content = preg_replace('/' .chr(10) . '/', $conf['brTag'], $content);}
if ($conf['encapsLines.']) {$content=$this->encaps_lineSplit($content,$conf['encapsLines.']);}
if ($conf['keywords']) {$content= $this->keywords($content);}
if ($conf['innerWrap'] || $conf['innerWrap.']){$content=$this->wrap($content, $this->stdWrap($conf['innerWrap'], $conf['innerWrap.']));}
@@ -3693,7 +3693,7 @@
*/
function clean_directory($theDir) {
if (t3lib_div::validPathStr($theDir)) { // proceeds if no '//', '..' or '\' is in the $theFile
- $theDir = ereg_replace("[\/\. ]*$",'',$theDir); // Removes all dots, slashes and spaces after a path...
+ $theDir = preg_replace('/[\/\. ]*$/', '', $theDir); // Removes all dots, slashes and spaces after a path...
if (!t3lib_div::isAbsPath($theDir) && @is_dir($theDir)) {
return $theDir;
}
@@ -4079,7 +4079,7 @@
}
// Wrapping file label
- if ($conf['removePrependedNumbers']) $theValue=ereg_replace('_[0-9][0-9](\.[[:alnum:]]*)$','\1',$theValue);
+ if ($conf['removePrependedNumbers']) $theValue = preg_replace('/_[0-9][0-9](\.\w*)$/', '\1', $theValue);
$theValue = $this->stdWrap($theValue,$conf['labelStdWrap.']);
// Wrapping file
@@ -4270,10 +4270,10 @@
$tagName=strtolower($htmlParser->getFirstTagName($v));
$cfg=$conf['externalBlocks.'][$tagName.'.'];
if ($cfg['stripNLprev'] || $cfg['stripNL']) {
- $parts[$k-1]=ereg_replace(chr(13).'?'.chr(10).'[ ]*$', '', $parts[$k-1]);
+ $parts[$k - 1] = preg_replace('/' . chr(13) . '?' . chr(10) . '[ ]*$/', '', $parts[$k - 1]);
}
if ($cfg['stripNLnext'] || $cfg['stripNL']) {
- $parts[$k+1]=ereg_replace('^[ ]*'.chr(13).'?'.chr(10), '', $parts[$k+1]);
+ $parts[$k + 1]= preg_replace('/^[ ]*' . chr(13) . '?' . chr(10) . '/', '', $parts[$k + 1]);
}
}
}
@@ -4396,7 +4396,7 @@
$data = substr($theValue,$pointer,$len); // $data is the content until the next parameters['allParams']=trim($currentTag[1]);
if ($stripNL) { // Removes NL in the beginning and end of the tag-content AND at the end of the currentTagBuffer. $stripNL depends on the configuration of the current tag
- $contentAccum[$contentAccumP-1] = ereg_replace(chr(13).'?'.chr(10).'[ ]*$', '', $contentAccum[$contentAccumP-1]);
- $contentAccum[$contentAccumP] = ereg_replace('^[ ]*'.chr(13).'?'.chr(10), '', $contentAccum[$contentAccumP]);
- $contentAccum[$contentAccumP] = ereg_replace(chr(13).'?'.chr(10).'[ ]*$', '', $contentAccum[$contentAccumP]);
+ $contentAccum[$contentAccumP - 1] = preg_replace('/' . chr(13) . '?' . chr(10) . '[ ]*$/', '', $contentAccum[$contentAccumP - 1]);
+ $contentAccum[$contentAccumP] = preg_replace('/^[ ]*' . chr(13) . '?' . chr(10) . '/', '', $contentAccum[$contentAccumP]);
+ $contentAccum[$contentAccumP] = preg_replace('/' . chr(13) . '?' . chr(10) . '[ ]*$/', '', $contentAccum[$contentAccumP]);
}
$this->data[$this->currentValKey] = $contentAccum[$contentAccumP];
$newInput=$this->cObjGetSingle($theName,$theConf,'/parseFunc/.tags.'.$tag[0]); // fetch the content object
@@ -4727,7 +4727,7 @@
$parts[0] = substr($textpieces[$i],0,$len);
$parts[1] = substr($textpieces[$i],$len);
- $linktxt = ereg_replace('\?.*','',$parts[0]);
+ $linktxt = preg_replace('/\?.*/', '', $parts[0]);
list($mailToUrl,$linktxt) = $this->getMailTo($parts[0],$linktxt,$initP);
$mailToUrl = $GLOBALS['TSFE']->spamProtectEmailAddresses === 'ascii'?$mailToUrl:htmlspecialchars($mailToUrl);
$res = '';
@@ -4796,7 +4796,7 @@
$gifCreator->init();
if ($GLOBALS['TSFE']->config['config']['meaningfulTempFilePrefix']) {
- $gifCreator->filenamePrefix = $GLOBALS['TSFE']->fileNameASCIIPrefix(ereg_replace('\.[[:alnum:]]+$','',basename($theImage)),intval($GLOBALS['TSFE']->config['config']['meaningfulTempFilePrefix']),'_');
+ $gifCreator->filenamePrefix = $GLOBALS['TSFE']->fileNameASCIIPrefix(preg_replace('/\.\w+$/', '', basename($theImage)), intval($GLOBALS['TSFE']->config['config']['meaningfulTempFilePrefix']), '_');
}
if ($fileArray['sample']) {
Index: typo3/sysext/cms/tslib/publish.php
===================================================================
--- typo3/sysext/cms/tslib/publish.php (revision 4585)
+++ typo3/sysext/cms/tslib/publish.php (working copy)
@@ -122,7 +122,7 @@
// ***************************
$publishDir = $TYPO3_CONF_VARS['FE']['publish_dir'];
if ($publishDir && @is_dir($publishDir)) {
- $publishDir = ereg_replace('/*$','',$publishDir).'/';
+ $publishDir = preg_replace('/\/*$/', '', $publishDir) . '/';
debug('Publishing in: '.$publishDir,1);
reset($temp_publish_array);
while(list($key,$val)=each($temp_publish_array)) {
Index: typo3/sysext/cms/tslib/class.tslib_pagegen.php
===================================================================
--- typo3/sysext/cms/tslib/class.tslib_pagegen.php (revision 4585)
+++ typo3/sysext/cms/tslib/class.tslib_pagegen.php (working copy)
@@ -179,7 +179,7 @@
}
}
}
- $GLOBALS['TSFE']->sWordRegEx = ereg_replace('\|$','',$GLOBALS['TSFE']->sWordRegEx);
+ $GLOBALS['TSFE']->sWordRegEx = preg_replace('/\|$/', '', $GLOBALS['TSFE']->sWordRegEx);
}
// linkVars
@@ -825,7 +825,7 @@
if (!$defBT) $defBT = $GLOBALS['TSFE']->defaultBodyTag;
$bodyTag = $GLOBALS['TSFE']->pSetup['bodyTag'] ? $GLOBALS['TSFE']->pSetup['bodyTag'] : $defBT;
if ($bgImg=$GLOBALS['TSFE']->cObj->getImgResource($GLOBALS['TSFE']->pSetup['bgImg'],$GLOBALS['TSFE']->pSetup['bgImg.'])) {
- $bodyTag = ereg_replace('>$','',trim($bodyTag)).' background="'.$GLOBALS["TSFE"]->absRefPrefix.$bgImg[3].'">';
+ $bodyTag = preg_replace('/>$/', '', trim($bodyTag)) . ' background="' . $GLOBALS["TSFE"]->absRefPrefix . $bgImg[3] . '">';
}
if (isset($GLOBALS['TSFE']->pSetup['bodyTagMargins'])) {
@@ -833,16 +833,16 @@
if ($GLOBALS['TSFE']->pSetup['bodyTagMargins.']['useCSS']) {
// Setting margins in CSS, see above
} else {
- $bodyTag = ereg_replace('>$','',trim($bodyTag)).' leftmargin="'.$margins.'" topmargin="'.$margins.'" marginwidth="'.$margins.'" marginheight="'.$margins.'">';
+ $bodyTag = preg_replace('/>$/', '', trim($bodyTag)) . ' leftmargin="' . $margins . '" topmargin="' . $margins . '" marginwidth="' . $margins . '" marginheight="' . $margins . '">';
}
}
if (trim($GLOBALS['TSFE']->pSetup['bodyTagAdd'])) {
- $bodyTag = ereg_replace('>$','',trim($bodyTag)).' '.trim($GLOBALS['TSFE']->pSetup['bodyTagAdd']).'>';
+ $bodyTag = preg_replace('/>$/', '', trim($bodyTag)) . ' ' . trim($GLOBALS['TSFE']->pSetup['bodyTagAdd']) . '>';
}
if (count($JSef[1])) { // Event functions:
- $bodyTag = ereg_replace('>$','',trim($bodyTag)).' '.trim(implode(' ',$JSef[1])).'>';
+ $bodyTag = preg_replace('/>$/', '', trim($bodyTag)) . ' ' . trim(implode(' ', $JSef[1])) . '>';
}
$GLOBALS['TSFE']->content.= chr(10).$bodyTag;
Index: typo3/sysext/impexp/class.tx_impexp.php
===================================================================
--- typo3/sysext/impexp/class.tx_impexp.php (revision 4585)
+++ typo3/sysext/impexp/class.tx_impexp.php (working copy)
@@ -1728,8 +1728,8 @@
list($table,$uid,$field,$config) = $pParams;
// In case the $path is used as index without a trailing slash we will remove that
- if (!is_array($config['flexFormRels']['db'][$path]) && is_array($config['flexFormRels']['db'][ereg_replace('\/$','',$path)])) {
- $path = ereg_replace('\/$','',$path);
+ if (!is_array($config['flexFormRels']['db'][$path]) && is_array($config['flexFormRels']['db'][preg_replace('/\/$/', '', $path)])) {
+ $path = preg_replace('/\/$/', '', $path);
}
if (is_array($config['flexFormRels']['db'][$path])) {
$valArray = $this->setRelations_db($config['flexFormRels']['db'][$path]);
@@ -2079,7 +2079,7 @@
}
} else {
// Create the resouces directory name (filename without extension, suffixed "_FILES")
- $resourceDir = dirname($newName).'/'.ereg_replace('\.[^.]*$','',basename($newName)).'_FILES';
+ $resourceDir = dirname($newName) . '/' . preg_replace('/\.[^.]*$/', '', basename($newName)) . '_FILES';
if (t3lib_div::mkdir($resourceDir)) {
foreach($fileHeaderInfo['EXT_RES_ID'] as $res_fileID) {
if ($this->dat['files'][$res_fileID]['filename']) {
Index: typo3/sysext/impexp/app/index.php
===================================================================
--- typo3/sysext/impexp/app/index.php (revision 4585)
+++ typo3/sysext/impexp/app/index.php (working copy)
@@ -433,7 +433,7 @@
$inData['pagetree']['maxNumber'] = t3lib_div::intInRange($inData['pagetree']['maxNumber'],1,10000,100);
$inData['listCfg']['maxNumber'] = t3lib_div::intInRange($inData['listCfg']['maxNumber'],1,10000,100);
$inData['maxFileSize'] = t3lib_div::intInRange($inData['maxFileSize'],1,10000,1000);
- $inData['filename'] = trim(ereg_replace('[^[:alnum:]./_-]*','',ereg_replace('\.(t3d|xml)$','',$inData['filename'])));
+ $inData['filename'] = trim(preg_replace('/[^\w.\/-]*/', '', preg_replace('/\.(t3d|xml)$/', '', $inData['filename'])));
if (strlen($inData['filename'])) {
$inData['filename'].= $inData['filetype']=='xml' ? '.xml' : '.t3d';
}
@@ -594,7 +594,7 @@
}
// Filename:
- $dlFile = $inData['filename'] ? $inData['filename'] : 'T3D_'.substr(ereg_replace('[^[:alnum:]_]','-',$inData['download_export_name']),0,20).'_'.date('d-m-H-i-s').$fExt;
+ $dlFile = $inData['filename'] ? $inData['filename'] : 'T3D_' . substr(preg_replace('/[^\w]/', '-', $inData['download_export_name']), 0, 20) . '_' . date('d-m-H-i-s') . $fExt;
// Export for download:
if ($inData['download_export']) {
Index: typo3/sysext/felogin/pi1/class.tx_felogin_pi1.php
===================================================================
--- typo3/sysext/felogin/pi1/class.tx_felogin_pi1.php (revision 4585)
+++ typo3/sysext/felogin/pi1/class.tx_felogin_pi1.php (working copy)
@@ -373,7 +373,7 @@
case 'referer':
$redirect_url = t3lib_div::getIndpEnv('HTTP_REFERER');
// avoid forced logout, when trying to login immediatly after a logout
- $redirect_url = ereg_replace("[&?]logintype=[a-z]+", '', $redirect_url);
+ $redirect_url = preg_replace('/[&?]logintype=[a-z]+/', '', $redirect_url);
break;
case 'refererDomains':
// Auto redirect.
@@ -399,7 +399,7 @@
}
// Avoid forced logout, when trying to login immediatly after a logout
- $redirect_url = ereg_replace("[&?]logintype=[a-z]+", "", $redirect_url);
+ $redirect_url = preg_replace('/[&?]logintype=[a-z]+/', '', $redirect_url);
}
break;
}
Index: typo3/sysext/fe_edit/view/class.tx_feedit_editpanel.php
===================================================================
--- typo3/sysext/fe_edit/view/class.tx_feedit_editpanel.php (revision 4585)
+++ typo3/sysext/fe_edit/view/class.tx_feedit_editpanel.php (working copy)
@@ -207,7 +207,7 @@
$cBuf = rtrim($content);
$securCount = 30;
while($securCount && substr($cBuf, -1) == '>' && substr($cBuf, -4) != '') {
- $cBuf = rtrim(ereg_replace('<[^<]*>$', '', $cBuf));
+ $cBuf = rtrim(preg_replace('/<[^<]*>$/', '', $cBuf));
$securCount--;
}
$content = (strlen($cBuf) && $securCount) ? substr($content, 0, strlen($cBuf)) . $icon . substr($content, strlen($cBuf)) : $content = $icon . $content;
Index: typo3/sysext/beuser/mod/index.php
===================================================================
--- typo3/sysext/beuser/mod/index.php (revision 4585)
+++ typo3/sysext/beuser/mod/index.php (working copy)
@@ -677,7 +677,7 @@
$pout[]=''.t3lib_iconWorks::getIconImage($table,array(),$GLOBALS['BACK_PATH'],'align="top"').$GLOBALS['LANG']->sL($GLOBALS['TCA'][$table]['ctrl']['title']).'';
}
if ($GLOBALS['TCA'][$table]['columns'][$field]) {
- $pout[]=' - '.ereg_replace(':$','',$GLOBALS['LANG']->sL($GLOBALS['TCA'][$table]['columns'][$field]['label'])).'';
+ $pout[] = ' - ' . preg_replace('/:$/', '', $GLOBALS['LANG']->sL($GLOBALS['TCA'][$table]['columns'][$field]['label'])) . '';
}
}
}
Index: typo3/sysext/install/mod/class.tx_install.php
===================================================================
--- typo3/sysext/install/mod/class.tx_install.php (revision 4585)
+++ typo3/sysext/install/mod/class.tx_install.php (working copy)
@@ -3790,7 +3790,7 @@
case 'adminUser': // Create admin user
if ($whichTables['be_users']) {
if (is_array($this->INSTALL['database_adminUser'])) {
- $username = ereg_replace('[^[:alnum:]_-]','',trim($this->INSTALL['database_adminUser']['username']));
+ $username = preg_replace('/[^\w-]/', '', trim($this->INSTALL['database_adminUser']['username']));
$username = str_replace(' ','_',$username);
$pass = trim($this->INSTALL['database_adminUser']['password']);
if ($username && $pass) {
Index: typo3/sysext/sys_action/class.tx_sysaction.php
===================================================================
--- typo3/sysext/sys_action/class.tx_sysaction.php (revision 4585)
+++ typo3/sysext/sys_action/class.tx_sysaction.php (working copy)
@@ -365,7 +365,7 @@
function fixUsername($username,$prefix) {
$username=trim($username);
$prefix=trim($prefix);
- $username=ereg_replace("^".quotemeta($prefix),"",$username);
+ $username = preg_replace('/^' . quotemeta($prefix) . '/', '', $username);
if ($username) {
return $prefix.$username;
Index: typo3/sysext/tstemplate_objbrowser/class.tx_tstemplateobjbrowser.php
===================================================================
--- typo3/sysext/tstemplate_objbrowser/class.tx_tstemplateobjbrowser.php (revision 4585)
+++ typo3/sysext/tstemplate_objbrowser/class.tx_tstemplateobjbrowser.php (working copy)
@@ -228,7 +228,7 @@
}
if ($POST["add_property"]) {
$property = trim($POST["data"][$name]["name"]);
- if (ereg_replace("[^a-zA-Z0-9_\.]*","",$property)!=$property) {
+ if (preg_replace('/[^a-zA-Z0-9_\.]*/', '', $property) != $property) {
$theOutput.=$this->pObj->doc->spacer(10);
$theOutput.=$this->pObj->doc->section($GLOBALS["TBE_TEMPLATE"]->rfw("BAD PROPERTY!"),'You must enter a property with characters a-z, A-Z and 0-9, no spaces!
Nothing was updated!',0,0,0,1);
} else {
Index: typo3/sysext/rtehtmlarea/class.tx_rtehtmlarea_base.php
===================================================================
--- typo3/sysext/rtehtmlarea/class.tx_rtehtmlarea_base.php (revision 4585)
+++ typo3/sysext/rtehtmlarea/class.tx_rtehtmlarea_base.php (working copy)
@@ -240,7 +240,7 @@
// Element ID + pid
$this->elementId = $PA['itemFormElName']; // Form element name
- $this->elementParts = explode('][',ereg_replace('\]$','',ereg_replace('^(TSFE_EDIT\[data\]\[|data\[)','',$this->elementId)));
+ $this->elementParts = explode('][', preg_replace('/\]$/', '', preg_replace('/^(TSFE_EDIT\[data\]\[|data\[)/', '', $this->elementId)));
// Find the page PIDs:
list($this->tscPID,$this->thePid) = t3lib_BEfunc::getTSCpid(trim($this->elementParts[0]),trim($this->elementParts[1]),$thePidValue);
@@ -1550,19 +1550,19 @@
break;
case 'gecko':
$tmp = strstr($useragent,'rv:');
- $bInfo['VERSION'] = doubleval(ereg_replace('^[^0-9]*','',substr($tmp,3)));
+ $bInfo['VERSION'] = doubleval(preg_replace('/^[^0-9]*/', '', substr($tmp, 3)));
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 'safari':
$tmp = strstr($useragent,'Safari/');
- $bInfo['VERSION'] = doubleval(ereg_replace('^[^0-9]*','',substr($tmp,3)));
+ $bInfo['VERSION'] = doubleval(preg_replace('/^[^0-9]*/', '', substr($tmp, 3)));
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/');
Index: typo3/sysext/indexed_search/pi/class.tx_indexedsearch.php
===================================================================
--- typo3/sysext/indexed_search/pi/class.tx_indexedsearch.php (revision 4585)
+++ typo3/sysext/indexed_search/pi/class.tx_indexedsearch.php (working copy)
@@ -2024,17 +2024,17 @@
// Possibly shorten string:
if (!$k) { // First entry at all (only cropped on the frontside)
if ($strLen > $postPreLgd) {
- $output[$k] = $divider.ereg_replace('^[^[:space:]]+[[:space:]]','',$GLOBALS['TSFE']->csConvObj->crop('utf-8',$parts[$k],-($postPreLgd-$postPreLgd_offset)));
+ $output[$k] = $divider . preg_replace('/^[^\s]+\s/' , '', $GLOBALS['TSFE']->csConvObj->crop('utf-8', $parts[$k], -($postPreLgd - $postPreLgd_offset)));
}
} elseif ($summaryLgd > $summaryMax || !isset($parts[$k+1])) { // In case summary length is exceed OR if there are no more entries at all:
if ($strLen > $postPreLgd) {
- $output[$k] = ereg_replace('[[:space:]][^[:space:]]+$','',$GLOBALS['TSFE']->csConvObj->crop('utf-8',$parts[$k],$postPreLgd-$postPreLgd_offset)).$divider;
+ $output[$k] = preg_replace('/\s[^\s]+$/', '', $GLOBALS['TSFE']->csConvObj->crop('utf-8', $parts[$k], $postPreLgd - $postPreLgd_offset)) . $divider;
}
} else { // In-between search words:
if ($strLen > $postPreLgd*2) {
- $output[$k] = ereg_replace('[[:space:]][^[:space:]]+$','',$GLOBALS['TSFE']->csConvObj->crop('utf-8',$parts[$k],$postPreLgd-$postPreLgd_offset)).
- $divider.
- ereg_replace('^[^[:space:]]+[[:space:]]','',$GLOBALS['TSFE']->csConvObj->crop('utf-8',$parts[$k],-($postPreLgd-$postPreLgd_offset)));
+ $output[$k] = preg_replace('/\s[^\s]+$/', '', $GLOBALS['TSFE']->csConvObj->crop('utf-8', $parts[$k], $postPreLgd - $postPreLgd_offset)) .
+ $divider .
+ preg_replace('/^[^\s]+\s', '', $GLOBALS['TSFE']->csConvObj->crop('utf-8', $parts[$k], -($postPreLgd - $postPreLgd_offset)));
}
}
$summaryLgd+= $GLOBALS['TSFE']->csConvObj->strlen('utf-8', $output[$k]);;
@@ -2265,7 +2265,7 @@
function getFirstSysDomainRecordForPage($id) {
$res = $GLOBALS['TYPO3_DB']->exec_SELECTquery('domainName', 'sys_domain', 'pid='.intval($id).$this->cObj->enableFields('sys_domain'), '', 'sorting');
$row = $GLOBALS['TYPO3_DB']->sql_fetch_assoc($res);
- return ereg_replace('\/$','',$row['domainName']);
+ return preg_replace('/\/$/', '', $row['domainName']);
}
/**
Index: typo3/sysext/indexed_search/class.crawler.php
===================================================================
--- typo3/sysext/indexed_search/class.crawler.php (revision 4585)
+++ typo3/sysext/indexed_search/class.crawler.php (working copy)
@@ -578,7 +578,7 @@
* @return string Returls the URL if OK, otherwise false
*/
function checkUrl($url,$urlLog,$baseUrl) {
- $url = ereg_replace('\/\/$','/',$url);
+ $url = preg_replace('/\/\/$/', '/', $url);
list($url) = explode('#',$url);
if (!strstr($url,'../')) {
Index: typo3/sysext/indexed_search/class.external_parser.php
===================================================================
--- typo3/sysext/indexed_search/class.external_parser.php (revision 4585)
+++ typo3/sysext/indexed_search/class.external_parser.php (working copy)
@@ -121,7 +121,7 @@
case 'pdf':
// PDF
if ($indexerConfig['pdftools']) {
- $pdfPath = ereg_replace("\/$",'',$indexerConfig['pdftools']).'/';
+ $pdfPath = preg_replace('/\/$/', '', $indexerConfig['pdftools']) . '/';
if (ini_get('safe_mode') || (@is_file($pdfPath.'pdftotext'.$exe) && @is_file($pdfPath.'pdfinfo'.$exe))) {
$this->app['pdfinfo'] = $pdfPath.'pdfinfo'.$exe;
$this->app['pdftotext'] = $pdfPath.'pdftotext'.$exe;
@@ -134,7 +134,7 @@
case 'doc':
// Catdoc
if ($indexerConfig['catdoc']) {
- $catdocPath = ereg_replace("\/$",'',$indexerConfig['catdoc']).'/';
+ $catdocPath = preg_replace('/\/$/', '', $indexerConfig['catdoc']) . '/';
if (ini_get('safe_mode') || @is_file($catdocPath.'catdoc'.$exe)) {
$this->app['catdoc'] = $catdocPath.'catdoc'.$exe;
$extOK = TRUE;
@@ -145,7 +145,7 @@
case 'ppt': // MS PowerPoint
// ppthtml
if ($indexerConfig['ppthtml']) {
- $ppthtmlPath = ereg_replace('\/$','',$indexerConfig['ppthtml']).'/';
+ $ppthtmlPath = preg_replace('/\/$/', '', $indexerConfig['ppthtml']) . '/';
if (ini_get('safe_mode') || @is_file($ppthtmlPath.'ppthtml'.$exe)){
$this->app['ppthtml'] = $ppthtmlPath.'ppthtml'.$exe;
$extOK = TRUE;
@@ -155,7 +155,7 @@
case 'xls': // MS Excel
// Xlhtml
if ($indexerConfig['xlhtml']) {
- $xlhtmlPath = ereg_replace('\/$','',$indexerConfig['xlhtml']).'/';
+ $xlhtmlPath = preg_replace('/\/$/', '', $indexerConfig['xlhtml']) . '/';
if (ini_get('safe_mode') || @is_file($xlhtmlPath.'xlhtml'.$exe)){
$this->app['xlhtml'] = $xlhtmlPath.'xlhtml'.$exe;
$extOK = TRUE;
@@ -179,7 +179,7 @@
case 'rtf':
// Catdoc
if ($indexerConfig['unrtf']) {
- $unrtfPath = ereg_replace("\/$",'',$indexerConfig['unrtf']).'/';
+ $unrtfPath = preg_replace('/\/$/', '', $indexerConfig['unrtf']) . '/';
if (ini_get('safe_mode') || @is_file($unrtfPath.'unrtf'.$exe)) {
$this->app['unrtf'] = $unrtfPath.'unrtf'.$exe;
$extOK = TRUE;
@@ -637,7 +637,7 @@
* @return string String
*/
function removeEndJunk($string) {
- return trim(ereg_replace('['.chr(10).chr(12).']*$','',$string));
+ return trim(preg_replace('/[' . chr(10) . chr(12) . ']*$/', '', $string));
}
Index: typo3/show_item.php
===================================================================
--- typo3/show_item.php (revision 4585)
+++ typo3/show_item.php (working copy)
@@ -196,7 +196,7 @@
} 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;
}
Index: typo3/class.browse_links.php
===================================================================
--- typo3/class.browse_links.php (revision 4585)
+++ typo3/class.browse_links.php (working copy)
@@ -2481,7 +2481,7 @@
* @return boolean If the input path is found in PATH_site then it returns true.
*/
function isWebFolder($folder) {
- $folder = ereg_replace('\/$','',$folder).'/';
+ $folder = preg_replace('/\/$/', '', $folder) . '/';
return t3lib_div::isFirstPartOfStr($folder,PATH_site) ? TRUE : FALSE;
}
@@ -2492,7 +2492,7 @@
* @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(preg_replace('/\/$/', '', $folder) . '/') ? true : false;
}
/**
@@ -2502,7 +2502,7 @@
* @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(preg_replace('/\/$/', '', $folder) . '/')]['type'] == 'readonly');
}
/**
Index: typo3/template.php
===================================================================
--- typo3/template.php (revision 4585)
+++ typo3/template.php (working copy)
@@ -229,15 +229,15 @@
// 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('/[^\w-]/', '-', $this->scriptID);
// Individual configuration per script? If so, make a recursive merge of the arrays:
if (is_array($TBE_STYLES['scriptIDindex'][$this->scriptID])) {
Index: typo3/view_help.php
===================================================================
--- typo3/view_help.php (revision 4585)
+++ typo3/view_help.php (working copy)
@@ -719,7 +719,7 @@
$tableName = is_array($TCA_DESCR[$table]['columns']['']) && $TCA_DESCR[$table]['columns']['']['alttitle'] ?
$TCA_DESCR[$table]['columns']['']['alttitle'] :
- (isset($TCA[$table]) ? $TCA[$table]['ctrl']['title'] : ereg_replace('^_MOD_','',$table));
+ (isset($TCA[$table]) ? $TCA[$table]['ctrl']['title'] : preg_replace('/^_MOD_/', '', $table));
$fieldName = is_array($TCA_DESCR[$table]['columns'][$field]) && $TCA_DESCR[$table]['columns'][$field]['alttitle'] ?
$TCA_DESCR[$table]['columns'][$field]['alttitle'] :
(isset($TCA[$table])&&isset($TCA[$table]['columns'][$field]) ? $TCA[$table]['columns'][$field]['label'] : $field);
@@ -743,7 +743,7 @@
// Create label:
$labelStr = $LANG->sL($tableName).
- ($field ? $mergeToken.ereg_replace(':$','', trim($LANG->sL($fieldName))):'');
+ ($field ? $mergeToken . preg_replace('/:$/', '', trim($LANG->sL($fieldName))) : '');
return $labelStr;
}
Index: t3lib/class.t3lib_fullsearch.php
===================================================================
--- t3lib/class.t3lib_fullsearch.php (revision 4585)
+++ t3lib/class.t3lib_fullsearch.php (working copy)
@@ -674,7 +674,7 @@
$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':
Index: t3lib/class.t3lib_querygenerator.php
===================================================================
--- t3lib/class.t3lib_querygenerator.php (revision 4585)
+++ t3lib/class.t3lib_querygenerator.php (working copy)
@@ -289,7 +289,7 @@
$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'] = preg_replace('/:$/', '', trim($GLOBALS['LANG']->sL($fC['label'])));
switch ($this->fields[$fN]['type']) {
case 'input':
if (eregi('int|year', $this->fields[$fN]['eval'])) {
Index: t3lib/class.t3lib_loadmodules.php
===================================================================
--- t3lib/class.t3lib_loadmodules.php (revision 4585)
+++ t3lib/class.t3lib_loadmodules.php (working copy)
@@ -368,7 +368,7 @@
global $TYPO3_LOADED_EXT;
if (isset($this->absPathArray[$name])) {
- return ereg_replace ('\/$', '', substr($this->absPathArray[$name],strlen(PATH_site)));
+ return preg_replace ('/\/$/', '', substr($this->absPathArray[$name], strlen(PATH_site)));
}
}
@@ -385,7 +385,7 @@
*/
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();
@@ -562,8 +562,8 @@
return './';
}
- $baseDir = ereg_replace ('^/', '', $baseDir); // remove beginning
- $destDir = ereg_replace ('^/', '', $destDir);
+ $baseDir = preg_replace ('/^\//', '', $baseDir); // remove beginning
+ $destDir = preg_replace ('/^\//', '', $destDir);
$found = true;
$slash_pos=0;
Index: t3lib/class.t3lib_div.php
===================================================================
--- t3lib/class.t3lib_div.php (revision 4585)
+++ t3lib/class.t3lib_div.php (working copy)
@@ -1163,7 +1163,7 @@
* @return string
*/
public static function rm_endcomma($string) {
- return ereg_replace(',$','',$string);
+ return preg_replace('/,$/', '', $string);
}
/**
@@ -1303,7 +1303,7 @@
* @see calcParenthesis()
*/
public static function calcPriority($string) {
- $string=ereg_replace('[[:space:]]*','',$string); // removing all whitespace
+ $string = preg_replace('/\s*/', '', $string); // removing all whitespace
$string='+'.$string; // Ensuring an operator for the first entrance
$qm='\*\/\+-^%';
$regex = '(['.$qm.'])(['.$qm.']?[0-9\.]*)';
@@ -1386,7 +1386,7 @@
* @return string Converted result.
*/
public static function deHSCentities($str) {
- return ereg_replace('&([#[:alnum:]]*;)','&\1',$str);
+ return preg_replace('/&([#\w]*;)/', '&\1', $str);
}
/**
@@ -1969,7 +1969,7 @@
$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;
}
@@ -2258,7 +2258,7 @@
}
// 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('/[^\w-]/', '', $tagName) , 0, 100);
// If the value is an array then we will call this function recursively:
if (is_array($v)) {
@@ -2916,7 +2916,7 @@
// Initialize variabels:
$filearray = array();
$sortarray = array();
- $path = ereg_replace('\/$','',$path);
+ $path = preg_replace('/\/$/', '', $path);
// Find files+directories:
if (@is_dir($path)) {
@@ -3320,19 +3320,21 @@
* @param array Array of GET parameters to include
* @return string
*/
public static function linkThisScript(array $getParams=array()) {
$parts = t3lib_div::getIndpEnv('SCRIPT_NAME');
$params = t3lib_div::_GET();
foreach($getParams as $k => $v) {
if (strcmp($v,'')) {
$params[$k]=$v;
} else unset($params[$k]);
}
$pString = t3lib_div::implodeArrayForUrl('',$params);
- return $pString ? $parts.'?'.ereg_replace('^&','',$pString) : $parts;
+ return $pString ? $parts . '?' . preg_replace('/^&/', '', $pString) : $parts;
}
/**
@@ -3471,8 +3473,8 @@
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')).
- ($_SERVER['QUERY_STRING']?'?'.$_SERVER['QUERY_STRING']:'');
+ $retVal = '/' . preg_replace('/^\//', '', t3lib_div::getIndpEnv('SCRIPT_NAME')) .
+ ($_SERVER['QUERY_STRING'] ? '?' . $_SERVER['QUERY_STRING'] : '');
} else {
$retVal = $_SERVER['REQUEST_URI'];
}
@@ -3694,11 +3696,11 @@
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/');
Index: t3lib/class.t3lib_iconworks.php
===================================================================
--- t3lib/class.t3lib_iconworks.php (revision 4585)
+++ t3lib/class.t3lib_iconworks.php (working copy)
@@ -241,13 +241,13 @@
}
// Create tagged icon file name:
- $iconFileName_stateTagged = ereg_replace('.([[:alnum:]]+)$', '__'.$flags.'.\1', basename($iconfile));
+ $iconFileName_stateTagged = preg_replace('/.(\w+)$/', '__' . $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('/.(\w+)$/', '__x.\1', basename($iconfile));
if (@is_file(dirname($absfile).'/'.$iconFileName_X)) {
return dirname($iconfile).'/'.$iconFileName_X;
} else {
@@ -277,7 +277,7 @@
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:
@@ -288,7 +288,7 @@
// 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('/\.\w+$/', '', $srcKey) . '.' . $fExt : $srcKey; // Set filename to look for
// If file is found:
if (@is_file($GLOBALS['TBE_STYLES']['skinImgAutoCfg']['absDir'].$lookUpName)) { // If there is a file...
Index: t3lib/class.t3lib_cs.php
===================================================================
--- t3lib/class.t3lib_cs.php (revision 4586)
+++ t3lib/class.t3lib_cs.php (working copy)
@@ -795,7 +795,7 @@
}
$token = md5(microtime());
- $parts = explode($token,ereg_replace('(&([#[:alnum:]]*);)',$token.'\2'.$token,$str));
+ $parts = explode($token, preg_replace('/(&([#\w]*);)/', $token . '\\2' . $token, $str));
foreach($parts as $k => $v) {
if ($k%2) {
if (substr($v,0,1)=='#') { // Dec or hex entities:
Index: t3lib/class.t3lib_stdgraphic.php
===================================================================
--- t3lib/class.t3lib_stdgraphic.php (revision 4585)
+++ t3lib/class.t3lib_stdgraphic.php (working copy)
@@ -1959,12 +1959,12 @@
// 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]);
Index: t3lib/class.t3lib_rteapi.php
===================================================================
--- t3lib/class.t3lib_rteapi.php (revision 4585)
+++ t3lib/class.t3lib_rteapi.php (working copy)
@@ -196,7 +196,7 @@
*/
function triggerField($fieldName) {
- $triggerFieldName = ereg_replace('\[([^]]+)\]$','[_TRANSFORM_\1]', $fieldName);
+ $triggerFieldName = preg_replace('/\[([^]]+)\]$/', '[_TRANSFORM_\1]', $fieldName);
return '';
}
}
Index: t3lib/class.t3lib_page.php
===================================================================
--- t3lib/class.t3lib_page.php (revision 4585)
+++ t3lib/class.t3lib_page.php (working copy)
@@ -496,12 +496,12 @@
*/
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));
// 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',
@@ -520,8 +520,8 @@
if ($row['redirectTo']) {
$redirectUrl = $row['redirectTo'];
if ($row['prepend_params']) {
- $redirectUrl = ereg_replace('\/$', '', $redirectUrl);
- $prependStr = ereg_replace('^\/','',substr($request_uri,strlen($path)));
+ $redirectUrl = preg_replace('/\/$/', '', $redirectUrl);
+ $prependStr = preg_replace('/^\//', '', substr($request_uri, strlen($path)));
$redirectUrl .= '/' . $prependStr;
}
Index: t3lib/class.t3lib_readmail.php
===================================================================
--- t3lib/class.t3lib_readmail.php (revision 4585)
+++ t3lib/class.t3lib_readmail.php (working copy)
@@ -178,7 +178,7 @@
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;
}
Index: t3lib/class.t3lib_superadmin.php
===================================================================
--- t3lib/class.t3lib_superadmin.php (revision 4585)
+++ t3lib/class.t3lib_superadmin.php (working copy)
@@ -445,8 +445,8 @@
$content = '';
foreach($this->parentDirs as $k => $v) {
- $dir = ereg_replace('/$','',$v['dir']);
- $baseUrl=ereg_replace('/$','',$v['url']);
+ $dir = preg_replace('/\/$/', '', $v['dir']);
+ $baseUrl = preg_replace('/\/$/', '', $v['url']);
$content.='
';
$content.=$this->headerParentDir($dir);
if (@is_dir($dir)) {
Index: t3lib/class.t3lib_parsehtml_proc.php
===================================================================
--- t3lib/class.t3lib_parsehtml_proc.php (revision 4585)
+++ t3lib/class.t3lib_parsehtml_proc.php (working copy)
@@ -150,8 +150,8 @@
*/
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 = '';
@@ -983,8 +983,8 @@
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).
@@ -1005,12 +1005,12 @@
}
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) {
@@ -1286,7 +1286,7 @@
}
// 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')) {
Index: t3lib/class.t3lib_foldertree.php
===================================================================
--- t3lib/class.t3lib_foldertree.php (revision 4586)
+++ t3lib/class.t3lib_foldertree.php (working copy)
@@ -266,7 +266,7 @@
$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);
Index: t3lib/class.t3lib_befunc.php
===================================================================
--- t3lib/class.t3lib_befunc.php (revision 4585)
+++ t3lib/class.t3lib_befunc.php (working copy)
@@ -1825,7 +1825,7 @@
$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[] = preg_replace('/:$/', '', $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');
@@ -3200,7 +3200,7 @@
if (is_array($dRec)) {
reset($dRec);
$dRecord = current($dRec);
- return ereg_replace('\/$', '', $dRecord['domainName']);
+ return preg_replace('/\/$/', '', $dRecord['domainName']);
}
}
}
@@ -3217,9 +3217,9 @@
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;
Index: t3lib/class.t3lib_htmlmail.php
===================================================================
--- t3lib/class.t3lib_htmlmail.php (revision 4585)
+++ t3lib/class.t3lib_htmlmail.php (working copy)
@@ -982,7 +982,7 @@
$expr = "^[^".quotemeta("\"").quotemeta("'")."]*";
for($i = 1; $i < $pieces; $i++) {
$temp = $codepieces[$i];
- $temp = trim(ereg_replace("=","",trim($temp)));
+ $temp = trim(preg_replace('/=/', '', trim($temp)));
ereg($expr,substr($temp,1,strlen($temp)),$reg);
$imageData['ref'] = $reg[0];
$imageData['quotes'] = substr($temp,0,1);