Project

General

Profile

Bug #19728 » 9994.KD.patch

Administrator Admin, 2009-01-22 18:33

View differences:

typo3/alt_clickmenu.php (working copy)
</tr>';
} else { // Just make normal element:
$onClick=$i[3];
$onClick=eregi_replace('return[[:space:]]+hideCM\(\)[[:space:]]*;','',$onClick);
$onClick=eregi_replace('return[[:space:]]+false[[:space:]]*;','',$onClick);
$onClick=eregi_replace('hideCM\(\);','',$onClick);
$onClick=preg_replace('/return[[:space:]]+hideCM\(\)[[:space:]]*;/i','',$onClick);
$onClick=preg_replace('/return[[:space:]]+false[[:space:]]*;/i','',$onClick);
$onClick=preg_replace('/hideCM\(\);/i','',$onClick);
if (!$i[5]) $onClick.='Clickmenu.hideAll();';
if ($GLOBALS['TYPO3_CONF_VARS']['BE']['useOnContextMenuHandler']) {
typo3/show_item.php (working copy)
} 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/class.filelistfoldertree.php (working copy)
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.'/';
......
$icon = 'gfx/i/_icon_' .$webpath . 'folders' . ($type == 'readonly' ? '_ro' : '') . '.gif';
if ($val == '_temp_') {
$icon = 'gfx/i/sysf.gif';
$row['title'] = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_file_list.xml:temp', true);
$row['title'] = $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_file_list.xml:temp', true);
$row['_title'] = '<strong>' . $GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_mod_file_list.xml:temp', true) . '</strong>';
}
if ($val == '_recycler_') {
typo3/mod/tools/em/class.nusoap.php (working copy)
case (is_array($val) || $type):
// detect if struct or array
$valueType = $this->isArraySimpleOrStruct($val);
if($valueType=='arraySimple' || ereg('^ArrayOf',$type)){
if($valueType=='arraySimple' || preg_match('/^ArrayOf/',$type)){
$i = 0;
if(is_array($val) && count($val)> 0){
foreach($val as $v){
......
*/
function expandQname($qname){
// get element prefix
if(strpos($qname,':') && !ereg('^http://',$qname)){
if(strpos($qname,':') && !preg_match('/^http:\/\//',$qname)){
// get unqualified name
$name = substr(strstr($qname,':'),1);
// get ns prefix
......
function timestamp_to_iso8601($timestamp,$utc=true){
$datestr = date('Y-m-d\TH:i:sO',$timestamp);
if($utc){
$eregStr =
$pattern = '/'.
'([0-9]{4})-'. // centuries & years CCYY-
'([0-9]{2})-'. // months MM-
'([0-9]{2})'. // days DD
......
'([0-9]{2}):'. // hours hh:
'([0-9]{2}):'. // minutes mm:
'([0-9]{2})(\.[0-9]*)?'. // seconds ss.ss...
'(Z|[+\-][0-9]{2}:?[0-9]{2})?'; // Z to indicate UTC, -/+HH:MM:SS.SS... for local tz's
'(Z|[+\-][0-9]{2}:?[0-9]{2})?'. // Z to indicate UTC, -/+HH:MM:SS.SS... for local tz's
'/';
if(ereg($eregStr,$datestr,$regs)){
if(preg_match($pattern,$datestr,$regs)){
return sprintf('%04d-%02d-%02dT%02d:%02d:%02dZ',$regs[1],$regs[2],$regs[3],$regs[4],$regs[5],$regs[6]);
}
return false;
......
* @access public
*/
function iso8601_to_timestamp($datestr){
$eregStr =
$pattern = '/'.
'([0-9]{4})-'. // centuries & years CCYY-
'([0-9]{2})-'. // months MM-
'([0-9]{2})'. // days DD
......
'([0-9]{2}):'. // hours hh:
'([0-9]{2}):'. // minutes mm:
'([0-9]{2})(\.[0-9]+)?'. // seconds ss.ss...
'(Z|[+\-][0-9]{2}:?[0-9]{2})?'; // Z to indicate UTC, -/+HH:MM:SS.SS... for local tz's
if(ereg($eregStr,$datestr,$regs)){
'(Z|[+\-][0-9]{2}:?[0-9]{2})?'. // Z to indicate UTC, -/+HH:MM:SS.SS... for local tz's
'/';
if(preg_match($pattern,$datestr,$regs)){
// not utc
if($regs[8] != 'Z'){
$op = substr($regs[8],0,1);
......
if(count($attrs) > 0){
foreach($attrs as $k => $v){
// if ns declarations, add to class level array of valid namespaces
if(ereg("^xmlns",$k)){
if(preg_match('/^xmlns/',$k)){
//$this->xdebug("$k: $v");
//$this->xdebug('ns_prefix: '.$this->getPrefix($k));
if($ns_prefix = substr(strrchr($k,':'),1)){
......
// minOccurs="0" maxOccurs="unbounded" />
// </sequence>
// </complexType>
if(isset($attrs['base']) && ereg(':Array$',$attrs['base'])){
if(isset($attrs['base']) && preg_match('/:Array$/',$attrs['base'])){
$this->xdebug('complexType is unusual array');
$this->complexTypes[$this->currentComplexType]['phpType'] = 'array';
} else {
......
// minOccurs="0" maxOccurs="unbounded" />
// </sequence>
// </complexType>
if(isset($attrs['base']) && ereg(':Array$',$attrs['base'])){
if(isset($attrs['base']) && preg_match('/:Array$/',$attrs['base'])){
$this->xdebug('complexType is unusual array');
$this->complexTypes[$this->currentComplexType]['phpType'] = 'array';
} else {
......
} elseif(isset($this->attributes[$type])){
$this->xdebug("in getTypeDef, found attribute $type");
return $this->attributes[$type];
} elseif (ereg('_ContainedType$', $type)) {
} elseif (preg_match('/_ContainedType$/', $type)) {
$this->xdebug("in getTypeDef, have an untyped element $type");
$typeDef['typeClass'] = 'simpleType';
$typeDef['phpType'] = 'scalar';
......
function soap_transport_http($url){
parent::nusoap_base();
$this->setURL($url);
ereg('\$Revisio' . 'n: ([^ ]+)', $this->revision, $rev);
preg_match('/\$Revision$this->revision, $rev);
$this->outgoing_headers['User-Agent'] = $this->title.'/'.$this->version.' ('.$rev[1].')';
$this->debug('set User-Agent: ' . $this->outgoing_headers['User-Agent']);
}
......
}
}
// remove 100 header
if(isset($lb) && ereg('^HTTP/1.1 100',$data)){
if(isset($lb) && preg_match('/^HTTP\/1.1 100/',$data)){
unset($lb);
$data = '';
}//
......
curl_close($this->ch);
// remove 100 header(s)
while (ereg('^HTTP/1.1 100',$data)) {
while (preg_match('/^HTTP\/1.1 100/',$data)) {
if ($pos = strpos($data,"\r\n\r\n")) {
$data = ltrim(substr($data,$pos));
} elseif($pos = strpos($data,"\n\n") ) {
......
$this->currentSchema->schemaStartElement($parser, $name, $attrs);
$this->appendDebug($this->currentSchema->getDebug());
$this->currentSchema->clearDebug();
} elseif (ereg('schema$', $name)) {
} elseif (preg_match('/schema$/', $name)) {
$this->debug('Parsing WSDL schema');
// $this->debug("startElement for $name ($attrs[name]). status = $this->status (".$this->getLocalPart($name).")");
$this->status = 'schema';
......
if (count($attrs) > 0) {
// register namespace declarations
foreach($attrs as $k => $v) {
if (ereg("^xmlns", $k)) {
if (preg_match('/^xmlns/', $k)) {
if ($ns_prefix = substr(strrchr($k, ':'), 1)) {
$this->namespaces[$ns_prefix] = $v;
} else {
......
$attrs = array();
}
// get element prefix, namespace and name
if (ereg(':', $name)) {
if (preg_match('/:/', $name)) {
// get ns prefix
$prefix = substr($name, 0, strpos($name, ':'));
// get ns
......
*/
function end_element($parser, $name){
// unset schema status
if (/*ereg('types$', $name) ||*/ ereg('schema$', $name)) {
if (/*preg_match('/types$/', $name) ||*/ preg_match('/schema$/', $name)) {
$this->status = "";
$this->appendDebug($this->currentSchema->getDebug());
$this->currentSchema->clearDebug();
......
$key_localpart = $this->getLocalPart($key);
// if ns declarations, add to class level array of valid namespaces
if($key_prefix == 'xmlns'){
if(ereg('^http://www.w3.org/[0-9]{4}/XMLSchema$',$value)){
if(preg_match('/^http:\/\/www.w3.org\/[0-9]{4}\/XMLSchema$/',$value)){
$this->XMLSchemaVersion = $value;
$this->namespaces['xsd'] = $this->XMLSchemaVersion;
$this->namespaces['xsi'] = $this->XMLSchemaVersion.'-instance';
......
// should do something here with the namespace of specified type?
} elseif($key_localpart == 'arrayType'){
$this->message[$pos]['type'] = 'array';
/* do arrayType ereg here
/* do arrayType preg_match here
[1] arrayTypeValue ::= atype asize
[2] atype ::= QName rank*
[3] rank ::= '[' (',')* ']'
......
[5] length ::= nextDimension* Digit+
[6] nextDimension ::= Digit+ ','
*/
$expr = '([A-Za-z0-9_]+):([A-Za-z]+[A-Za-z0-9_]+)\[([0-9]+),?([0-9]*)\]';
if(ereg($expr,$value,$regs)){
$expr = '/([A-Za-z0-9_]+):([A-Za-z]+[A-Za-z0-9_]+)\[([0-9]+),?([0-9]*)\]/';
if(preg_match($expr,$value,$regs)){
$this->message[$pos]['typePrefix'] = $regs[1];
$this->message[$pos]['arrayTypePrefix'] = $regs[1];
if (isset($this->namespaces[$regs[1]])) {
......
// detect transport
switch(true){
// http(s)
case ereg('^http',$this->endpoint):
case preg_match('/^http/',$this->endpoint):
$this->debug('transporting via HTTP');
if($this->persistentConnection == true && is_object($this->persistentConnection)){
$http =& $this->persistentConnection;
......
$http->setEncoding($this->http_encoding);
}
$this->debug('sending message, length='.strlen($msg));
if(ereg('^http:',$this->endpoint)){
if(preg_match('/^http:/',$this->endpoint)){
//if(strpos($this->endpoint,'http:')){
$this->responseData = $http->send($msg,$timeout,$response_timeout,$this->cookies);
} elseif(ereg('^https',$this->endpoint)){
} elseif(preg_match('/^https/',$this->endpoint)){
//} elseif(strpos($this->endpoint,'https:')){
//if(phpversion() == '4.3.0-dev'){
//$response = $http->send($msg,$timeout,$response_timeout);
......
if (strpos($headers['content-type'], '=')) {
$enc = str_replace('"', '', substr(strstr($headers["content-type"], '='), 1));
$this->debug('Got response encoding: ' . $enc);
if(eregi('^(ISO-8859-1|US-ASCII|UTF-8)$',$enc)){
if(preg_match('/^(ISO-8859-1|US-ASCII|UTF-8)$/i',$enc)){
$this->xml_encoding = strtoupper($enc);
} else {
$this->xml_encoding = 'US-ASCII';
typo3/sysext/lowlevel/clmods/class.rte_images.php (working copy)
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('/\.[[:alnum:]]+$/','',substr($filename,10));
$infoString = $this->infoStr($rec);
// Build index:
typo3/sysext/lowlevel/clmods/class.lost_files.php (working copy)
}
} else {
// When here it means the file was not found. So we test if it has a RTEmagic-image name and if so, we allow it:
if (ereg('^RTEmagic[P|C]_',basename($value))) {
if (preg_match('/^RTEmagic[P|C]_/',basename($value))) {
unset($fileArr[$key]) ;
$resultArray['RTEmagicFiles'][$shortKey] = $value;
} else {
typo3/sysext/lowlevel/dbint/index.php (working copy)
if (is_array($files)) {
$files_searched+=count($files);
foreach ($files as $value) {
if (eregi($pattern,basename($value))) $matching_files[]=substr($value,strlen(PATH_site));
if (preg_match('/'.$pattern.'/i',basename($value))) $matching_files[]=substr($value,strlen(PATH_site));
}
}
typo3/sysext/cms/tslib/publish.php (working copy)
// ***************************
$publishDir = $TYPO3_CONF_VARS['FE']['publish_dir'];
if ($publishDir && @is_dir($publishDir)) {
$publishDir = ereg_replace('/*$','',$publishDir).'/';
$publishDir = rtrim($publishDir, '/').'/';
debug('Publishing in: '.$publishDir,1);
reset($temp_publish_array);
while(list($key,$val)=each($temp_publish_array)) {
typo3/sysext/cms/tslib/class.tslib_search.php (working copy)
function split($origSword, $specchars='+-', $delchars='+.,-') {
$sword = $origSword;
$specs = '['.$this->quotemeta($specchars).']';
$delchars = '['.$this->quotemeta($delchars).']';
// 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
ereg('^[^"]*',$sword,$reg); // Removes everything till next double-quote
if (preg_match('/^"/',$sword)) { // There was a double-quote and we will then look for the ending quote.
$sword = preg_replace('/^"/','',$sword); // Removes first double-quote
preg_match('/^[^"]*/',$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
} elseif (ereg('^'.$specs,$sword,$reg)) {
$sword = preg_replace('/^'.$this->quotemeta($reg[0]).'/','',$sword);
$sword = trim(preg_replace('/^"/','',$sword)); // Removes last double-quote
} elseif (preg_match('/^'.$specs.'/',$sword,$reg)) {
$value[] = $reg[0];
$sword = trim(ereg_replace('^'.$specs,'',$sword)); // Removes = sign
} elseif (ereg('[\+\-]',$sword)) { // Check if $sword contains + or -
$sword = trim(preg_replace('/^'.$specs.'/','',$sword)); // Removes = sign
} elseif (preg_match('/[\+\-]/',$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 = rtrim($word, $delchars); // 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
preg_match('/^[^ '.$this->quotemeta($specchars).']*/',$sword,$reg);
$word = rtrim(trim($reg[0]), $delchars); // 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));
}
}
typo3/sysext/cms/tslib/class.tslib_pibase.php (working copy)
* @return string The processed input string, modified IF a <a> tag was found
*/
function pi_openAtagHrefInJSwindow($str,$winName='',$winParams='width=670,height=500,status=0,menubar=0,scrollbars=1,resizable=1') {
if (eregi('(.*)(<a[^>]*>)(.*)',$str,$match)) {
if (preg_match('/(.*)(<a[^>]*>)(.*)/i',$str,$match)) {
$aTagContent = t3lib_div::get_tag_attributes($match[2]);
$match[2]='<a href="#" onclick="'.
htmlspecialchars('vHWin=window.open(\''.$GLOBALS['TSFE']->baseUrlWrap($aTagContent['href']).'\',\''.($winName?$winName:md5($aTagContent['href'])).'\',\''.$winParams.'\');vHWin.focus();return false;').
typo3/sysext/cms/tslib/class.tslib_content.php (working copy)
$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('/[^[:alnum:]]/','',$confData['fieldname']))=='email') {$confData['fieldname']='email';}
// Duplicate fieldnames resolved
if (isset($fieldname_hashArray[md5($confData['fieldname'])])) {
$confData['fieldname'].='_'.$cc;
......
*/
function linkWrap($content,$wrap) {
$wrapArr = explode('|', $wrap);
if (ereg("\{([0-9]*)\}",$wrapArr[0],$reg)) {
if (preg_match('/\{([0-9]*)\}/',$wrapArr[0],$reg)) {
if ($uid = $GLOBALS['TSFE']->tmpl->rootLine[$reg[1]]['uid']) {
$wrapArr[0] = str_replace($reg[0],$uid,$wrapArr[0]);
}
......
}
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= str_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.']));}
......
}
$temp = explode($char,$content);
$last = ''.(count($temp)-1);
$index=$this->calc(eregi_replace('last',$last,$listNum));
$index=$this->calc(str_ireplace('last',$last,$listNum));
return $temp[$index];
}
......
*/
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;
}
......
"'<\w+.*?(onabort|onbeforeunload|onblur|onchange|onclick|ondblclick|ondragdrop|onerror|onfilterchange|onfocus|onhelp|onkeydown|onkeypress|onkeyup|onload|onmousedown|onmousemove|onmouseout|onmouseover|onmouseup|onmove|onreadystatechange|onreset|onresize|onscroll|onselect|onselectstart|onsubmit|onunload).*?>'si",
), '', $text);
$text = eregi_replace('<a[^>]*href[[:space:]]*=[[:space:]]*["\']?[[:space:]]*javascript[^>]*','',$text);
$text = preg_replace('/<a[^>]*href[[:space:]]*=[[:space:]]*["\']?[[:space:]]*javascript[^>]*/i','',$text);
// Return clean content
return $text;
......
}
// 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](\.[[:alnum:]]*)$/','\1',$theValue);
$theValue = $this->stdWrap($theValue,$conf['labelStdWrap.']);
// Wrapping file
......
$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]);
}
}
}
......
$data = substr($theValue,$pointer,$len); // $data is the content until the next <tag-start or end is detected. In case of a currentTag set, this would mean all data between the start- and end-tags
if ($data!='') {
if ($stripNL) { // If the previous tag was set to strip NewLines in the beginning of the next data-chunk.
$data = ereg_replace('^[ ]*'.chr(13).'?'.chr(10), '', $data);
$data = preg_replace('/^[ ]*'.chr(13).'?'.chr(10).'/', '', $data);
}
if (!is_array($currentTag)) { // These operations should only be performed on code outside the tags...
......
}
$this->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
......
if (trim(substr($textstr,-1))=='' && $len) {
$lastChar=substr($textpieces[$i],$len-1,1);
if (!ereg('[A-Za-z0-9\/#_-]',$lastChar)) {$len--;} // Included '\/' 3/12
if (!preg_match('/[A-Za-z0-9\/#_-]/',$lastChar)) {$len--;} // Included '\/' 3/12
$parts[0]=substr($textpieces[$i],0,$len);
$parts[1]=substr($textpieces[$i],$len);
......
$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)) {$len--;}
if (!preg_match('/[A-Za-z0-9]/',$lastChar)) {$len--;}
$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 = '<a href="'.$mailToUrl.'"'.$aTagParams.'>';
......
$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('/\.[[:alnum:]]+$/','',basename($theImage)),intval($GLOBALS['TSFE']->config['config']['meaningfulTempFilePrefix']),'_');
}
if ($fileArray['sample']) {
......
$JSwindowParts = array();
$JSwindowParams = '';
$onClick = '';
if ($forceTarget && ereg('^([0-9]+)x([0-9]+)(:(.*)|.*)$',$forceTarget,$JSwindowParts)) {
if ($forceTarget && preg_match('/^([0-9]+)x([0-9]+)(:(.*)|.*)$/',$forceTarget,$JSwindowParts)) {
// Take all pre-configured and inserted parameters and compile parameter list, including width+height:
$JSwindow_tempParamsArr = t3lib_div::trimExplode(',',strtolower($conf['JSwindow_params'].','.$JSwindowParts[4]),1);
$JSwindow_paramsArr=array();
......
// Detecting kind of link:
if(strstr($link_param,'@') && (!$pU['scheme'] || $pU['scheme']=='mailto')) { // If it's a mail address:
$link_param = eregi_replace('^mailto:','',$link_param);
$link_param = preg_replace('/^mailto:/i','',$link_param);
list($this->lastTypoLinkUrl,$linktxt) = $this->getMailTo($link_param,$linktxt,$initP);
$finalTagParts['url']=$this->lastTypoLinkUrl;
$finalTagParts['TYPE']='mailto';
......
$GLOBALS['TT']->setTSlogMessage($error);
} else {
$row = $GLOBALS['TYPO3_DB']->sql_fetch_row($res);
$conf['max'] = eregi_replace('total', $row[0], $conf['max']);
$conf['begin'] = eregi_replace('total', $row[0], $conf['begin']);
$conf['max'] = str_ireplace('total', $row[0], $conf['max']);
$conf['begin'] = str_ireplace('total', $row[0], $conf['begin']);
}
$GLOBALS['TYPO3_DB']->sql_free_result($res);
}
......
);
if (trim($conf['uidInList'])) {
$listArr = t3lib_div::intExplode(',',str_replace('this',$GLOBALS['TSFE']->contentPid,$conf['uidInList'])); // str_replace instead of ereg_replace 020800
$listArr = t3lib_div::intExplode(',',str_replace('this',$GLOBALS['TSFE']->contentPid,$conf['uidInList']));
if (count($listArr)==1) {
$query.=' AND '.$table.'.uid='.intval($listArr[0]);
} else {
......
$pid_uid_flag++;
}
if (trim($conf['pidInList'])) {
$listArr = t3lib_div::intExplode(',',str_replace('this',$GLOBALS['TSFE']->contentPid,$conf['pidInList'])); // str_replace instead of ereg_replace 020800
$listArr = t3lib_div::intExplode(',',str_replace('this',$GLOBALS['TSFE']->contentPid,$conf['pidInList']));
// removes all pages which are not visible for the user!
$listArr = $this->checkPidArray($listArr);
if (count($listArr)) {
typo3/sysext/cms/tslib/class.tslib_pagegen.php (working copy)
}
}
}
$GLOBALS['TSFE']->sWordRegEx = ereg_replace('\|$','',$GLOBALS['TSFE']->sWordRegEx);
$GLOBALS['TSFE']->sWordRegEx = preg_replace('/\|$/','',$GLOBALS['TSFE']->sWordRegEx);
}
// linkVars
......
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'])) {
......
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;
typo3/sysext/cms/tslib/class.tslib_fe.php (working copy)
$message = 'You logged out from Workspace preview mode. Click this link to <a href="%1$s">go back to the website</a>';
}
die(sprintf($message,
htmlspecialchars(ereg_replace('\&?ADMCMD_prev=[[:alnum:]]+','',t3lib_div::_GET('returnUrl')))
htmlspecialchars(preg_replace('/\&?ADMCMD_prev=[[:alnum:]]+/','',t3lib_div::_GET('returnUrl')))
));
}
typo3/sysext/cms/tslib/class.tslib_gifbuilder.php (working copy)
case 'IMAGE':
$fileInfo = $this->getResource($conf['file'],$conf['file.']);
if ($fileInfo) {
$this->combinedFileNames[] = ereg_replace('\.[[:alnum:]]+$','',basename($fileInfo[3]));
$this->combinedFileNames[] = preg_replace('/\.[[:alnum:]]+$/','',basename($fileInfo[3]));
$this->setup[$theKey.'.']['file'] = $fileInfo[3];
$this->setup[$theKey.'.']['BBOX'] = $fileInfo;
$this->objBB[$theKey] = $fileInfo;
typo3/sysext/cms/layout/class.tx_cms_layout.php (working copy)
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'),rtrim(trim($GLOBALS['LANG']->sL(t3lib_BEfunc::getItemLabel('pages',$field))), ':'));
$eI= '<a href="#" onclick="'.htmlspecialchars(t3lib_BEfunc::editOnClick($params,$this->backPath,'')).'">'.
'<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/edit2.gif','width="11" height="12"').' title="'.htmlspecialchars($iTitle).'" alt="" />'.
'</a>';
typo3/sysext/impexp/app/index.php (working copy)
$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('/[^[:alnum:]./_-]*/','',preg_replace('/\.(t3d|xml)$/','',$inData['filename'])));
if (strlen($inData['filename'])) {
$inData['filename'].= $inData['filetype']=='xml' ? '.xml' : '.t3d';
}
......
}
// 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('/[^[:alnum:]_]/','-',$inData['download_export_name']),0,20).'_'.date('d-m-H-i-s').$fExt;
// Export for download:
if ($inData['download_export']) {
typo3/sysext/impexp/class.tx_impexp.php (working copy)
$uniquePrefix = '###'.md5(time()).'###';
if (strtolower($html_fI['extension'])==='css') {
$prefixedMedias = explode($uniquePrefix, eregi_replace('(url[[:space:]]*\([[:space:]]*["\']?)([^"\')]*)(["\']?[[:space:]]*\))', '\1'.$uniquePrefix.'\2'.$uniquePrefix.'\3', $fileRec['content']));
$prefixedMedias = explode($uniquePrefix, preg_replace('/(url[[:space:]]*\([[:space:]]*["\']?)([^"\')]*)(["\']?[[:space:]]*\))/i', '\1'.$uniquePrefix.'\2'.$uniquePrefix.'\3', $fileRec['content']));
} else { // html, htm:
$htmlParser = t3lib_div::makeInstance('t3lib_parsehtml');
$prefixedMedias = explode($uniquePrefix, $htmlParser->prefixResourcePath($uniquePrefix,$fileRec['content'],array(),$uniquePrefix));
......
function remapListedDBRecords_flexFormCallBack($pParams, $dsConf, $dataValue, $dataValue_ext1, $dataValue_ext2, $path) {
// Extract parameters:
list($table,$uid,$field,$config) = $pParams;
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'][rtrim($path, '/')])) {
$path = rtrim($path, '/');
}
if (is_array($config['flexFormRels']['db'][$path])) {
$valArray = $this->setRelations_db($config['flexFormRels']['db'][$path]);
$dataValue = implode(',',$valArray);
# debug(array('value' => $dataValue));
}
if (is_array($config['flexFormRels']['file'][$path])) {
......
$dataValue = implode(',',$valArr);
}
// Return
return array('value' => $dataValue);
}
......
}
} 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']) {
typo3/sysext/rtehtmlarea/class.tx_rtehtmlarea_base.php (working copy)
// 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);
......
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/');
typo3/sysext/openid/lib/php-openid/Auth/OpenID/PAPE.php (working copy)
'http://schemas.openid.net/pape/policies/2007/06/phishing-resistant');
define('PAPE_TIME_VALIDATOR',
'^[0-9]{4,4}-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9]Z$');
'/^[0-9]{4,4}-[0-9][0-9]-[0-9][0-9]T[0-9][0-9]:[0-9][0-9]:[0-9][0-9]Z$/');
/**
* A Provider Authentication Policy request, sent from a relying party
* to a provider
......
$auth_time = Auth_OpenID::arrayGet($args, 'auth_time');
if ($auth_time !== null) {
if (ereg(PAPE_TIME_VALIDATOR, $auth_time)) {
if (preg_match(PAPE_TIME_VALIDATOR, $auth_time)) {
$this->auth_time = $auth_time;
} else if ($strict) {
return false;
......
}
if ($this->auth_time !== null) {
if (!ereg(PAPE_TIME_VALIDATOR, $this->auth_time)) {
if (!preg_match(PAPE_TIME_VALIDATOR, $this->auth_time)) {
return false;
}
typo3/sysext/fe_edit/view/class.tx_feedit_editpanel.php (working copy)
$cBuf = rtrim($content);
$securCount = 30;
while($securCount && substr($cBuf, -1) == '>' && substr($cBuf, -4) != '</a>') {
$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;
typo3/sysext/install/mod/class.tx_install.php (working copy)
$tmap=array('day'=>1, 'week'=>7, 'month'=>30);
$tt = $this->INSTALL['typo3temp_delete'];
$subdir = $this->INSTALL['typo3temp_subdir'];
if (strlen($subdir) && !ereg('^[[:alnum:]_]+/$',$subdir)) die('subdir "'.$subdir.'" was not allowed!');
if (strlen($subdir) && !preg_match('/^[[:alnum:]_]+\/$/',$subdir)) die('subdir "'.$subdir.'" was not allowed!');
$action = $this->INSTALL['typo3temp_action'];
$d = @dir($this->typo3temp_path.$subdir);
if (is_object($d)) {
......
}
if ($ok) {
$hashPart=substr(basename($theFile),-14,10);
if (!ereg('[^a-f0-9]',$hashPart) || substr($theFile,-6)==='.cache' || substr($theFile,-4)==='.tbl' || substr(basename($theFile),0,8)==='install_') { // This is a kind of check that the file being deleted has a 10 char hash in it
if (!preg_match('/[^a-f0-9]/',$hashPart) || substr($theFile,-6)==='.cache' || substr($theFile,-4)==='.tbl' || substr(basename($theFile),0,8)==='install_') { // This is a kind of check that the file being deleted has a 10 char hash in it
if ($action && $deleteCounter<$action) {
$deleteCounter++;
unlink($theFile);
......
reset($paths);
while(list($k,$v)=each($paths)) {
reset($programs);
if (!ereg('[\\\/]$',$v)) $v.='/';
if (!preg_match('/[\\\/]$/',$v)) $v.='/';
while(list(,$filename)=each($programs)) {
if (ini_get('open_basedir') || (file_exists($v)&&@is_file($v.$filename.$isExt))) {
$version = $this->_checkImageMagick_getVersion($filename,$v);
......
#debug($this->INSTALL);
if (trim($this->INSTALL['localconf.php']['NEW_DATABASE_NAME'])) {
$newdbname=trim($this->INSTALL['localconf.php']['NEW_DATABASE_NAME']);
if (!ereg('[^[:alnum:]_-]',$newdbname)) {
if (!preg_match('/[^[:alnum:]_-]/',$newdbname)) {
if ($result = $GLOBALS['TYPO3_DB']->sql_pconnect(TYPO3_db_host, TYPO3_db_username, TYPO3_db_password)) {
if ($GLOBALS['TYPO3_DB']->admin_query('CREATE DATABASE '.$newdbname)) {
$this->INSTALL['localconf.php']['typo_db'] = $newdbname;
......
break;
case 'im_path':
list($value,$version) = explode('|',$value);
if (!ereg('[[:space:]]',$value,$reg) && strlen($value)<100) {
if (!preg_match('/[[:space:]]/',$value,$reg) && strlen($value)<100) {
if (strcmp($GLOBALS['TYPO3_CONF_VARS']['GFX'][$key], $value)) {
$this->setValueInLocalconfFile($lines, '$TYPO3_CONF_VARS[\'GFX\'][\'' . $key . '\']', $value);
}
......
break;
case 'im_path_lzw':
list($value) = explode('|',$value);
if (!ereg('[[:space:]]',$value) && strlen($value)<100) {
if (!preg_match('/[[:space:]]/',$value) && strlen($value)<100) {
if (strcmp($GLOBALS['TYPO3_CONF_VARS']['GFX'][$key], $value)) {
$this->setValueInLocalconfFile($lines, '$TYPO3_CONF_VARS[\'GFX\'][\'' . $key . '\']', $value);
}
......
$out='';
switch($fieldInfo['config']['type']) {
case 'input':
if (ereg('date|time|int|year',$fieldInfo['config']['eval'])) {
if (preg_match('/date|time|int|year/',$fieldInfo['config']['eval'])) {
$out = "int(11) NOT NULL default '0'";
} else {
$max = intval($fieldInfo['config']['max']);
typo3/sysext/beuser/mod/index.php (working copy)
$pout[]='<span class="nobr">'.t3lib_iconWorks::getIconImage($table,array(),$GLOBALS['BACK_PATH'],'align="top"').$GLOBALS['LANG']->sL($GLOBALS['TCA'][$table]['ctrl']['title']).'</span>';
}
if ($GLOBALS['TCA'][$table]['columns'][$field]) {
$pout[]='<span class="nobr"> - '.ereg_replace(':$','',$GLOBALS['LANG']->sL($GLOBALS['TCA'][$table]['columns'][$field]['label'])).'</span>';
$pout[]='<span class="nobr"> - '.rtrim($GLOBALS['LANG']->sL($GLOBALS['TCA'][$table]['columns'][$field]['label']), ':').'</span>';
}
}
}
typo3/sysext/sys_action/class.tx_sysaction.php (working copy)
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;
typo3/sysext/indexed_search/class.external_parser.php (working copy)
case 'pdf':
// PDF
if ($indexerConfig['pdftools']) {
$pdfPath = ereg_replace("\/$",'',$indexerConfig['pdftools']).'/';
$pdfPath = rtrim($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;
......
case 'doc':
// Catdoc
if ($indexerConfig['catdoc']) {
$catdocPath = ereg_replace("\/$",'',$indexerConfig['catdoc']).'/';
$catdocPath = rtrim($indexerConfig['catdoc'], '/').'/';
if (ini_get('safe_mode') || @is_file($catdocPath.'catdoc'.$exe)) {
$this->app['catdoc'] = $catdocPath.'catdoc'.$exe;
$extOK = TRUE;
......
case 'ppt': // MS PowerPoint
// ppthtml
if ($indexerConfig['ppthtml']) {
$ppthtmlPath = ereg_replace('\/$','',$indexerConfig['ppthtml']).'/';
$ppthtmlPath = rtrim($indexerConfig['ppthtml'], '/').'/';
if (ini_get('safe_mode') || @is_file($ppthtmlPath.'ppthtml'.$exe)){
$this->app['ppthtml'] = $ppthtmlPath.'ppthtml'.$exe;
$extOK = TRUE;
......
case 'xls': // MS Excel
// Xlhtml
if ($indexerConfig['xlhtml']) {
$xlhtmlPath = ereg_replace('\/$','',$indexerConfig['xlhtml']).'/';
$xlhtmlPath = rtrim($indexerConfig['xlhtml'], '/').'/';
if (ini_get('safe_mode') || @is_file($xlhtmlPath.'xlhtml'.$exe)){
$this->app['xlhtml'] = $xlhtmlPath.'xlhtml'.$exe;
$extOK = TRUE;
......
case 'odp': // Oasis OpenDocument Presentation
case 'odt': // Oasis OpenDocument Text
if ($indexerConfig['unzip']) {
$unzipPath = preg_replace('/\/$/','',$indexerConfig['unzip']).'/';
$unzipPath = rtrim($indexerConfig['unzip'], '/').'/';
if (ini_get('safe_mode') || @is_file($unzipPath.'unzip'.$exe)) {
$this->app['unzip'] = $unzipPath.'unzip'.$exe;
$extOK = TRUE;
......
case 'rtf':
// Catdoc
if ($indexerConfig['unrtf']) {
$unrtfPath = ereg_replace("\/$",'',$indexerConfig['unrtf']).'/';
$unrtfPath = rtrim($indexerConfig['unrtf'], '/').'/';
if (ini_get('safe_mode') || @is_file($unrtfPath.'unrtf'.$exe)) {
$this->app['unrtf'] = $unrtfPath.'unrtf'.$exe;
$extOK = TRUE;
......
$fileContent = t3lib_div::getUrl($absFile);
// Finding charset:
eregi('^[[:space:]]*<\?xml[^>]+encoding[[:space:]]*=[[:space:]]*["\'][[:space:]]*([[:alnum:]_-]+)[[:space:]]*["\']',substr($fileContent,0,200),$reg);
preg_match('/^[[:space:]]*<\?xml[^>]+encoding[[:space:]]*=[[:space:]]*["\'][[:space:]]*([[:alnum:]_-]+)[[:space:]]*["\']/i',substr($fileContent,0,200),$reg);
$charset = $reg[1] ? $this->pObj->csObj->parse_charset($reg[1]) : 'utf-8';
// Converting content:
......
* @return string String
*/
function removeEndJunk($string) {
return trim(ereg_replace('['.chr(10).chr(12).']*$','',$string));
return trim(preg_replace('/['.chr(10).chr(12).']*$/','',$string));
}
typo3/sysext/indexed_search/pi/class.tx_indexedsearch.php (working copy)
// 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('/^[^[:space:]]+[[:space:]]/','',$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('/[[:space:]][^[:space:]]+$/','',$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)).
$output[$k] = preg_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)));
preg_replace('/^[^[:space:]]+[[:space:]]/','',$GLOBALS['TSFE']->csConvObj->crop('utf-8',$parts[$k],-($postPreLgd-$postPreLgd_offset)));
}
}
$summaryLgd+= $GLOBALS['TSFE']->csConvObj->strlen('utf-8', $output[$k]);;
......
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 rtrim($row['domainName'], '/');
}
/**
typo3/sysext/indexed_search/class.indexer.php (working copy)
* @return string The charset value if found.
*/
function getHTMLcharset($content) {
if (eregi('<meta[[:space:]]+[^>]*http-equiv[[:space:]]*=[[:space:]]*["\']CONTENT-TYPE["\'][^>]*>',$content,$reg)) {
if (eregi('charset[[:space:]]*=[[:space:]]*([[:alnum:]-]+)',$reg[0],$reg2)) {
if (preg_match('/<meta[[:space:]]+[^>]*http-equiv[[:space:]]*=[[:space:]]*["\']CONTENT-TYPE["\'][^>]*>/i',$content,$reg)) {
if (preg_match('/charset[[:space:]]*=[[:space:]]*([[:alnum:]-]+)/i',$reg[0],$reg2)) {
return $reg2[1];
}
}
typo3/sysext/indexed_search/class.doublemetaphone.php (working copy)
* @return [type] ...
*/
function IsVowel($string, $pos) {
return ereg("[AEIOUY]", substr($string, $pos, 1));
return preg_match('/[AEIOUY]/', substr($string, $pos, 1));
}
/**
......
* @return [type] ...
*/
function SlavoGermanic($string) {
return ereg("W|K|CZ|WITZ", $string);
return preg_match('/W|K|CZ|WITZ/', $string);
}
} // end of class MetaPhone
?>
typo3/sysext/indexed_search/class.crawler.php (working copy)
* @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,'../')) {
typo3/sysext/dbal/handlers/class.tx_dbal_handler_xmldb.php (working copy)
/**
* Example DBAL handler class
* Stores data in XML, not a database.
*
*
* @author Kasper Skaarhoj <kasper@typo3.com>
* @package TYPO3
* @subpackage tx_dbal
*/
class tx_dbal_handler_xmldb extends t3lib_sqlengine {
var $config = array();
var $pObj; // Set from DBAL class.
var $config = array();
var $pObj; // Set from DBAL class.
// Database Storage directory:
var $DBdir = '';
var $DBstructure = array(
'tables' => array()
);
/**
* Initialize handler
*
*
* @param array Configuration from DBAL
* @param object Parent object
* @return void
* @return void
*/
function init($config, &$pObj) {
$this->config = $config['config'];
$dbStorage = t3lib_div::getFileAbsFileName($this->config['DBstorageDir']);
if ($dbStorage && @is_dir($dbStorage) && ($dbStorage{strlen($dbStorage)-1} == '/')) { //ereg('/$',$dbStorage)) {
if ($dbStorage && @is_dir($dbStorage) && ($dbStorage{strlen($dbStorage)-1} == '/')) {
$this->DBdir = $dbStorage;
// Read structure file:
if (@is_file($this->DBdir.'_STRUCTURE.xml')) {
$this->xmlDB_readStructure();
typo3/sysext/dbal/class.ux_db_list_extra.php (working copy)
foreach($TCA[$table]['columns'] as $fieldName => $info) {
if ($GLOBALS['TYPO3_DB']->cache_fieldType[$table][$fieldName]['metaType'] == 'B') {
// skip, LIKE is not supported on BLOB columns...
} elseif ($info['config']['type']=='text' || ($info['config']['type']=='input' && !ereg('date|time|int',$info['config']['eval']))) {
} elseif ($info['config']['type']=='text' || ($info['config']['type']=='input' && !preg_match('/date|time|int/',$info['config']['eval']))) {
$queryPart .= $or.$fieldName.' LIKE \'%'.$GLOBALS['TYPO3_DB']->quoteStr($this->searchString, $table).'%\'';
$or = ' OR ';
}
......
} else {
// Traverse the configured columns and add all columns that can be searched
foreach($TCA[$table]['columns'] as $fieldName => $info) {
if ($info['config']['type']=='text' || ($info['config']['type']=='input' && !ereg('date|time|int',$info['config']['eval']))) {
if ($info['config']['type']=='text' || ($info['config']['type']=='input' && !preg_match('/date|time|int/',$info['config']['eval']))) {
$sfields[]=$fieldName;
}
}
typo3/sysext/felogin/pi1/class.tx_felogin_pi1.php (working copy)
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.
......
$redirect_url = t3lib_div::getIndpEnv('HTTP_REFERER');
// is referring url allowed to redirect?
$match = array();
if (ereg('^http://([[:alnum:]._-]+)/', $redirect_url, $match)) {
if (preg_match('/^http://([[:alnum:]._-]+)//', $redirect_url, $match)) {
$redirect_domain = $match[1];
$found = false;
foreach(split(',', $this->conf['domains']) as $d) {
if (ereg('(^|\.)'.$d.'$', $redirect_domain)) {
if (preg_match('/(^|\.)/'.$d.'$', $redirect_domain)) {
$found = true;
break;
}
......
}
// 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;
}
typo3/sysext/tstemplate_objbrowser/class.tx_tstemplateobjbrowser.php (working copy)
}
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!<BR>Nothing was updated!',0,0,0,1);
} else {
......
<td><input type="Submit" name="search" value="Search"></td>
</tr>
<tr>
<td>&nbsp;<label for="checkTs_browser_regexsearch">Use ereg(), not stristr():</label>&nbsp;&nbsp;'.t3lib_BEfunc::getFuncCheck($this->pObj->id,"SET[ts_browser_regexsearch]",$this->pObj->MOD_SETTINGS["ts_browser_regexsearch"],'','','id="checkTs_browser_regexsearch"').'</td>
<td>&nbsp;<label for="checkTs_browser_regexsearch">Use preg_match(), not stristr():</label>&nbsp;&nbsp;'.t3lib_BEfunc::getFuncCheck($this->pObj->id,"SET[ts_browser_regexsearch]",$this->pObj->MOD_SETTINGS["ts_browser_regexsearch"],'','','id="checkTs_browser_regexsearch"').'</td>
<td>&nbsp;</td>
</tr>
</table>
typo3/class.browse_links.php (working copy)
* @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/wizard_forms.php (working copy)
}
// 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:
......
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') {
typo3/wizard_table.php (working copy)
if ($this->inputStyle) {
$cells[]='<input type="text"'.$this->doc->formWidth(20).' name="TABLE[c]['.(($k+1)*2).']['.(($a+1)*2).']" value="'.htmlspecialchars($cellContent).'" />';
} else {
$cellContent=eregi_replace('<br[ ]?[\/]?>',chr(10),$cellContent);
$cellContent=preg_replace('/<br[ ]?[\/]?>/i',chr(10),$cellContent);
$cells[]='<textarea '.$this->doc->formWidth(20).' rows="5" name="TABLE[c]['.(($k+1)*2).']['.(($a+1)*2).']">'.t3lib_div::formatForTextarea($cellContent).'</textarea>';
}
typo3/view_help.php (working copy)
$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);
......
// Create label:
$labelStr = $LANG->sL($tableName).
($field ? $mergeToken.ereg_replace(':$','', trim($LANG->sL($fieldName))):'');
($field ? $mergeToken.rtrim(trim($LANG->sL($fieldName)), ':'):'');
return $labelStr;
}
typo3/wizard_tsconfig.php (working copy)
// Generally "->[something]"
$reg=array();
ereg('->[[:alnum:]_]*',$dataType,$reg);
preg_match('/->[[:alnum:]_]*/',$dataType,$reg);
if ($reg[0] && is_array($objTree[$reg[0]])) {
$dataType = str_replace($reg[0],'<a href="'.htmlspecialchars(t3lib_div::linkThisScript(array('show'=>$objTree[$reg[0]][0]['uid'],'objString'=>$objString.'.'.$lP[0]))).'">'.htmlspecialchars($reg[0]).'</a>',$dataType);
}
typo3/template.php (working copy)
// 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'));
// Add the module identifier automatically if typo3/mod.php is used:
if (ereg('typo3/mod\.php$', $pathInfo['path']) && isset($GLOBALS['TBE_MODULES']['_PATHS'][$modName])) {
if (preg_match('/typo3\/mod\.php$/', $pathInfo['path']) && isset($GLOBALS['TBE_MODULES']['_PATHS'][$modName])) {
$storeUrl = '&M='.$modName.$storeUrl;
}
t3lib/class.t3lib_treeview.php (working copy)
* @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_page.php (working copy)
*/
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/thumbs.php (working copy)
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_foldertree.php (working copy)
$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_syntaxhl.php (working copy)
$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_befunc.php (working copy)
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_tcemain.php (working copy)
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);
... This diff was truncated because it exceeds the maximum size that can be displayed.
(2-2/6)