Permalink
Browse files

- ereg -> preg

  • Loading branch information...
1 parent 2f7405e commit db5abc6c211d78ad80b716ddef11eabe5e32f137 @alecpl alecpl committed May 4, 2009
Showing with 7 additions and 7 deletions.
  1. +1 −1 program/lib/enriched.inc
  2. +2 −2 program/lib/icl_commons.inc
  3. +4 −4 program/lib/tnef_decoder.inc
@@ -45,7 +45,7 @@ function enriched_convert_formatting($body){
'</indentright>'=>'</span>');
while(list($find,$replace)=each($a)){
- $body = eregi_replace($find,$replace,$body);
+ $body = preg_replace('#'.$find.'#i', $replace, $body);
}
return $body;
}
@@ -48,8 +48,8 @@ function iil_utf7_decode($str, $raw=false){
}
function iil_utf7_encode($str){
- if (!ereg("[\200-\237]",$str) && !ereg("[\241-\377]",$str))
- return $str;
+ if (!preg_match('/[\200-\237\241-\377]/', $str))
+ return $str;
$len = strlen($str);
@@ -185,12 +185,12 @@ function extract_mapi_attrs($buf, &$attachment_data)
switch($attr_name)
{
case TNEF_MAPI_ATTACH_LONG_FILENAME: // used in preference to AFILENAME value
- $attachment_data[0]['name'] = ereg_replace('.*[\/](.*)$', '\1', $value); // strip path
+ $attachment_data[0]['name'] = preg_replace('/.*[\/](.*)$/', '\1', $value); // strip path
break;
case TNEF_MAPI_ATTACH_MIME_TAG: // Is this ever set, and what is format?
- $attachment_data[0]['type0'] = ereg_replace('^(.*)/.*', '\1', $value);
- $attachment_data[0]['type1'] = ereg_replace('.*/(.*)$', '\1', $value);
+ $attachment_data[0]['type0'] = preg_replace('/^(.*)\/.*/', '\1', $value);
+ $attachment_data[0]['type1'] = preg_replace('/.*\/(.*)$/', '\1', $value);
break;
case TNEF_MAPI_ATTACH_DATA:
@@ -247,7 +247,7 @@ function tnef_decode_attachment(&$buf, &$attachment_data)
case TNEF_AFILENAME: // filename
$length = tnef_geti32($buf);
- $attachment_data[0]['name'] = ereg_replace('.*[\/](.*)$',
+ $attachment_data[0]['name'] = preg_replace('/.*[\/](.*)$/',
'\1',
tnef_getx($length, $buf)); // strip path
tnef_geti16($buf); //checksum

0 comments on commit db5abc6

Please sign in to comment.