[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Fmsystem-commits] [13920] convert from deprecated ereg and ereg_replace
From: |
Sigurd Nes |
Subject: |
[Fmsystem-commits] [13920] convert from deprecated ereg and ereg_replace to preg_match and preg_replace |
Date: |
Tue, 15 Sep 2015 19:47:35 +0000 |
Revision: 13920
http://svn.sv.gnu.org/viewvc/?view=rev&root=fmsystem&revision=13920
Author: sigurdne
Date: 2015-09-15 19:47:34 +0000 (Tue, 15 Sep 2015)
Log Message:
-----------
convert from deprecated ereg and ereg_replace to preg_match and preg_replace
Modified Paths:
--------------
trunk/addressbook/csv_import.php
trunk/addressbook/inc/class.boXport.inc.php
trunk/addressbook/inc/class.ipc_addressbook.inc.php
trunk/addressbook/inc/class.uiXport.inc.php
trunk/addressbook/inc/class.uifields.inc.php
trunk/addressbook/inc/functions.inc.php
trunk/admin/inc/class.bolog.inc.php
trunk/admin/inc/class.uiconfig.inc.php
trunk/calendar/inc/class.bocalendar.inc.php
trunk/calendar/inc/class.boicalendar.inc.php
trunk/calendar/inc/class.uicalendar.inc.php
trunk/email/addressbook-js.php
trunk/email/inc/class.bocompose.inc.php
trunk/email/inc/class.bomessage.inc.php
trunk/email/inc/class.mail_dcom_base_sock.inc.php
trunk/email/inc/class.mail_dcom_imap_sock.inc.php
trunk/email/inc/class.mail_dcom_pop3_sock.inc.php
trunk/email/inc/class.mail_msg_base.inc.php
trunk/email/inc/class.mail_msg_display.inc.php
trunk/email/inc/class.spell.inc.php
trunk/email/inc/class.uijsaddressbook.inc.php
trunk/emailadmin/inc/class.imap_client.inc.php
trunk/felamimail/inc/class.uidisplay.inc.php
trunk/filemanager/inc/class.bofilemanager.inc.php
trunk/filemanager/inc/class.uifilemanager.inc.php
trunk/folders/phplayersmenu/lib/layersmenu-common.inc.php
trunk/ftp/inc/functions.inc.php
trunk/home.php
trunk/ipc_test_suite/sources/api/class.vcard.inc.php
trunk/ipc_test_suite/sources/app/class.ipc_addressbook.inc.php
trunk/ipc_test_suite/sources/app/class.ipc_calendar.inc.php
trunk/ipc_test_suite/sources/app/class.ipc_notes.inc.php
trunk/messenger/inc/class.somessenger_sql.inc.php
trunk/mobilefrontend/home.php
trunk/phpgwapi/inc/class.clientsniffer.inc.php
trunk/phpgwapi/inc/class.error.inc.php
trunk/phpgwapi/inc/class.gdbutton.inc.php
trunk/phpgwapi/inc/class.gdgraph.inc.php
trunk/phpgwapi/inc/class.http.inc.php
trunk/phpgwapi/inc/class.http_dav_client.inc.php
trunk/phpgwapi/inc/class.interserver.inc.php
trunk/phpgwapi/inc/class.log_message.inc.php
trunk/phpgwapi/inc/class.login.inc.php
trunk/phpgwapi/inc/class.menutree.inc.php
trunk/phpgwapi/inc/class.network.inc.php
trunk/phpgwapi/inc/class.schema_proc_oracle.inc.php
trunk/phpgwapi/inc/class.schema_proc_pgsql.inc.php
trunk/phpgwapi/inc/class.setup_html.inc.php
trunk/phpgwapi/inc/class.validator.inc.php
trunk/phpgwapi/inc/class.vfs_dav.inc.php
trunk/phpgwapi/inc/class.vfs_shared.inc.php
trunk/phpgwapi/inc/class.xml.inc.php
trunk/phpgwapi/inc/functions.inc.php
trunk/phpgwapi/inc/sso/create_account.php
trunk/phpgwapi/js/fckeditor/editor/filemanager/browser/default/connectors/php/connector.php
trunk/property/inc/class.bodocument.inc.php
trunk/property/inc/class.db_oci8.inc.php
trunk/registration/inc/class.boreg.inc.php
trunk/registration/main.php
trunk/soap/interop_harness.php
trunk/soap/test_methods.php
trunk/soap.php
trunk/todo/inc/class.botodo.inc.php
trunk/xmlrpc/server.php
trunk/xmlrpc.php
Modified: trunk/addressbook/csv_import.php
===================================================================
--- trunk/addressbook/csv_import.php 2015-09-15 11:45:38 UTC (rev 13919)
+++ trunk/addressbook/csv_import.php 2015-09-15 19:47:34 UTC (rev 13920)
@@ -299,14 +299,14 @@
$trans_csv =
$_POST['trans'][$csv_idx];
while(list($pattern,$replace) =
each($trans_csv))
{
- if(ereg((string)
$pattern,$val))
+
if(preg_match("/$pattern/",$val))
{
// echo
"<p>csv_idx='$csv_idx',info='$addr',trans_csv=".dump_array($trans_csv).",ereg_replace('$pattern','$replace','$val')
= ";
- $val =
ereg_replace((string) $pattern,str_replace($VPre,'\\',$replace),(string) $val);
+ $val =
preg_replace("/$pattern/",str_replace($VPre,'\\',$replace),(string) $val);
// echo
"'$val'</p>";
$reg =
$CPreReg.'([a-zA-Z_0-9]+)'.$CPosReg;
-
while(ereg($reg,$val,$vars))
+
while(preg_match("/$reg/",$val,$vars))
{ //
expand all CSV fields
$val =
str_replace($CPre . $vars[1] . $CPos, $val[0] == '@' ? "'"
. addslashes($fields[index($vars[1], $csv_fields)])
Modified: trunk/addressbook/inc/class.boXport.inc.php
===================================================================
--- trunk/addressbook/inc/class.boXport.inc.php 2015-09-15 11:45:38 UTC (rev
13919)
+++ trunk/addressbook/inc/class.boXport.inc.php 2015-09-15 19:47:34 UTC (rev
13920)
@@ -243,8 +243,8 @@
{
if ( substr($col,0,6) == 'extra_' )
{
- $field =
ereg_replace('extra_','',$col);
- $field = ereg_replace('
','_',$field);
+ $field =
preg_replace('/extra_/','',$col);
+ $field =
preg_replace('/ /','_',$field);
$customfields[$field] =
ucfirst($field);
}
}
Modified: trunk/addressbook/inc/class.ipc_addressbook.inc.php
===================================================================
--- trunk/addressbook/inc/class.ipc_addressbook.inc.php 2015-09-15 11:45:38 UTC
(rev 13919)
+++ trunk/addressbook/inc/class.ipc_addressbook.inc.php 2015-09-15 19:47:34 UTC
(rev 13920)
@@ -58,7 +58,7 @@
if($type != 'text/x-vcard')
return false;
- $data = ereg_replace("\n\n", "\r\n", $data);
+ $data = str_replace("\n\n", "\r\n", $data);
$data_lines = explode("\r\n", $data);
$buffer = array();
@@ -334,7 +334,7 @@
return false;
}
- $data = ereg_replace("\n\n", "\r\n", $data);
+ $data = str_replace("\n\n", "\r\n", $data);
$data_lines = explode("\r\n", $data);
$buffer = array();
Modified: trunk/addressbook/inc/class.uiXport.inc.php
===================================================================
--- trunk/addressbook/inc/class.uiXport.inc.php 2015-09-15 11:45:38 UTC (rev
13919)
+++ trunk/addressbook/inc/class.uiXport.inc.php 2015-09-15 19:47:34 UTC (rev
13920)
@@ -130,7 +130,7 @@
sort($myfilearray);
for ($i=0;$i<count($myfilearray);$i++)
{
- $fname = ereg_replace('_','
',$myfilearray[$i]);
+ $fname = preg_replace('/_/','
',$myfilearray[$i]);
$conv .= '<OPTION VALUE="' .
$myfilearray[$i].'">' . $fname . '</OPTION>';
}
@@ -249,7 +249,7 @@
sort($myfilearray);
for ($i=0;$i<count($myfilearray);$i++)
{
- $fname = ereg_replace('_','
',$myfilearray[$i]);
+ $fname = preg_replace('/_/','
',$myfilearray[$i]);
$conv .= ' <option
value="'.$myfilearray[$i].'">'.$fname.'</option>'."\n";
}
Modified: trunk/addressbook/inc/class.uifields.inc.php
===================================================================
--- trunk/addressbook/inc/class.uifields.inc.php 2015-09-15 11:45:38 UTC
(rev 13919)
+++ trunk/addressbook/inc/class.uifields.inc.php 2015-09-15 19:47:34 UTC
(rev 13920)
@@ -510,7 +510,7 @@
}
if($new)
{
- $tmp =
strtolower(ereg_replace(' ','_',$new));
+ $tmp =
strtolower(preg_replace('/ /','_',$new));
$this->config->config_data['custom_fields'][$tmp] = $new;
}
break;
@@ -533,7 +533,7 @@
}
if($new)
{
- $tmp =
strtolower(ereg_replace(' ','_',$new));
+ $tmp =
strtolower(preg_replace('/ /','_',$new));
$this->config->config_data['custom_org_fields'][$tmp] = $new;
}
break;
@@ -556,7 +556,7 @@
}
if($new)
{
- $tmp =
strtolower(ereg_replace(' ','_',$new));
+ $tmp =
strtolower(preg_replace('/ /','_',$new));
$this->config->config_data['custom_fields'][$tmp] = $new;
}
if(!is_array($this->config->config_data['custom_org_fields']))
@@ -571,7 +571,7 @@
}
if($new)
{
- $tmp =
strtolower(ereg_replace(' ','_',$new));
+ $tmp =
strtolower(preg_replace('/ /','_',$new));
$this->config->config_data['custom_org_fields'][$tmp] = $new;
}
break;
Modified: trunk/addressbook/inc/functions.inc.php
===================================================================
--- trunk/addressbook/inc/functions.inc.php 2015-09-15 11:45:38 UTC (rev
13919)
+++ trunk/addressbook/inc/functions.inc.php 2015-09-15 19:47:34 UTC (rev
13920)
@@ -139,8 +139,8 @@
{
if ( substr($col,0,6) == 'extra_' )
{
- $fields[$j]['name'] =
ereg_replace('extra_','',$col);
- $fields[$j]['name'] = ereg_replace('
','_',$fields[$j]['name']);
+ $fields[$j]['name'] =
preg_replace('/extra_/','',$col);
+ $fields[$j]['name'] = preg_replace('/
/','_',$fields[$j]['name']);
$fields[$j]['id'] = $i;
if ($query && ($fields[$j]['name'] != $query))
Modified: trunk/admin/inc/class.bolog.inc.php
===================================================================
--- trunk/admin/inc/class.bolog.inc.php 2015-09-15 11:45:38 UTC (rev 13919)
+++ trunk/admin/inc/class.bolog.inc.php 2015-09-15 19:47:34 UTC (rev 13920)
@@ -40,7 +40,7 @@
$GLOBALS['phpgw']->db->from_timestamp($record['log_date']),
$GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'] . ' -
H:i:s');
- if (ereg('@',$record['log_account_lid']))
+ if (
preg_match('/@/',$record['log_account_lid']))
{
$t =
split('@',$record['log_account_lid']);
$record['log_account_lid'] = $t[0];
Modified: trunk/admin/inc/class.uiconfig.inc.php
===================================================================
--- trunk/admin/inc/class.uiconfig.inc.php 2015-09-15 11:45:38 UTC (rev
13919)
+++ trunk/admin/inc/class.uiconfig.inc.php 2015-09-15 19:47:34 UTC (rev
13920)
@@ -116,7 +116,7 @@
else
{
/* don't erase passwords, since
we also don't print them */
- if(!ereg('passwd',$key) &&
!ereg('password',$key) && !ereg('root_pw',$key))
+ if(!
preg_match('/passwd/',$key) && ! preg_match('/password/',$key) && !
preg_match('/root_pw/',$key))
{
unset($c->config_data[$key]);
}
@@ -198,9 +198,9 @@
$t->set_var($value,$GLOBALS['phpgw']->translation->translate($newval,
array(),false, $appname));
break;
case 'value':
- $newval =
ereg_replace(' ','_',$newval);
+ $newval =
preg_replace('/ /','_',$newval);
/* Don't show passwords
in the form */
- if (
!isset($current_config[$newval]) || ereg('passwd',$value) ||
ereg('password',$value) || ereg('root_pw',$value))
+ if (
!isset($current_config[$newval]) || preg_match('/passwd/',$value) ||
preg_match('/password/',$value) || preg_match('/root_pw/',$value))
{
$t->set_var($value,'');
}
@@ -212,7 +212,7 @@
case 'checked':
/* '+' is used as a
delimiter for the check value */
list($newvalue,$check)
= split('\+',$newval);
- $newval =
ereg_replace(' ','_',$newvalue);
+ $newval =
preg_replace('/ /','_',$newvalue);
if($current_config[$newval] == $check)
{
$t->set_var($value, ' checked');
@@ -244,7 +244,7 @@
}
break;
case 'hook':
- $newval =
ereg_replace(' ','_',$newval);
+ $newval =
preg_replace('/ /','_',$newval);
if(function_exists($newval))
{
$t->set_var($value,$newval($current_config));
Modified: trunk/calendar/inc/class.bocalendar.inc.php
===================================================================
--- trunk/calendar/inc/class.bocalendar.inc.php 2015-09-15 11:45:38 UTC (rev
13919)
+++ trunk/calendar/inc/class.bocalendar.inc.php 2015-09-15 19:47:34 UTC (rev
13920)
@@ -182,7 +182,7 @@
}
//_debug_array($owner);
$referer = isset($_SERVER['HTTP_REFERER']) ?
$_SERVER['HTTP_REFERER'] : '';
- ereg('menuaction=([a-zA-Z.]+)', $referer, $regs);
+ preg_match('/menuaction=([a-zA-Z.]+)/', $referer,
$regs);
$from = $regs[1];
if ((substr($_SERVER['PHP_SELF'],-8) == 'home.php' &&
substr($this->prefs['calendar']['defaultcalendar'],0,7) == 'planner'
|| (
isset($GLOBALS['phpgw_info']['menuaction']) &&
$GLOBALS['phpgw_info']['menuaction'] == 'calendar.uicalendar.planner')
Modified: trunk/calendar/inc/class.boicalendar.inc.php
===================================================================
--- trunk/calendar/inc/class.boicalendar.inc.php 2015-09-15 11:45:38 UTC
(rev 13919)
+++ trunk/calendar/inc/class.boicalendar.inc.php 2015-09-15 19:47:34 UTC
(rev 13920)
@@ -1617,7 +1617,7 @@
{
$str = str_replace("\r\n",'',$ical_text[$this->line]);
$this->line = $this->line + 1;
- while(ereg("^[[:space:]]",$ical_text[$this->line]))
+
while(preg_match("/^[[:space:]]/",$ical_text[$this->line]))
{
$str .=
substr(str_replace("\r\n",'',$ical_text[$this->line]),1);
$this->line = $this->line + 1;
@@ -1744,7 +1744,8 @@
function parse_parameters(&$event,$majortype,$value)
{
- if(!ereg('[\=\;]',$value))
+// if(!ereg('[\=\;]',$value))
+ if(!preg_match('/[\=\;]/',$value))
{
$return_value[] = array(
'param' => $majortype,
@@ -1752,7 +1753,8 @@
);
$value = '';
}
- elseif(ereg('(.*(\:\\\\)?.*):(.*)',$value,$temp))
+// elseif(ereg('(.*(\:\\\\)?.*):(.*)',$value,$temp))
+ elseif(preg_match('/(.*(\:\\\\)?.*):(.*)/',$value,$temp))
{
$this->debug('Value : '._debug_array($temp,false));
$this->debug('Param '.$majortype.' Value : '.$temp[3]);
@@ -1764,7 +1766,8 @@
);
$value = str_replace(':MAILTO','',$temp[1]);
}
- while(ereg('(([A-Z\-]*)[=]([[:alnum:]
\_\)\(\/\$\.\,\:\\\|\*\&\^\%\#\!\~\"\?\&address@hidden<\>\-]*))([\;]?)(.*)',$value,$temp))
+// while(ereg('(([A-Z\-]*)[=]([[:alnum:]
\_\)\(\/\$\.\,\:\\\|\*\&\^\%\#\!\~\"\?\&address@hidden<\>\-]*))([\;]?)(.*)',$value,$temp))
+ while(preg_match('/(([A-Z\-]*)[=]([[:alnum:]
\_\)\(\\/\$\.\,\:\\\|\*\&\^\%\#\!\~\"\?\&address@hidden<\>\-]*))([\;]?)(.*)/',$value,$temp))
{
$this->debug('Value :
'._debug_array($temp,false));
$this->debug('Param '.$temp[2].' Value :
'.$temp[3]);
@@ -1778,7 +1781,8 @@
}
else
{
- while(ereg('(([A-Z\-]*)[=]([[:alnum:]
\_\)\(\/\$\.\,\:\\\|\*\&\^\%\#\!\~\"\?\&address@hidden<\>\-]*))([\;]?)(.*)',$value,$temp))
+// while(ereg('(([A-Z\-]*)[=]([[:alnum:]
\_\)\(\/\$\.\,\:\\\|\*\&\^\%\#\!\~\"\?\&address@hidden<\>\-]*))([\;]?)(.*)',$value,$temp))
+ while(preg_match('/(([A-Z\-]*)[=]([[:alnum:]
\_\)\(\\/\$\.\,\:\\\|\*\&\^\%\#\!\~\"\?\&address@hidden<\>\-]*))([\;]?)(.*)/',$value,$temp))
{
$this->debug('Value :
'._debug_array($temp,false));
$this->debug('Param '.$temp[2].' Value :
'.$temp[3]);
@@ -2961,7 +2965,7 @@
// continue;
// }
- ereg($property_regexp,$text,$temp);
+ preg_match("/$property_regexp/",$text,$temp);
$majortype = str_replace('-','_',strtolower($temp[1]));
$value = utf8_decode(chop($temp[2]));
Modified: trunk/calendar/inc/class.uicalendar.inc.php
===================================================================
--- trunk/calendar/inc/class.uicalendar.inc.php 2015-09-15 11:45:38 UTC (rev
13919)
+++ trunk/calendar/inc/class.uicalendar.inc.php 2015-09-15 19:47:34 UTC (rev
13920)
@@ -3246,7 +3246,7 @@
$vars['title']['tr_color'] = $this->theme['th_bg'];
foreach($vars['participants']['data'] as $user => $str)
{
- if
($this->bo->check_perms(PHPGW_ACL_EDIT,0,$user) && ereg('^(.*)
\((.*)\)$',$str,$parts))
+ if
($this->bo->check_perms(PHPGW_ACL_EDIT,0,$user) && preg_match('/^(.*)
\((.*)\)$/',$str,$parts))
{
$vars['participants']['data'][$user] =
$parts[1].' (<a
href="'.$this->page('edit_status',array('cal_id'=>$event['id'],'owner'=>$user)).'">'.$parts[2].'</a>)';
}
Modified: trunk/email/addressbook-js.php
===================================================================
--- trunk/email/addressbook-js.php 2015-09-15 11:45:38 UTC (rev 13919)
+++ trunk/email/addressbook-js.php 2015-09-15 19:47:34 UTC (rev 13920)
@@ -273,7 +273,7 @@
$GLOBALS['phpgw']->template->set_var('cats_list',
- ereg_replace( ' <' .
lang('Global') . ' ' . lang($c->app_name) . '>',
+ str_replace(
' <' . lang('Global') . ' ' . lang($c->app_name) . '>',
"",
$catlist
)
Modified: trunk/email/inc/class.bocompose.inc.php
===================================================================
--- trunk/email/inc/class.bocompose.inc.php 2015-09-15 11:45:38 UTC (rev
13919)
+++ trunk/email/inc/class.bocompose.inc.php 2015-09-15 19:47:34 UTC (rev
13920)
@@ -229,7 +229,7 @@
// we need *some* line breaks in the
body so we know where to add the ">" quoting char(s)
// some relatively short emails may not
have any CRLF pairs, but may have a few real long lines
//so, add linebreaks to the body if
none are already existing
- if (!ereg("\r\n", $bodystring))
+ if (!preg_match("/[\n|\r]/",
$bodystring ))
{
// aim for a 74-80 char line
length
$bodystring =
$GLOBALS['phpgw']->msg->body_hard_wrap($bodystring, 74);
@@ -357,7 +357,7 @@
$my_reply_plain =
$my_reply->mailbox.'@'.$my_reply->host;
// sometimes, the "To:" and the
"Reply-To: / From" are the same, such as with mailing lists
- if
(!ereg(".*$my_reply_plain.*", $to))
+ if
(!preg_match("/.*$my_reply_plain.*/", $to))
{
// it's ok to add
$from_or_reply_to, it is not a duplicate
$my_reply_addr_spec =
$GLOBALS['phpgw']->msg->make_rfc2822_address($my_reply);
Modified: trunk/email/inc/class.bomessage.inc.php
===================================================================
--- trunk/email/inc/class.bomessage.inc.php 2015-09-15 11:45:38 UTC (rev
13919)
+++ trunk/email/inc/class.bomessage.inc.php 2015-09-15 19:47:34 UTC (rev
13920)
@@ -858,7 +858,7 @@
if ($list_of_files != '')
{
// get rid of the last ", "
- $list_of_files = ereg_replace(",.$", "",
$list_of_files);
+ $list_of_files = preg_replace("/,.$/", "",
$list_of_files);
$this->xi['list_of_files'] = $list_of_files;
//$GLOBALS['phpgw']->template->parse('V_attach_list','B_attach_list');
}
@@ -1468,8 +1468,8 @@
//echo
'part_href (processed): ' .$part_href .'<br />';
// strip < and
> from this ID
- $replace_id =
ereg_replace( '^<','',$replace_id);
- $replace_id =
ereg_replace( '>$','',$replace_id);
+ $replace_id =
preg_replace( '/^</','',$replace_id);
+ $replace_id =
preg_replace( '/>$/','',$replace_id);
// id
references are typically preceeded with "cid:"
$replace_id =
'cid:' .$replace_id;
@@ -1736,7 +1736,7 @@
//}
$dsp =
$GLOBALS['phpgw']->msg->make_clickable($dsp,
$GLOBALS['phpgw']->msg->get_arg_value('["msgball"]["folder"]'));
// (OPT 2) THIS
CONVERTS UNFORMATTED TEXT TO *VERY* SIMPLE HTML - adds only <br />
- $dsp =
ereg_replace("\r\n","<br />",$dsp);
+ $dsp = nl2br($dsp,
true);
// add a line after the
last line of the message
$dsp = $dsp .'<br /><br
/>';
// alternate (toggle)
to view unformatted, for this we add "&no_fmt=1" to the URL
Modified: trunk/email/inc/class.mail_dcom_base_sock.inc.php
===================================================================
--- trunk/email/inc/class.mail_dcom_base_sock.inc.php 2015-09-15 11:45:38 UTC
(rev 13919)
+++ trunk/email/inc/class.mail_dcom_base_sock.inc.php 2015-09-15 19:47:34 UTC
(rev 13920)
@@ -762,9 +762,9 @@
break;
}
$header[$key] = $value;
- if (ereg('^multipart/mixed;',$value))
+ if (preg_match('/^multipart/mixed;/',$value))
{
- if (! ereg('boundary',$header[$key]))
+ if (! preg_match('/boundary/',$header[$key]))
{
if ($line2 == 'True')
{
@@ -1123,7 +1123,7 @@
*/
function decode_base64($string)
{
- $string = ereg_replace("'", "\'", $string);
+ $string = str_replace("'", "\'", $string);
$string =
preg_replace("/\=\?(.*?)\?b\?(.*?)\?\=/ieU",base64_decode("\\2"),$string);
return $string;
}
@@ -1137,7 +1137,7 @@
*/
function decode_qp($string)
{
- $string = ereg_replace("'", "\'", $string);
+ $string = str_replace("'", "\'", $string);
$string =
preg_replace("/\=\?(.*?)\?q\?(.*?)\?\=/ieU",$this->phpGW_quoted_printable_decode2("\\2"),$string);
return $string;
}
@@ -1181,13 +1181,13 @@
*/
/* 1st case */
//if (eregi("(.*) <(address@hidden)>",
- if (eregi("(.*) <(address@hidden)>",$author, $regs))
+ if (preg_match("/(.*) <(address@hidden)>/i",$author,
$regs))
{
$email = $regs[2];
$name = $regs[1];
}
/* 2nd case */
- elseif (eregi("(address@hidden) ((.*))",$author, $regs))
+ elseif (preg_match("/(address@hidden)
((.*))/i",$author, $regs))
{
//if (eregi("(address@hidden) \((.*)\)",$author, $regs))
$email = $regs[1];
@@ -1202,8 +1202,8 @@
{
$name = $email;
}
- $name = eregi_replace("^\"(.*)\"$", "\\1", $name);
- $name = eregi_replace("^\((.*)\)$", "\\1", $name);
+ $name = preg_replace("/^\"(.*)\"$", "\\1/i", $name);
+ $name = preg_replace("/^\((.*)\)$", "\\1/i", $name);
}
// OBSOLETED ?
Modified: trunk/email/inc/class.mail_dcom_imap_sock.inc.php
===================================================================
--- trunk/email/inc/class.mail_dcom_imap_sock.inc.php 2015-09-15 11:45:38 UTC
(rev 13919)
+++ trunk/email/inc/class.mail_dcom_imap_sock.inc.php 2015-09-15 19:47:34 UTC
(rev 13920)
@@ -1205,17 +1205,17 @@
while(chop($response)!='')
{
if ($this->debug_dcom >= 2) { echo
'imap: fetch_header: Response = '.$response."<br />\r\n"; }
- if(ereg('^\*',$response))
+ if(preg_match('/^\*/',$response))
{
$field = explode(' ',$response);
$msg_num = $field[1];
}
- if(ereg('^'.$element,$response))
+ if(preg_match("/^$element/",$response))
{
$field_element[$msg_num] =
$this->phpGW_quoted_printable_decode2(substr($response,strlen($element)+1));
if ($this->debug_dcom >= 2) {
echo 'imap: fetch_header: <b>Field:</b> '.$field_element[$msg_num]."\t = <b>Msg
Num</b> ".$msg_num."<br />\r\n"; }
}
-
elseif(ereg('^'.strtoupper($element),$response))
+
elseif(preg_match('/^'.strtoupper($element).'/',$response))
{
$field_element[$msg_num] =
$this->phpGW_quoted_printable_decode2(substr($response,strlen(strtoupper($element))+1));
if ($this->debug_dcom >= 2) {
echo 'imap: fetch_header: <b>Field:</b> '.$field_element[$msg_num]."\t = <b>Msg
Num</b> ".$msg_num."<br />\r\n"; }
@@ -1242,7 +1242,7 @@
$this->error();
}
$response = $this->read_port();
- while(!ereg('FETCH completed',$response))
+ while(!preg_match('/FETCH completed/',$response))
{
//echo 'Response = '.$response."<br />\n";
$field = explode(' ',$response);
Modified: trunk/email/inc/class.mail_dcom_pop3_sock.inc.php
===================================================================
--- trunk/email/inc/class.mail_dcom_pop3_sock.inc.php 2015-09-15 11:45:38 UTC
(rev 13919)
+++ trunk/email/inc/class.mail_dcom_pop3_sock.inc.php 2015-09-15 19:47:34 UTC
(rev 13920)
@@ -1825,7 +1825,7 @@
}
$addr_details->mailbox =
substr($addr_details->adl,0,$pos3);
$addr_details->host =
substr($addr_details->adl,$pos3+1);
- $pos = ereg("\"",$addr_details->personal);
+ $pos =
preg_match('/\"/',$addr_details->personal);
if ($pos)
{
$addr_details->personal =
substr($addr_details->personal,1,strlen($addr_details->personal)-2);
Modified: trunk/email/inc/class.mail_msg_base.inc.php
===================================================================
--- trunk/email/inc/class.mail_msg_base.inc.php 2015-09-15 11:45:38 UTC (rev
13919)
+++ trunk/email/inc/class.mail_msg_base.inc.php 2015-09-15 19:47:34 UTC (rev
13920)
@@ -3300,7 +3300,7 @@
for ($i=0; $i<count($ignore_these_folders); $i++)
{
$match_this = $ignore_these_folders[$i];
- if (eregi("^.*$match_this$",$folder))
+ if (preg_match("/^.*$match_this$/i",$folder))
{
$we_care = False;
break;
@@ -3552,9 +3552,9 @@
// i.e. the compose page uses html entities
when filling the To: box with a predefined value
$data = $this->htmlspecialchars_decode($data);
//reduce all multiple spaces to just one space
- //$data = ereg_replace("[' ']{2,20}", ' ',
$data);
+ //$data = preg_replace("/[' ']{2,20}/", ' ',
$data);
$this_space = " ";
- $data = ereg_replace("$this_space{2,20}", " ",
$data);
+ $data = preg_replace("/$this_space{2,20}/", "
", $data);
// explode into an array of email addys
//$data = explode(",", $data);
@@ -3696,7 +3696,7 @@
// ESCAPE SPECIALS: rfc2822
requires the "personal" comment string to escape "specials" inside the quotes
// the non-simple (i.e.
"personal" info is included) need special escaping
// escape these: ' " ( )
- $addy_array[$i]['personal'] =
ereg_replace('\'', "\\'", $addy_array[$i]['personal']);
+ $addy_array[$i]['personal'] =
str_replace('\'', "\\'", $addy_array[$i]['personal']);
$addy_array[$i]['personal'] =
str_replace('"', '\"', $addy_array[$i]['personal']);
$addy_array[$i]['personal'] =
str_replace("(", "\(", $addy_array[$i]['personal']);
$addy_array[$i]['personal'] =
str_replace(")", "\)", $addy_array[$i]['personal']);
@@ -3758,7 +3758,7 @@
$addy_string = $addy_string
.trim($data[$i]['plain']) .',';
}
// catch any situations where a blank string
was included, resulting in two commas with nothing inbetween
- $addy_string = ereg_replace("[,]{2}", ',',
$addy_string);
+ $addy_string = preg_replace("/[,]{2}/", ',',
$addy_string);
// trim again, strlen needs to be accurate
without trailing spaces included
$addy_string = trim($addy_string);
// eliminate that final comma
@@ -3843,9 +3843,9 @@
function normalize_crlf($data)
{
// this is to catch all plain \n instances and replace
them with \r\n.
- $data = ereg_replace("\r\n", "\n", $data);
- $data = ereg_replace("\r", "\n", $data);
- $data = ereg_replace("\n", "\r\n", $data);
+ $data = str_replace("\r\n", "\n", $data);
+ $data = str_replace("\r", "\n", $data);
+ $data = str_replace("\n", "\r\n", $data);
//$data = preg_replace("/(?<!\r)\n/m", "\r\n", $data);
//$data = preg_replace("/\r(?!\n)/m", "\r\n", $data);
@@ -4143,16 +4143,16 @@
// non-us-ascii chars in email headers MUST be encoded
using the special format:
// =?charset?Q?word?=
// currently only qprint and base64 encoding is
specified by RFCs
- if (ereg("=\?.*\?(Q|q)\?.*\?=", $data))
+ if (preg_match("/=\?.*\?(Q|q)\?.*\?=/", $data))
{
- $data = ereg_replace("=\?.*\?(Q|q)\?", '',
$data);
- $data = ereg_replace("\?=", '', $data);
+ $data = preg_replace("/=\?.*\?(Q|q)\?/", '',
$data);
+ $data = preg_replace("/\?=/", '', $data);
$data = $this->qprint(str_replace("_","
",$data));
}
- if (ereg("=\?.*\?(B|b)\?.*\?=", $data))
+ if (preg_match("/=\?.*\?(B|b)\?.*\?=/", $data))
{
- $data = ereg_replace("=\?.*\?(B|b)\?", '',
$data);
- $data = ereg_replace("\?=", '', $data);
+ $data = preg_replace("/=\?.*\?(B|b)\?/", '',
$data);
+ $data = preg_replace("/\?=/", '', $data);
$data = urldecode(base64_decode($data));
}
return $data;
@@ -4469,13 +4469,13 @@
function htmlspecialchars_encode($str)
{
/*// replace ' and " with htmlspecialchars */
- $str = ereg_replace('&', '&', $str);
+ $str = str_replace('&', '&', $str);
// any ampersand & that ia already in a "&" should
NOT be encoded
//$str = preg_replace("/&(?![:alnum:]*;)/", "&",
$str);
- $str = ereg_replace('"', '"', $str);
- $str = ereg_replace('\'', ''', $str);
- $str = ereg_replace('<', '<', $str);
- $str = ereg_replace('>', '>', $str);
+ $str = str_replace('"', '"', $str);
+ $str = str_replace('\'', ''', $str);
+ $str = str_replace('<', '<', $str);
+ $str = str_replace('>', '>', $str);
// these { and } must be html encoded or else they
conflict with the template system
$str = str_replace("{", '{', $str);
$str = str_replace("}", '}', $str);
@@ -4499,11 +4499,11 @@
$str = str_replace('}', "}", $str);
$str = str_replace('{', "{", $str);
- $str = ereg_replace('>', '>', $str);
- $str = ereg_replace('<', '<', $str);
- $str = ereg_replace(''', '\'', $str);
- $str = ereg_replace('"', '"', $str);
- $str = ereg_replace('&', '&', $str);
+ $str = str_replace('>', '>', $str);
+ $str = str_replace('<', '<', $str);
+ $str = str_replace(''', '\'', $str);
+ $str = str_replace('"', '"', $str);
+ $str = str_replace('&', '&', $str);
return $str;
}
@@ -4538,14 +4538,14 @@
// encode database unfriendly chars as html entities
// it'll work for now, and it can be easily un-done
later when real DB classes take care of this issue
// replace ' and " with htmlspecialchars
- $str = ereg_replace('"', '"', $str);
- $str = ereg_replace('\'', ''', $str);
+ $str = str_replace('"', '"', $str);
+ $str = str_replace('\'', ''', $str);
// replace , (comma)
- $str = ereg_replace(',', ',', $str);
+ $str = str_replace(',', ',', $str);
// replace / (forward slash)
- $str = ereg_replace('/', '/', $str);
+ $str = str_replace('/', '/', $str);
// replace \ (back slash)
- $str = ereg_replace("\\\\", '\', $str);
+ $str = str_replace("\\", '\', $str);
return $str;
}
@@ -4576,15 +4576,15 @@
// == "poor-man's" database compatibility ==
// reverse of html_quotes_encode - html specialchar
convert to actual ascii char
// backslash \
- $str = ereg_replace('\', "\\", $str);
+ $str = str_replace('\', "\\", $str);
// forward slash /
- $str = ereg_replace('/', '/', $str);
+ $str = str_replace('/', '/', $str);
// comma ,
- $str = ereg_replace(',', ',', $str);
+ $str = str_replace(',', ',', $str);
// single quote '
- $str = ereg_replace(''', '\'', $str);
+ $str = str_replace(''', '\'', $str);
// double quote "
- $str = ereg_replace('"', '"', $str);
+ $str = str_replace('"', '"', $str);
return $str;
}
@@ -4609,16 +4609,16 @@
function ensure_one_urlencoding($str='')
{
// check for things we know should not exist in a
URLENCODED string
- if ( (ereg('"', $str))
- || (ereg('\'', $str))
+ if ( (preg_match('/"/', $str))
+ || (preg_match('/\'/', $str))
// check for , (comma)
- || (ereg(',', $str))
+ || (preg_match('/,/', $str))
// check for / (forward slash)
- || (ereg('/', $str))
+ || (preg_match('/\//', $str))
// check for \ (back slash)
- || (ereg("\\\\", $str))
- || (ereg('~', $str))
- || (ereg(' ', $str))
+ || (preg_match("/\\\\/", $str))
+ || (preg_match('/~/', $str))
+ || (preg_match('/ /', $str))
)
{
return urlencode($str);
@@ -4855,7 +4855,7 @@
return False;
}
elseif ((is_string($data))
- && (ereg('^s:[0-9]+:"',$data) == True))
+ && (preg_match('/^s:[0-9]+:"/',$data) == True))
{
// identify pattern of a serialized string
(that did NOT have slashes added AFTER serialization )
return True;
@@ -4864,7 +4864,7 @@
&& (is_array(unserialize($data))))
{
// if unserialization produces an array out of
a string, it was serialized
- //(ereg('^a:[0-9]+:\{',$data) == True)) also
could work
+ //(preg_match('/^a:[0-9]+:\{/',$data) == True))
also could work
return True;
}
//Best Guess - UNKNOWN / ERROR / NOY YET SUPPORTED TYPE
Modified: trunk/email/inc/class.mail_msg_display.inc.php
===================================================================
--- trunk/email/inc/class.mail_msg_display.inc.php 2015-09-15 11:45:38 UTC
(rev 13919)
+++ trunk/email/inc/class.mail_msg_display.inc.php 2015-09-15 19:47:34 UTC
(rev 13920)
@@ -2356,13 +2356,13 @@
while ( list ($key,$line) = each ($lines))
{
- $line = eregi_replace("([ \t]|^)www\.","
http://www.",$line);
- $line = eregi_replace("([ \t]|^)ftp\.","
ftp://ftp.",$line);
- $line = eregi_replace("(http://[^ )\r\n]+)","<A
href=\"\\1\" target=\"_new\">\\1</A>",$line);
- $line = eregi_replace("(https://[^ )\r\n]+)","<A
href=\"\\1\" target=\"_new\">\\1</A>",$line);
- $line = eregi_replace("(ftp://[^ )\r\n]+)","<A
href=\"\\1\" target=\"_new\">\\1</A>",$line);
- $line = eregi_replace("(irc://[^ )\r\n]+)","<A
href=\"\\1\">\\1</A>",$line);//added by skwashd for chatzilla :)
- $line =
eregi_replace("([-a-z0-9_]+(\.[_a-z0-9-]+)*@([a-z0-9-]+(\.[a-z0-9-]+)+))",
+ $line = preg_replace("/([ \t]|^)www\./i","
http://www.",$line);
+ $line = preg_replace("/([ \t]|^)ftp\./'","
ftp://ftp.",$line);
+ $line = preg_replace("/(http:\/\/[^ )\r\n]+)/i","<A
href=\"\\1\" target=\"_new\">\\1</A>",$line);
+ $line = preg_replace("/(https:\/\/[^ )\r\n]+)/i","<A
href=\"\\1\" target=\"_new\">\\1</A>",$line);
+ $line = preg_replace("/(ftp:\/\/[^ )\r\n]+)/i","<A
href=\"\\1\" target=\"_new\">\\1</A>",$line);
+ $line = preg_replace("/(irc:\/\/[^ )\r\n]+)/i","<A
href=\"\\1\">\\1</A>",$line);//added by skwashd for chatzilla :)
+ $line =
preg_replace("/([-a-z0-9_]+(\.[_a-z0-9-]+)*@([a-z0-9-]+(\.[a-z0-9-]+)+))/i",
"<a
href=\"".$GLOBALS['phpgw']->link("/".$GLOBALS['phpgw_info']['flags']['currentapp']."/compose.php",array('folder'=>$this->prep_folder_out($folder)))
."&to=\\1\">\\1</a>", $line);
@@ -3063,12 +3063,12 @@
if($GLOBALS['phpgw']->common->show_date($hdr_envelope->udate,'Ymd') !=
date('Ymd'))
{
// this strips the time part, leaving only the
date, better for single line TD cells
- $msg_list_display[$x]['msg_date'] =
ereg_replace(" - .*$", '', $msg_date_time);
+ $msg_list_display[$x]['msg_date'] =
preg_replace("/ - .*$/", '', $msg_date_time);
}
else
{
// this strips the time part, leaving only the
date, better for single line TD cells
- $msg_list_display[$x]['msg_date'] =
ereg_replace("^.* -", '', $msg_date_time);
+ $msg_list_display[$x]['msg_date'] =
preg_replace("/^.* -/", '', $msg_date_time);
}
// *raw* date for utility purposes, such as appending
and specifying a date
// php built in append does not let you specify the
data during an append
Modified: trunk/email/inc/class.spell.inc.php
===================================================================
--- trunk/email/inc/class.spell.inc.php 2015-09-15 11:45:38 UTC (rev 13919)
+++ trunk/email/inc/class.spell.inc.php 2015-09-15 19:47:34 UTC (rev 13920)
@@ -453,7 +453,8 @@
$body_display =
$GLOBALS['phpgw']->msg->htmlspecialchars_encode($body_display);
// 2) convert linebreaks to <br /> tags
//$body_display =
ereg_replace("\r\n","_CRLF_",$body_display);
- $body_display = ereg_replace("\r\n","<br
/>",$body_display);
+ //$body_display = ereg_replace("\r\n","<br
/>",$body_display);
+ $body_display = nl2br($body_display, true);
return $body_display;
}
@@ -1034,7 +1035,7 @@
$this->body_with_suggest .=
$this_line_str."\r\n";
}
- $this->body_with_suggest = ereg_replace("\r\n","<br
/>",$this->body_with_suggest);
+ $this->body_with_suggest =
nl2br($this->body_with_suggest,true);
$GLOBALS['phpgw']->template->set_var('body_with_suggestions',
$this->body_with_suggest);
// BUTTONS
Modified: trunk/email/inc/class.uijsaddressbook.inc.php
===================================================================
--- trunk/email/inc/class.uijsaddressbook.inc.php 2015-09-15 11:45:38 UTC
(rev 13919)
+++ trunk/email/inc/class.uijsaddressbook.inc.php 2015-09-15 19:47:34 UTC
(rev 13920)
@@ -569,7 +569,7 @@
//We get it from the category class and ...
$this->categoryobject=CreateObject('phpgwapi.categories');
$this->categoryobject->app_name = 'addressbook';
- $this->catlist=ereg_replace( ' <' .
lang('Global') . ' ' . lang($this->categoryobject->app_name).'>'
+ $this->catlist= str_replace( ' <' .
lang('Global') . ' ' . lang($this->categoryobject->app_name).'>'
,'',$this->categoryobject->formated_list('select','all',$this->cat_id,'True'));
//....save it in the cache
//
$GLOBALS['phpgw']->session->appsession('jsuibook_catlist','email',$catlist);
Modified: trunk/emailadmin/inc/class.imap_client.inc.php
===================================================================
--- trunk/emailadmin/inc/class.imap_client.inc.php 2015-09-15 11:45:38 UTC
(rev 13919)
+++ trunk/emailadmin/inc/class.imap_client.inc.php 2015-09-15 19:47:34 UTC
(rev 13920)
@@ -726,7 +726,7 @@
return $read;
}
- if (eregi('\\* NAMESPACE +(\\( *\\(.+\\) *\\)|NIL) +(\\( *\\(.+\\)
*\\)|NIL) +(\\( *\\(.+\\) *\\)|NIL)', $read[0], $data)) {
+ if (preg_match('/\\* NAMESPACE +(\\( *\\(.+\\) *\\)|NIL) +(\\(
*\\(.+\\) *\\)|NIL) +(\\( *\\(.+\\) *\\)|NIL)/i', $read[0], $data)) {
for ($i = 1; $i <= 3; $i++) {
if ($data[$i] == 'NIL') {
continue;
Modified: trunk/felamimail/inc/class.uidisplay.inc.php
===================================================================
--- trunk/felamimail/inc/class.uidisplay.inc.php 2015-09-15 11:45:38 UTC
(rev 13919)
+++ trunk/felamimail/inc/class.uidisplay.inc.php 2015-09-15 19:47:34 UTC
(rev 13920)
@@ -135,7 +135,7 @@
$addresses = array();
/* Find all the email addresses in the body */
- while(eregi($Email_RegExp_Match, $sbody, $regs)) {
+ while(preg_match("/$Email_RegExp_Match/i", $sbody,
$regs)) {
$addresses[$regs[0]] = strtr($regs[0],
array('&' => '&'));
$start = strpos($sbody, $regs[0]) +
strlen($regs[0]);
$sbody = substr($sbody, $start);
Modified: trunk/filemanager/inc/class.bofilemanager.inc.php
===================================================================
--- trunk/filemanager/inc/class.bofilemanager.inc.php 2015-09-15 11:45:38 UTC
(rev 13919)
+++ trunk/filemanager/inc/class.bofilemanager.inc.php 2015-09-15 19:47:34 UTC
(rev 13920)
@@ -684,7 +684,7 @@
$result[] = lang('file names cannot
contain %1', $badchar);
}
- if (ereg ("/", $to) || ereg ("\\\\", $to))
+ if (preg_match ("/\//", $to) || ereg ("/\\\\/",
$to))
{
//echo
$GLOBALS['phpgw']->common->error_list (array ("File names cannot contain \\ or
/"));
$result[] = lang('file names cannot
contain \\ or /');
@@ -1183,9 +1183,9 @@
{
$rstring =
preg_replace("/=(.*)(&|$)/Ue","'='.rawurlencode(base64_encode
('\\1')).'\\2'",$string);
}
- elseif (ereg('^'.$this->hostname,$string))
+ elseif (preg_match("/^{$this->hostname}/",$string))
{
- $rstring =
ereg_replace('^'.$this->hostname.'/','',$string);
+ $rstring =
str_replace("{$this->hostname}/",'',$string, 1);
$rstring =
preg_replace("/(.*)(\/|$)/Ue","rawurlencode (base64_encode
('\\1')).'\\2'",$rstring);
$rstring = $this->hostname.'/'.$rstring;
}
Modified: trunk/filemanager/inc/class.uifilemanager.inc.php
===================================================================
--- trunk/filemanager/inc/class.uifilemanager.inc.php 2015-09-15 11:45:38 UTC
(rev 13919)
+++ trunk/filemanager/inc/class.uifilemanager.inc.php 2015-09-15 19:47:34 UTC
(rev 13920)
@@ -1432,7 +1432,7 @@
if ($_POST['save'])
{
- if (empty($val) || ereg("^[ 0-9]+(,[
0-9]+)*$",$val))
+ if (empty($val) || preg_match("/^[ 0-9]+(,[
0-9]+)*$/",$val))
{
$this->config->value('set_quota', '0,'
. $val . ',unlimited');
}
Modified: trunk/folders/phplayersmenu/lib/layersmenu-common.inc.php
===================================================================
--- trunk/folders/phplayersmenu/lib/layersmenu-common.inc.php 2015-09-15
11:45:38 UTC (rev 13919)
+++ trunk/folders/phplayersmenu/lib/layersmenu-common.inc.php 2015-09-15
19:47:34 UTC (rev 13920)
@@ -360,7 +360,7 @@
}
$this->menuStructure = "";
while ($buffer = fgets($fd, 4096)) {
- $buffer = ereg_replace(chr(13), "", $buffer); // Microsoft
Stupidity Suppression
+ $buffer = str_replace(chr(13), "", $buffer); // Microsoft
Stupidity Suppression
$this->menuStructure .= $buffer;
}
fclose($fd);
@@ -378,7 +378,7 @@
* @return boolean
*/
function setMenuStructureString($tree_string) {
- $this->menuStructure = ereg_replace(chr(13), "", $tree_string); //
Microsoft Stupidity Suppression
+ $this->menuStructure = str_replace(chr(13), "", $tree_string); //
Microsoft Stupidity Suppression
if ($this->menuStructure == "") {
$this->error("setMenuStructureString: empty string.");
return false;
@@ -669,7 +669,7 @@
for ($cnt=$this->_firstItem[$menu_name];
$cnt<=$this->_lastItem[$menu_name]; $cnt++) { // this counter scans all nodes
of the new menu
$this->tree[$cnt]["child_of_root_node"] =
($this->tree[$cnt]["level"] == 1);
$this->tree[$cnt]["parsed_text"] =
stripslashes($this->tree[$cnt]["text"]);
- $this->tree[$cnt]["parsed_href"] = (ereg_replace(" ", "",
$this->tree[$cnt]["href"]) == "") ? "#" : $this->prependedUrl .
$this->tree[$cnt]["href"];
+ $this->tree[$cnt]["parsed_href"] = (str_replace(" ", "",
$this->tree[$cnt]["href"]) == "") ? "#" : $this->prependedUrl .
$this->tree[$cnt]["href"];
$this->tree[$cnt]["parsed_title"] = ($this->tree[$cnt]["title"]
== "") ? "" : " title=\"" . addslashes($this->tree[$cnt]["title"]) . "\"";
$fooimg = $this->imgdir . $this->tree[$cnt]["icon"];
if ($this->tree[$cnt]["icon"] == "" || !(file_exists($fooimg)))
{
Modified: trunk/ftp/inc/functions.inc.php
===================================================================
--- trunk/ftp/inc/functions.inc.php 2015-09-15 11:45:38 UTC (rev 13919)
+++ trunk/ftp/inc/functions.inc.php 2015-09-15 19:47:34 UTC (rev 13920)
@@ -184,9 +184,9 @@
for($i=0;$i<sizeof($contents);$i++)
{
- if (! ereg("^#",$contents[$i]))
+ if (!preg_match("/^#/",$contents[$i]))
{
- $line=split("[[:space:]]+", $contents[$i]);
+ $line=preg_split("/[[:space:]]+/",
$contents[$i]);
if (sizeof($line) >= 2)
{
for($j=1;$j<sizeof($line);$j++)
@@ -235,7 +235,7 @@
function analysedir($dirline)
{
$dirinfo = array();
- if (ereg("([-dl])[rwxst-]{9}",substr($dirline,0,10)))
+ if (preg_match("/([-dl])[rwxst-]{9}/",substr($dirline,0,10)))
{
$GLOBALS['systyp'] = 'UNIX';
}
@@ -246,13 +246,13 @@
}
elseif($GLOBALS['systyp'] == 'Windows_NT')
{
- if (ereg("[-0-9]+ *[0-9:]+[PA]?M? +<DIR>
{10}(.*)",$dirline,$regs))
+ if (preg_match("/[-0-9]+ *[0-9:]+[PA]?M? +<DIR>
{10}(.*)/",$dirline,$regs))
{
$dirinfo[0] = 1;
$dirinfo[1] = 0;
$dirinfo[2] = $regs[1];
}
- elseif(ereg("[-0-9]+ *[0-9:]+[PA]?M? +([0-9]+)
(.*)",$dirline,$regs))
+ elseif(preg_match("/[-0-9]+ *[0-9:]+[PA]?M? +([0-9]+)
(.*)/",$dirline,$regs))
{
$dirinfo[0] = 0;
$dirinfo[1] = $regs[1];
Modified: trunk/home.php
===================================================================
--- trunk/home.php 2015-09-15 11:45:38 UTC (rev 13919)
+++ trunk/home.php 2015-09-15 19:47:34 UTC (rev 13920)
@@ -36,7 +36,7 @@
foreach($_GET as $name => $value)
{
// find phpgw_ in the $_GET parameters but skip
phpgw_forward because of redirect call below
- if (ereg('phpgw_', $name) && ($name != 'phpgw_forward'))
+ if (preg_match('/phpgw_/', $name) && ($name !=
'phpgw_forward'))
{
$name = substr($name, 6); // cut 'phpgw_'
$extra_vars[$name] = $value;
Modified: trunk/ipc_test_suite/sources/api/class.vcard.inc.php
===================================================================
--- trunk/ipc_test_suite/sources/api/class.vcard.inc.php 2015-09-15
11:45:38 UTC (rev 13919)
+++ trunk/ipc_test_suite/sources/api/class.vcard.inc.php 2015-09-15
19:47:34 UTC (rev 13920)
@@ -181,10 +181,10 @@
$field[$key] = strtoupper($val);
}
- $field[0] = ereg_replace("A\.",'',$field[0]);
- $field[0] = ereg_replace("B\.",'',$field[0]);
- $field[0] = ereg_replace("C\.",'',$field[0]);
- $field[0] = ereg_replace("D\.",'',$field[0]);
+ $field[0] = preg_replace("/A\./",'',$field[0]);
+ $field[0] = preg_replace("/B\./",'',$field[0]);
+ $field[0] = preg_replace("/C\./",'',$field[0]);
+ $field[0] = preg_replace("/D\./",'',$field[0]);
$values = split(';',$value);
switch ($field[0])
{
@@ -247,15 +247,15 @@
$entry['comm_media']['website'] =
$values[0];
break;
case 'NOTE':
- //$entry['note'] =
ereg_replace('=0D=0A',"\n",$values[0]);
+ //$entry['note'] =
preg_replace('/=0D=0A/',"\n",$values[0]);
$entry['notes']['type'] = 'vcard';
- $entry['notes']['note'] =
ereg_replace('=0D=0A',"\n",$values[0]);
+ $entry['notes']['note'] =
preg_replace('/=0D=0A/',"\n",$values[0]);
break;
case 'KEY':
- $entry['key'] =
ereg_replace('=0D=0A',"\n",$values[0]);
+ $entry['key'] =
preg_replace('/=0D=0A/',"\n",$values[0]);
break;
case 'LABEL':
- $entry['label'] =
ereg_replace('=0D=0A',"\n",$values[0]);
+ $entry['label'] =
preg_replace('/=0D=0A/',"\n",$values[0]);
break;
case 'BDAY': #1969-12-31
// use ISO 8601
@@ -276,7 +276,7 @@
$entry['department'] = $values[1];
break;
case 'ADR':
- $field[1] =
ereg_replace("TYPE=",'',$field[1]);
+ $field[1] =
preg_replace("/TYPE=/",'',$field[1]);
switch ($field[1])
{
case 'INTL':
@@ -701,7 +701,7 @@
if(isset($workaddr) && is_array($workaddr))
{
- $workattr = ereg_replace('ADR;','',$workattr);
+ $workattr = preg_replace('/ADR;/','',$workattr);
// remember the correct order of address fields!
$workaddr['POSTOFFICEBOX'] =
$this->vCard_encode($workaddr['POSTOFFICEBOX'], 'QUOTED-PRINTABLE', false);
$workaddr['EXT'] =
$this->vCard_encode($workaddr['EXT'], 'QUOTED-PRINTABLE', false);
@@ -720,7 +720,7 @@
if(isset($homeaddr) && is_array($homeaddr))
{
- $homeattr = ereg_replace('ADR;','',$homeattr);
+ $homeattr = preg_replace('/ADR;/','',$homeattr);
// remember the correct order of address fields!
$homeaddr['POSTOFFICEBOX'] =
$this->vCard_encode($homeaddr['POSTOFFICEBOX'], 'QUOTED-PRINTABLE', false);
$homeaddr['EXT'] =
$this->vCard_encode($homeaddr['EXT'], 'QUOTED-PRINTABLE', false);
@@ -737,7 +737,7 @@
$hlabel =
'LABEL;TYPE=HOME;ENCODING=QUOTED-PRINTABLE:' . $hlabel . "\r\n";
}
- $entries = ereg_replace('PUBKEY','KEY',$entries);
+ $entries = preg_replace('/PUBKEY/','KEY',$entries);
$entries .= $work . $home . $wlabel . $hlabel .
'END:VCARD' . "\r\n";
$entries .= "\r\n";
@@ -956,7 +956,7 @@
if(isset($workaddr) && is_array($workaddr))
{
- $workattr = ereg_replace('ADR;','',$workattr);
+ $workattr = preg_replace('/ADR;/','',$workattr);
// remember the correct order of address fields!
$workaddr['POSTOFFICEBOX'] =
$this->vCard_encode($workaddr['POSTOFFICEBOX'], false, 'UTF-8');
$workaddr['EXT'] =
$this->vCard_encode($workaddr['EXT'], false, 'UTF-8');
@@ -974,7 +974,7 @@
if(isset($homeaddr) && is_array($homeaddr))
{
- $homeattr = ereg_replace('ADR;','',$homeattr);
+ $homeattr = preg_replace('/ADR;/','',$homeattr);
// remember the correct order of address fields!
$homeaddr['POSTOFFICEBOX'] =
$this->vCard_encode($homeaddr['POSTOFFICEBOX'], false, 'UTF-8');
$homeaddr['EXT'] =
$this->vCard_encode($homeaddr['EXT'], false, 'UTF-8');
@@ -991,7 +991,7 @@
}
- $entries = ereg_replace('PUBKEY','KEY',$entries);
+ $entries = preg_replace('/PUBKEY/','KEY',$entries);
//$entries .= $work . $home . $wlabel . $hlabel .
'END:VCARD' . "\r\n";
$entries .= $work . $home . 'END:VCARD' . "\r\n";
@@ -1098,7 +1098,7 @@
if ( strstr(strtolower($name),
$this->import[$fname]) )
{
$value = trim($value);
- //$value =
ereg_replace('=0D=0A','\n',$value); // use quoted_printable_decode above
+ //$value =
preg_replace('/=0D=0A/','\n',$value); // use quoted_printable_decode above
$parsed_line += array($name =>
$value);
}
}
Modified: trunk/ipc_test_suite/sources/app/class.ipc_addressbook.inc.php
===================================================================
--- trunk/ipc_test_suite/sources/app/class.ipc_addressbook.inc.php
2015-09-15 11:45:38 UTC (rev 13919)
+++ trunk/ipc_test_suite/sources/app/class.ipc_addressbook.inc.php
2015-09-15 19:47:34 UTC (rev 13920)
@@ -489,7 +489,7 @@
*/
function _import_vcard($data)
{
- $data = ereg_replace("\n\n", "\r\n", $data); // xml-rpc
bug: \r\n -> \n\n
+ $data = str_replace("\n\n", "\r\n", $data); // xml-rpc
bug: \r\n -> \n\n
$data_lines = explode("\r\n", $data);
$buffer = array();
Modified: trunk/ipc_test_suite/sources/app/class.ipc_calendar.inc.php
===================================================================
--- trunk/ipc_test_suite/sources/app/class.ipc_calendar.inc.php 2015-09-15
11:45:38 UTC (rev 13919)
+++ trunk/ipc_test_suite/sources/app/class.ipc_calendar.inc.php 2015-09-15
19:47:34 UTC (rev 13920)
@@ -49,8 +49,8 @@
if(($type != 'text/x-ical') && ($type !=
'text/calendar'))
return false;
- $data = ereg_replace("\n\n", "\r\n", $data); // xml-rpc
bug: \r\n -> \n\n
- $data = ereg_replace("\r\n\r\n", "\r\n", $data); //
ical from calmeno
+ $data = str_replace("\n\n", "\r\n", $data); // xml-rpc
bug: \r\n -> \n\n
+ $data = str_replace("\r\n\r\n", "\r\n", $data); // ical
from calmeno
$data_lines = explode("\r\n", $data);
$id = $this->bo_iCal->import($data_lines, true);
@@ -171,8 +171,8 @@
if(!$entry || !isset($entry['uid']))
return false;
- $data = ereg_replace("\n\n", "\r\n", $data); // xml-rpc
bug: \r\n -> \n\n
- $data = ereg_replace("\r\n\r\n", "\r\n", $data); //
ical from calmeno
+ $data = str_replace("\n\n", "\r\n", $data); // xml-rpc
bug: \r\n -> \n\n
+ $data = str_replace("\r\n\r\n", "\r\n", $data); // ical
from calmeno
$data_lines = explode("\r\n", $data);
return $this->bo_iCal->import($data_lines, true);
Modified: trunk/ipc_test_suite/sources/app/class.ipc_notes.inc.php
===================================================================
--- trunk/ipc_test_suite/sources/app/class.ipc_notes.inc.php 2015-09-15
11:45:38 UTC (rev 13919)
+++ trunk/ipc_test_suite/sources/app/class.ipc_notes.inc.php 2015-09-15
19:47:34 UTC (rev 13920)
@@ -232,7 +232,7 @@
case 'text/x-vnote':
// handle buggy P800 version-string
$dataExtern = addcslashes($dataExtern,
"\000");
- $dataExtern = ereg_replace('\\\000',
"", $dataExtern);
+ $dataExtern = preg_replace('/\\\000/',
"", $dataExtern);
// recheck if it is really a vnote...
if (!
preg_match('/\<\!\[CDATA\[BEGIN\:VNOTE/i', $dataExtern))
Modified: trunk/messenger/inc/class.somessenger_sql.inc.php
===================================================================
--- trunk/messenger/inc/class.somessenger_sql.inc.php 2015-09-15 11:45:38 UTC
(rev 13919)
+++ trunk/messenger/inc/class.somessenger_sql.inc.php 2015-09-15 19:47:34 UTC
(rev 13920)
@@ -84,7 +84,7 @@
$this->owner = -1;
}
- if (! ereg('^[0-9]+$',$message['to']))
+ if (!preg_match('/^[0-9]+$/',$message['to']))
{
$message['to'] =
$GLOBALS['phpgw']->accounts->name2id($message['to']);
}
Modified: trunk/mobilefrontend/home.php
===================================================================
--- trunk/mobilefrontend/home.php 2015-09-15 11:45:38 UTC (rev 13919)
+++ trunk/mobilefrontend/home.php 2015-09-15 19:47:34 UTC (rev 13920)
@@ -40,7 +40,7 @@
foreach($_GET as $name => $value)
{
// find phpgw_ in the $_GET parameters but skip
phpgw_forward because of redirect call below
- if (ereg('phpgw_', $name) && ($name != 'phpgw_forward'))
+ if (preg_match('/phpgw_/', $name) && ($name !=
'phpgw_forward'))
{
$name = substr($name, 6); // cut 'phpgw_'
$extra_vars[$name] = $value;
Modified: trunk/phpgwapi/inc/class.clientsniffer.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.clientsniffer.inc.php 2015-09-15 11:45:38 UTC
(rev 13919)
+++ trunk/phpgwapi/inc/class.clientsniffer.inc.php 2015-09-15 19:47:34 UTC
(rev 13920)
@@ -88,30 +88,30 @@
$this->UA = $_SERVER['HTTP_USER_AGENT'];
// Determine NAME Name and Version
- if ( eregi( 'MSIE
([0-9].[0-9a-zA-Z]{1,4})',$this->UA,$info) ||
- eregi( 'Microsoft Internet Explorer
([0-9].[0-9a-zA-Z]{1,4})',$this->UA,$info) )
+ if (preg_match( '/MSIE
([0-9].[0-9a-zA-Z]{1,4})/i',$this->UA,$info) ||
+ preg_match( '/Microsoft Internet Explorer
([0-9].[0-9a-zA-Z]{1,4})/i',$this->UA,$info) )
{
$this->VERSION = $info[1];
$this->NAME = 'IE';
}
- elseif ( eregi( 'Opera
([0-9].[0-9a-zA-Z]{1,4})',$this->UA,$info) ||
- eregi(
'Opera/([0-9].[0-9a-zA-Z]{1,4})',$this->UA,$info) )
+ elseif ( preg_match( '/Opera
([0-9].[0-9a-zA-Z]{1,4})/i',$this->UA,$info) ||
+ preg_match(
'/Opera/([0-9].[0-9a-zA-Z]{1,4})/i',$this->UA,$info) )
{
$this->VERSION = $info[1];
$this->NAME = 'Opera';
}
- elseif ( eregi( 'iCab
([0-9].[0-9a-zA-Z]{1,4})',$this->UA,$info) ||
- eregi(
'iCab/([0-9].[0-9a-zA-Z]{1,4})',$this->UA,$info) )
+ elseif ( preg_match( '/iCab
([0-9].[0-9a-zA-Z]{1,4})/i',$this->UA,$info) ||
+ preg_match(
'/iCab\/([0-9].[0-9a-zA-Z]{1,4})/i',$this->UA,$info) )
{
$this->VERSION = $info[1];
$this->NAME = 'iCab';
}
- elseif ( eregi(
'Netscape6/([0-9].[0-9a-zA-Z]{1,4})',$this->UA,$info) )
+ elseif ( preg_match(
'/Netscape6\/([0-9].[0-9a-zA-Z]{1,4})/i',$this->UA,$info) )
{
$this->VERSION = $info[1];
$this->NAME = 'Netscape';
}
- elseif ( eregi(
'Mozilla/([0-9].[0-9a-zA-Z]{1,4})',$this->UA,$info) )
+ elseif ( preg_match(
'/Mozilla\/([0-9].[0-9a-zA-Z]{1,4})/i',$this->UA,$info) )
{
$this->VERSION = $info[1];
$this->NAME = 'Netscape';
@@ -123,11 +123,11 @@
}
// Determine if AOL or WEBTV
- if( eregi( 'aol',$this->UA,$info))
+ if( preg_match( '/aol/i',$this->UA,$info))
{
$this->AOL = true;
}
- elseif( eregi( 'webtv',$this->UA,$info))
+ elseif( preg_match( '/webtv/i',$this->UA,$info))
{
$this->WEBTV = true;
}
@@ -150,27 +150,27 @@
// Determine Platform and OS
// Check for Windows 16-bit
- if( eregi('Win16',$this->UA) ||
- eregi('windows 3.1',$this->UA) ||
- eregi('windows 16-bit',$this->UA) ||
- eregi('16bit',$this->UA))
+ if( preg_match('/Win16/i',$this->UA) ||
+ preg_match('/windows 3.1/i',$this->UA) ||
+ preg_match('/windows 16-bit/i',$this->UA) ||
+ preg_match('/16bit/i',$this->UA))
{
$this->PLATFORM = 'Win16';
$this->OS = 'Win31';
}
// Check for Windows 32-bit
- if(eregi('Win95',$this->UA) || eregi('windows
95',$this->UA))
+ if(preg_match('/Win95/i',$this->UA) ||
preg_match('/windows 95/i',$this->UA))
{
$this->PLATFORM = 'Win32';
$this->OS = 'Win95';
}
- elseif(eregi('Win98',$this->UA) || eregi('windows
98',$this->UA))
+ elseif(preg_match('/Win98/i',$this->UA) ||
preg_match('/windows 98/i',$this->UA))
{
$this->PLATFORM = 'Win32';
$this->OS = 'Win98';
}
- elseif(eregi('WinNT',$this->UA) || eregi('windows
NT',$this->UA))
+ elseif(preg_match('/WinNT/i',$this->UA) ||
preg_match('/windows NT/i',$this->UA))
{
$this->PLATFORM = 'Win32';
$this->OS = 'WinNT';
@@ -182,21 +182,21 @@
}
// Check for OS/2
- if( eregi('os/2',$this->UA) ||
eregi('ibm-webexplorer',$this->UA))
+ if( preg_match('/os\/2/i',$this->UA) ||
preg_match('/ibm-webexplorer/i',$this->UA))
{
$this->PLATFORM = 'OS2';
$this->OS = 'OS2';
}
// Check for Mac 68000
- if( eregi('68k',$this->UA) || eregi('68000',$this->UA))
+ if( preg_match('/68k/i',$this->UA) ||
preg_match('/68000/i',$this->UA))
{
$this->PLATFORM = 'Mac';
$this->OS = 'Mac68k';
}
//Check for Mac PowerPC
- if( eregi('ppc',$this->UA) ||
eregi('powerpc',$this->UA))
+ if( preg_match('/ppc/i',$this->UA) ||
preg_match('/powerpc/i',$this->UA))
{
$this->PLATFORM = 'Mac';
$this->OS = 'MacPPC';
@@ -205,157 +205,157 @@
// Check for Unix Flavor
//SunOS
- if(eregi('sunos',$this->UA))
+ if(preg_match('/sunos/i',$this->UA))
{
$this->PLATFORM = 'Unix';
$this->OS = 'sun';
}
- if(eregi('sunos 4',$this->UA))
+ if(preg_match('/sunos 4/i',$this->UA))
{
$this->PLATFORM = 'Unix';
$this->OS = 'sun4';
}
- elseif(eregi('sunos 5',$this->UA))
+ elseif(preg_match('/sunos 5/i',$this->UA))
{
$this->PLATFORM = 'Unix';
$this->OS = 'sun5';
}
- elseif(eregi('i86',$this->UA))
+ elseif(preg_match('/i86/i',$this->UA))
{
$this->PLATFORM = 'Unix';
$this->OS = 'suni86';
}
// Irix
- if(eregi('irix',$this->UA))
+ if(preg_match('/irix/i',$this->UA))
{
$this->PLATFORM = 'Unix';
$this->OS = 'irix';
}
- if(eregi('irix 6',$this->UA))
+ if(preg_match('/irix 6/i',$this->UA))
{
$this->PLATFORM = 'Unix';
$this->OS = 'irix6';
}
- elseif(eregi('irix 5',$this->UA))
+ elseif(preg_match('/irix 5/i',$this->UA))
{
$this->PLATFORM = 'Unix';
$this->OS = 'irix5';
}
//HP-UX
- if(eregi('hp-ux',$this->UA))
+ if(preg_match('/hp-ux/i',$this->UA))
{
$this->PLATFORM = 'Unix';
$this->OS = 'hpux';
}
- if(eregi('hp-ux',$this->UA) && ereg('10.',$this-UA))
+ if(preg_match('/hp-ux/i',$this->UA) &&
preg_match('/10./',$this-UA))
{
$this->PLATFORM = 'Unix';
$this->OS = 'hpux10';
}
- elseif(eregi('hp-ux',$this->UA) &&
ereg('09.',$this-UA))
+ elseif(preg_match('hp-ux',$this->UA) &&
preg_match('/09./',$this-UA))
{
$this->PLATFORM = 'Unix';
$this->OS = 'hpux9';
}
//AIX
- if(eregi('aix',$this->UA))
+ if(preg_match('/aix/i',$this->UA))
{
$this->PLATFORM = 'Unix';
$this->OS = 'aix';
}
- if(eregi('aix1',$this->UA))
+ if(preg_match('/aix1/i',$this->UA))
{
$this->PLATFORM = 'Unix';
$this->OS = 'aix1';
}
- elseif(eregi('aix2',$this->UA))
+ elseif(preg_match('/aix2/i',$this->UA))
{
$this->PLATFORM = 'Unix';
$this->OS = 'aix2';
}
- elseif(eregi('aix3',$this->UA))
+ elseif(preg_match('/aix3/i',$this->UA))
{
$this->PLATFORM = 'Unix';
$this->OS = 'aix3';
}
- elseif(eregi('aix4',$this->UA))
+ elseif(preg_match('/aix4/i',$this->UA))
{
$this->PLATFORM = 'Unix';
$this->OS = 'aix4';
}
// Linux
- if(eregi('inux',$this->UA))
+ if(preg_match('/inux/i',$this->UA))
{
$this->PLATFORM = 'Unix';
$this->OS = 'linux';
}
//Unixware
- if(eregi('unix_system_v',$this->UA))
+ if(preg_match('/unix_system_v/i',$this->UA))
{
$this->PLATFORM = 'Unix';
$this->OS = 'unixware';
}
//mpras
- if(eregi('ncr',$this->UA))
+ if(preg_match('/ncr/i',$this->UA))
{
$this->PLATFORM = 'Unix';
$this->OS = 'mpras';
}
//Reliant
- if(eregi('reliantunix',$this->UA))
+ if(preg_match('/reliantunix/i',$this->UA))
{
$this->PLATFORM = 'Unix';
$this->OS = 'reliant';
}
// DEC
- if(eregi('dec',$this->UA) ||
- eregi('osfl',$this->UA) ||
- eregi('alphaserver',$this->UA) ||
- eregi('ultrix',$this->UA) ||
- eregi('alphastation',$this->UA))
+ if(preg_match('/dec/i',$this->UA) ||
+ preg_match('/osfl/i',$this->UA) ||
+ preg_match('/alphaserver/i',$this->UA) ||
+ preg_match('/ultrix/i',$this->UA) ||
+ preg_match('/alphastation/i',$this->UA))
{
$this->PLATFORM = 'Unix';
$this->OS = 'dec';
}
// Sinix
- if(eregi('sinix',$this->UA))
+ if(preg_match('/sinix/i',$this->UA))
{
$this->PLATFORM = 'Unix';
$this->OS = 'sinix';
}
// FreeBSD
- if(eregi('freebsd',$this->UA))
+ if(preg_match('/freebsd/i',$this->UA))
{
$this->PLATFORM = 'Unix';
$this->OS = 'freebsd';
}
// BSD
- if(eregi('bsd',$this->UA))
+ if(preg_match('/bsd/i',$this->UA))
{
$this->PLATFORM = 'Unix';
$this->OS = 'bsd';
}
// VMS
- if(eregi('vax',$this->UA) ||
eregi('openvms',$this->UA))
+ if(preg_match('/vax/i',$this->UA) ||
preg_match('/openvms/i',$this->UA))
{
$this->PLATFORM = 'Unix';
$this->OS = 'vms';
}
// SCO
- if(eregi('sco',$this->UA) ||
eregi('unix_sv',$this->UA))
+ if(preg_match('/sco/i',$this->UA) ||
preg_match('/unix_sv/i',$this->UA))
{
$this->PLATFORM = 'Unix';
$this->OS = 'sco';
@@ -364,18 +364,18 @@
// Assume JavaScript Version
// make the code a bit easier to read
- $ie = eregi('ie',$this->NAME);
- $ie5 = ( eregi('ie',$this->NAME) && ($this->MAJORVER >=
5) );
- $ie4 = ( eregi('ie',$this->NAME) && ($this->MAJORVER >=
4) );
- $ie3 = ( eregi('ie',$this->NAME) && ($this->MAJORVER >=
3) );
+ $ie = preg_match('/ie/i',$this->NAME);
+ $ie5 = ( preg_match('/ie/i',$this->NAME) &&
($this->MAJORVER >= 5) );
+ $ie4 = ( preg_match('/ie/i',$this->NAME) &&
($this->MAJORVER >= 4) );
+ $ie3 = ( preg_match('/ie/i',$this->NAME) &&
($this->MAJORVER >= 3) );
- $nav = eregi('netscape',$this->NAME);
- $nav5 = ( eregi('netscape',$this->NAME) &&
($this->MAJORVER >= 5) );
- $nav4 = ( eregi('netscape',$this->NAME) &&
($this->MAJORVER >= 4) );
- $nav3 = ( eregi('netscape',$this->NAME) &&
($this->MAJORVER >= 3) );
- $nav2 = ( eregi('netscape',$this->NAME) &&
($this->MAJORVER >= 2) );
+ $nav = preg_match('/netscape/i',$this->NAME);
+ $nav5 = ( preg_match('/netscape/i',$this->NAME) &&
($this->MAJORVER >= 5) );
+ $nav4 = ( preg_match('/netscape/i',$this->NAME) &&
($this->MAJORVER >= 4) );
+ $nav3 = ( preg_match('/netscape/i',$this->NAME) &&
($this->MAJORVER >= 3) );
+ $nav2 = ( preg_match('/netscape/i',$this->NAME) &&
($this->MAJORVER >= 2) );
- $opera = eregi('opera',$this->NAME);
+ $opera = preg_match('/opera/i',$this->NAME);
// do the assumption
// update as new versions are released
Modified: trunk/phpgwapi/inc/class.error.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.error.inc.php 2015-09-15 11:45:38 UTC (rev
13919)
+++ trunk/phpgwapi/inc/class.error.inc.php 2015-09-15 19:47:34 UTC (rev
13920)
@@ -67,7 +67,7 @@
}
$fname = $parms['file'];
$line = $parms['line'];
- if (eregi('([DIWEF])-([[:alnum:]]*)\,
(.*)',$etext,$match))
+ if (preg_match('/([DIWEF])-([[:alnum:]]*)\,
(.*)/i',$etext,$match))
{
$this->severity = strtoupper($match[1]);
$this->code = $match[2];
Modified: trunk/phpgwapi/inc/class.gdbutton.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.gdbutton.inc.php 2015-09-15 11:45:38 UTC (rev
13919)
+++ trunk/phpgwapi/inc/class.gdbutton.inc.php 2015-09-15 19:47:34 UTC (rev
13920)
@@ -188,7 +188,7 @@
{
while( list($key, $val) = each($_POST))
{
- if (ereg("(.*)_x",$key,$varName) &&
$_POST[$varName[1]."_y"])
+ if
(preg_match("/(.*)_x/",$key,$varName) && $_POST[$varName[1]."_y"])
{
$name = $varName[1];
global $$name;
Modified: trunk/phpgwapi/inc/class.gdgraph.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.gdgraph.inc.php 2015-09-15 11:45:38 UTC (rev
13919)
+++ trunk/phpgwapi/inc/class.gdgraph.inc.php 2015-09-15 19:47:34 UTC (rev
13920)
@@ -788,7 +788,7 @@
{
print('<script language="JavaScript">');
print('window.open(\'main.php3?menuAction=boGraph.Show&');
- if (ereg('MSIE', $GLOBALS['HTTP_USER_AGENT']))
+ if (preg_match('/MSIE/i', $GLOBALS['HTTP_USER_AGENT']))
print('DCLINFO=' . $GLOBALS['DCLINFO'] . '&');
print($this->ToURL() . '\', \'graph\', \'width=' .
($this->graph_width + 20) . ',height=' . ($this->graph_height + 20) .
',resizable=yes,scrollbars=yes\');');
print('</script>');
Modified: trunk/phpgwapi/inc/class.http.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.http.inc.php 2015-09-15 11:45:38 UTC (rev
13919)
+++ trunk/phpgwapi/inc/class.http.inc.php 2015-09-15 19:47:34 UTC (rev
13920)
@@ -467,7 +467,7 @@
}
break;
case 'expires':
-
if(ereg("^((Mon|Monday|Tue|Tuesday|Wed|Wednesday|Thu|Thursday|Fri|Friday|Sat|Saturday|Sun|Sunday),
)?([0-9]{2})\\-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\-([0-9]{2,4})
([0-9]{2})\\:([0-9]{2})\\:([0-9]{2}) GMT$",$value,$matches))
+
if(preg_match("/^((Mon|Monday|Tue|Tuesday|Wed|Wednesday|Thu|Thursday|Fri|Friday|Sat|Saturday|Sun|Sunday),
)?([0-9]{2})\\-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\-([0-9]{2,4})
([0-9]{2})\\:([0-9]{2})\\:([0-9]{2}) GMT$/i",$value,$matches))
{
$year = intval($matches[5]);
if($year<1900)
Modified: trunk/phpgwapi/inc/class.http_dav_client.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.http_dav_client.inc.php 2015-09-15 11:45:38 UTC
(rev 13919)
+++ trunk/phpgwapi/inc/class.http_dav_client.inc.php 2015-09-15 19:47:34 UTC
(rev 13920)
@@ -797,7 +797,7 @@
else
{
if ( DEBUG_CACHEPROP ) _debug_array("Cache Miss! : $uri");
- if ( $is_dir && !ereg('#/$#',$uri) )
+ if ( $is_dir && !preg_match('/#\/$#/',$uri) )
{
if ( DEBUG_CACHEPROP ) _debug_array("Cache dir (is_dir)! : $uri/");
$this->cached_propfind[$uri.'/'] =
$this->http_client->PropFind( $uri.'/', $scope);
@@ -871,7 +871,7 @@
}
$this->http_client->requestBody = $davxml;
//Ok if we know that this is a dir add a / if needed
- if ( $is_dir && !ereg('#./$#',$uri) )
+ if ( $is_dir && !preg_match('/#.\/$#/',$uri) )
{
if( $this->http_client->sendCommand( 'PROPPATCH
'.$uri.'/ HTTP/1.1' ) )
{
Modified: trunk/phpgwapi/inc/class.interserver.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.interserver.inc.php 2015-09-15 11:45:38 UTC
(rev 13919)
+++ trunk/phpgwapi/inc/class.interserver.inc.php 2015-09-15 19:47:34 UTC
(rev 13920)
@@ -136,13 +136,13 @@
switch($this->mode)
{
case 'soap':
- if(!ereg('soap.php',$matches[2]))
+
if(!preg_match('/soap.php/',$matches[2]))
{
$matches[2] .=
$this->urlparts['soap'];
}
break;
case 'xmlrpc':
- if(!ereg('xmlrpc.php',$matches[2]))
+
if(!preg_match('/xmlrpc.php/',$matches[2]))
{
$matches[2] .=
$this->urlparts['xmlrpc'];
}
Modified: trunk/phpgwapi/inc/class.log_message.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.log_message.inc.php 2015-09-15 11:45:38 UTC
(rev 13919)
+++ trunk/phpgwapi/inc/class.log_message.inc.php 2015-09-15 19:47:34 UTC
(rev 13920)
@@ -51,7 +51,7 @@
// This code is left in for backward compatibility with
the
// old log code. Consider it deprecated.
- if ( !isset( $parms['severity']) &&
eregi('([DIWEF])-([[:alnum:]]*)\, (.*)',$etext,$match))
+ if ( !isset( $parms['severity']) &&
preg_match('/([DIWEF])-([[:alnum:]]*)\, (.*)/i',$etext,$match))
{
$this->severity = strtoupper($match[1]);
$this->msg = trim($match[3]);
Modified: trunk/phpgwapi/inc/class.login.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.login.inc.php 2015-09-15 11:45:38 UTC (rev
13919)
+++ trunk/phpgwapi/inc/class.login.inc.php 2015-09-15 19:47:34 UTC (rev
13920)
@@ -152,7 +152,7 @@
$extra_vars['phpgw_forward'] = $forward;
foreach ($_GET as $name => $value)
{
- if (ereg('phpgw_', $name))
+ if (preg_match('/phpgw_/',
$name))
{
$name
= urlencode($name);
$extra_vars[$name]
= urlencode($value);
@@ -232,7 +232,7 @@
$extra_vars['phpgw_forward'] = $forward;
foreach ($_GET as $name => $value)
{
- if (ereg('phpgw_', $name))
+ if (preg_match('/phpgw_/',
$name))
{
$name
= urlencode($name);
$extra_vars[$name]
= urlencode($value);
@@ -305,7 +305,7 @@
$extra_vars['phpgw_forward'] = $forward;
foreach ($_GET as $name => $value)
{
- if (ereg('phpgw_', $name))
+ if (preg_match('/phpgw_/',
$name))
{
//$extra_vars[$name] =
$value;
$name
= urlencode($name);
Modified: trunk/phpgwapi/inc/class.menutree.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.menutree.inc.php 2015-09-15 11:45:38 UTC (rev
13919)
+++ trunk/phpgwapi/inc/class.menutree.inc.php 2015-09-15 19:47:34 UTC (rev
13920)
@@ -352,9 +352,9 @@
if($tree[$cnt+1][0]>$tree[$cnt][0])
{
$src = $REQUEST_URI;
- if(ereg('[\?\&]p=',$src) != 0)
+ if(preg_match('/[\?\&]p=/',$src) != 0)
{
- $src =
ereg_replace('[\?\&]p=([0-9\|])+','',$REQUEST_URI);
+ $src =
preg_replace('/[\?\&]p=([0-9\|])+/','',$REQUEST_URI);
}
// echo 'Src = '.$src."<br>\n";
if(strpos(' '.$src,'?'))
Modified: trunk/phpgwapi/inc/class.network.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.network.inc.php 2015-09-15 11:45:38 UTC (rev
13919)
+++ trunk/phpgwapi/inc/class.network.inc.php 2015-09-15 19:47:34 UTC (rev
13920)
@@ -150,7 +150,7 @@
}
}
$response = $this->read_port();
- if
(!ereg(strtoupper($expected_response),strtoupper($response)))
+ if (!preg_match("/$expected_response/i",$response))
{
if(substr($expected_response,1,1) == '+')
{
Modified: trunk/phpgwapi/inc/class.schema_proc_oracle.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.schema_proc_oracle.inc.php 2015-09-15 11:45:38 UTC
(rev 13919)
+++ trunk/phpgwapi/inc/class.schema_proc_oracle.inc.php 2015-09-15 19:47:34 UTC
(rev 13920)
@@ -204,7 +204,7 @@
// see chapter 1.8.4.5
function GetFKSQL($sFields)
{
- if (ereg("\((.*)\)", $sFields, $regs))
+ if (preg_match("/\((.*)\)/", $sFields, $regs))
{
$ret = "FOREIGN KEY (".$regs[1].")\n" .
" REFERENCES ".$sFields;
Modified: trunk/phpgwapi/inc/class.schema_proc_pgsql.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.schema_proc_pgsql.inc.php 2015-09-15 11:45:38 UTC
(rev 13919)
+++ trunk/phpgwapi/inc/class.schema_proc_pgsql.inc.php 2015-09-15 19:47:34 UTC
(rev 13920)
@@ -342,7 +342,7 @@
$sdc->next_record();
if ($sdc->f(0) != '')
{
- if (ereg('nextval',$sdc->f(0)))
+ if (preg_match('/nextval/',$sdc->f(0)))
{
$default = '';
$nullcomma = '';
Modified: trunk/phpgwapi/inc/class.setup_html.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.setup_html.inc.php 2015-09-15 11:45:38 UTC (rev
13919)
+++ trunk/phpgwapi/inc/class.setup_html.inc.php 2015-09-15 19:47:34 UTC (rev
13920)
@@ -256,7 +256,7 @@
$dh = dir(PHPGW_SERVER_ROOT . '/phpgwapi/themes');
while ($file = $dh->read())
{
- if (eregi("\.theme$", $file))
+ if (preg_match("/\.theme$/i", $file))
{
$list[] =
substr($file,0,strpos($file,'.'));
}
Modified: trunk/phpgwapi/inc/class.validator.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.validator.inc.php 2015-09-15 11:45:38 UTC (rev
13919)
+++ trunk/phpgwapi/inc/class.validator.inc.php 2015-09-15 19:47:34 UTC (rev
13920)
@@ -29,7 +29,7 @@
/* check if string contains any whitespace */
function has_space ($text)
{
- return ereg('( |\n|\t|\r)+', $text);
+ return preg_match('/( |\n|\t|\r)+/', $text);
}
function chconvert ($fragment)
@@ -50,7 +50,7 @@
/* strips all whitespace from a string */
function strip_space ($text)
{
- return ereg('( |\n|\t|\r)+', '', $text);
+ return preg_replace('/( |\n|\t|\r)+/', '', $text);
}
function is_allnumbers ($text)
@@ -113,9 +113,9 @@
return false;
}
- if (ereg('^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+'.'@'.
+ if
(preg_match('/^[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+'.'@'.
'[-!#$%&\'*+\\/0-9=?A-Z^_`a-z{|}~]+\.'.
- '[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$',
$address))
+ '[-!#$%&\'*+\\./0-9=?A-Z^_`a-z{|}~]+$/',
$address))
{
return true;
}
@@ -145,7 +145,7 @@
if(@$uris[$url_elements['scheme']])
{
//echo ' is valid<br>host ' .
$url_elements['host'];
- if( eregi("[a-z]", $url_elements['host']) )
+ if( preg_match("/[a-z]/i",
$url_elements['host']) )
{
//echo ' is name<br>';
return
$this->is_hostname($url_elements['host']);
@@ -198,7 +198,7 @@
foreach($segs as $seg)
{
//echo "Checking $seg<br>";
- if(eregi("[a-z0-9\-]{0,62}",$seg))
+
if(preg_match("/[a-z0-9\-]{0,62}/i",$seg))
{
$return = True;
}
Modified: trunk/phpgwapi/inc/class.vfs_dav.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.vfs_dav.inc.php 2015-09-15 11:45:38 UTC (rev
13919)
+++ trunk/phpgwapi/inc/class.vfs_dav.inc.php 2015-09-15 19:47:34 UTC (rev
13920)
@@ -99,7 +99,7 @@
/* Dav properties */
//First check if we are asked to use svn ...
$use_svn = false;
- if(ereg('svn[s:][:/]/', $this->basedir))
+ if(preg_match('/svn[s:][:\/]\//', $this->basedir))
{
$use_svn = true;
//so the 's' is kept
@@ -1145,7 +1145,7 @@
while (list ($num, $entry) = each ($ls))
{
- $newdir = ereg_replace
("^$f->fake_full_path", "$t->fake_full_path", $entry['directory']);
+ $newdir = str_replace
($f->fake_full_path, "$t->fake_full_path", $entry['directory'], 1);
if ($this->mkdir (array(
'string' =>
$newdir.'/'.$entry['name'],
'relatives' =>
array ($t->mask)
@@ -1170,7 +1170,7 @@
continue;
}
- $newdir = ereg_replace
("^$f->fake_full_path", "$t->fake_full_path", $entry['directory']);
+ $newdir = str_replace
($f->fake_full_path, "$t->fake_full_path", $entry['directory'], 1);
$this->cp (array(
'from' =>
"$entry[directory]/$entry[name]",
'to' =>
"$newdir/$entry[name]",
@@ -1257,7 +1257,7 @@
'string' => $f->fake_full_path,
'relatives' => array ($f->mask)
) == 'Directory'))
- && ereg ("^$f->fake_full_path",
$t->fake_full_path)
+ && preg_match ('/^' .
addcslashes($f->fake_full_path, '/'). '/', $t->fake_full_path)
)
{
if (($t->fake_full_path == $f->fake_full_path)
|| substr ($t->fake_full_path, strlen ($f->fake_full_path), 1) == '/')
@@ -1498,7 +1498,7 @@
}
/* We don't allow /'s in dir names, of course */
- if (ereg ('/', $p->fake_name))
+ if (preg_match ('/\//', $p->fake_name))
{
return False;
}
@@ -1861,7 +1861,7 @@
)
);
- if ($data['checksubdirs']==False && ereg('.*/$',
$data['string']) && $data['nofiles'] )
+ if ($data['checksubdirs']==False &&
preg_match('/.*\/$/', $data['string']) && $data['nofiles'] )
{
$this->debug('Returning empty for'.$data['string'],DEBUG_LS);
return array();
Modified: trunk/phpgwapi/inc/class.vfs_shared.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.vfs_shared.inc.php 2015-09-15 11:45:38 UTC (rev
13919)
+++ trunk/phpgwapi/inc/class.vfs_shared.inc.php 2015-09-15 19:47:34 UTC (rev
13920)
@@ -1085,7 +1085,7 @@
)
);
- return (ereg_replace ("^\.+", '', $p->fake_name));
+ return (preg_replace ("/^\.+/", '', $p->fake_name));
}
/**
@@ -1105,7 +1105,7 @@
$data = array ();
}
- $string = ereg_replace ("'", "\'", $data['string']);
+ $string = preg_replace ("/'/", "/\'/", $data['string']);
return $string;
}
@@ -1214,14 +1214,14 @@
/* Let's not return // */
//XXX If $basedir contains http(s):// what are we doing
??? Caeies
- $basedir = ereg_replace('://','DOTSLASHSLASH',$basedir);
- while (ereg ($sep . $sep, $basedir))
+ $basedir =
preg_replace('/:\/\//','DOTSLASHSLASH',$basedir);
+ while (preg_match ('/'.addcslashes($sep . $sep,
'/').'/', $basedir))
{
- $basedir = ereg_replace ($sep . $sep, $sep,
$basedir);
+ $basedir = preg_replace ('/'.addcslashes($sep .
$sep, '/').'/', $sep, $basedir);
}
- $basedir = ereg_replace('DOTSLASHSLASH','://',$basedir);
+ $basedir =
preg_replace('/DOTSLASHSLASH/','://',$basedir);
- $basedir = ereg_replace ($sep . '$', '', $basedir);
+ $basedir = preg_replace ('/'.addcslashes($sep, '/') .
'$/', '', $basedir);
return $basedir;
}
@@ -1485,8 +1485,9 @@
if(preg_match("/^" . str_replace('/',
'\/', "{$link_info['directory']}/{$link_info['name']}"). "(\/|$)/",
$rarray['fake_full_path']))
{
- $rarray['real_full_path'] =
ereg_replace ("^$this->basedir", '', $rarray['real_full_path']);
- $rarray['real_full_path'] =
ereg_replace ("^{$link_info['directory']}/{$link_info['name']}",
"{$link_info['link_directory']}/{$link_info['link_name']}",
$rarray['real_full_path']);
+ $rarray['real_full_path'] =
preg_replace ("/^" . addcslashes($this->basedir,'/') ."/", '',
$rarray['real_full_path']);
+// $rarray['real_full_path'] =
ereg_replace ("^{$link_info['directory']}/{$link_info['name']}",
"{$link_info['link_directory']}/{$link_info['link_name']}",
$rarray['real_full_path']);
+ $rarray['real_full_path'] =
preg_replace ("/^" .
addcslashes("{$link_info['directory']}/{$link_info['name']}",'/') ."/",
"{$link_info['link_directory']}/{$link_info['link_name']}",
$rarray['real_full_path']);
$p = $this->path_parts (array(
'string'
=> $rarray['real_full_path'],
@@ -1645,7 +1646,7 @@
if (!$data['full'])
{
- $currentdir = ereg_replace ("^/", '',
$currentdir);
+ $currentdir = preg_replace ("/^\//", '',
$currentdir);
}
if ($currentdir == '' && $data['full'])
Modified: trunk/phpgwapi/inc/class.xml.inc.php
===================================================================
--- trunk/phpgwapi/inc/class.xml.inc.php 2015-09-15 11:45:38 UTC (rev
13919)
+++ trunk/phpgwapi/inc/class.xml.inc.php 2015-09-15 19:47:34 UTC (rev
13920)
@@ -472,7 +472,7 @@
function remove_node ( $node )
{
// Check whether the node is an attribute node.
- if ( ereg("/attribute::", $node) )
+ if (preg_match("/\/attribute::/", $node) )
{
// Get the path to the attribute node's parent.
$parent = $this->prestr($node, "/attribute::");
@@ -590,7 +590,7 @@
function add_content ( $path, $value )
{
// Check whether it's an attribute node.
- if ( ereg("/attribute::", $path) )
+ if ( preg_match("/\/attribute::/", $path) )
{
// Get the path to the attribute node's parent.
$parent = $this->prestr($path, "/attribute::");
@@ -627,7 +627,7 @@
function set_content ( $path, $value )
{
// Check whether it's an attribute node.
- if ( ereg("/attribute::", $path) )
+ if ( preg_match("/\/attribute::/", $path) )
{
// Get the path to the attribute node's parent.
$parent = $this->prestr($path, "/attribute::");
@@ -666,7 +666,7 @@
function get_content ( $path )
{
// Check whether it's an attribute node.
- if ( ereg("/attribute::", $path) )
+ if ( preg_match("/\/attribute::/", $path) )
{
// Get the path to the attribute node's parent.
$parent = $this->prestr($path, "/attribute::");
@@ -1031,7 +1031,7 @@
);
// Check whether there are predicates.
- if ( ereg("\[", $step) )
+ if ( preg_match("/\[/", $step) )
{
// Get the predicates.
$predicates = substr($step, strpos($step, "["));
@@ -1077,7 +1077,7 @@
$axis["axis"] = "child";
$axis["node-test"] = "*";
}
- elseif ( ereg("\(", $step) )
+ elseif ( preg_match("/\(/", $step) )
{
// Check whether it's a function.
if ( $this->is_function($this->prestr($step,
"(")) )
@@ -1108,13 +1108,13 @@
$axis["node-test"] = $step;
}
}
- elseif ( eregi("^@", $step) )
+ elseif ( preg_match("/^@/i", $step) )
{
// Use the attribute axis and select the
attribute.
$axis["axis"] = "attribute";
$axis["node-test"] = substr($step, 1);
}
- elseif ( eregi("\]$", $step) )
+ elseif ( preg_match("/\]$/i", $step) )
{
// Use the child axis and select a position.
$axis["axis"] = "child";
@@ -1132,7 +1132,7 @@
$axis["axis"] = "parent";
$axis["node-test"] = "*";
}
- elseif ( ereg("^[a-zA-Z0-9\-_]+$", $step) )
+ elseif ( preg_match("/^[a-zA-Z0-9\-_]+$/", $step) )
{
// Select the child axis and the child.
$axis["axis"] = "child";
@@ -1474,7 +1474,7 @@
foreach ( $this->functions as $function )
{
// Check whether there's a - sign in the
function name.
- if ( ereg("-", $function) )
+ if ( preg_match("/-/", $function) )
{
// Get the position of the - in the
function name.
$sign = strpos($function, "-");
@@ -1593,7 +1593,7 @@
}
// Check whether the predicate is a function.
- if ( ereg("\(", $predicate) )
+ if ( preg_match("/\(/", $predicate) )
{
// Get the position of the first bracket.
$start = strpos($predicate, "(");
@@ -1642,8 +1642,8 @@
}
// Check whether the predicate is just a digit.
- if ( ereg("^[0-9]+(\.[0-9]+)?$", $predicate) ||
- ereg("^\.[0-9]+$", $predicate) )
+ if ( preg_match("/^[0-9]+(\.[0-9]+)?$/", $predicate) ||
+ preg_match("/^\.[0-9]+$/", $predicate) )
{
// Return the value of the digit.
return doubleval($predicate);
@@ -1696,7 +1696,7 @@
foreach ( $predicates as $predicate )
{
// Check whether the predicate is just an
number.
- if ( ereg("^[0-9]+$", $predicate) )
+ if ( preg_match("/^[0-9]+$/", $predicate) )
{
// Enhance the predicate.
$predicate .= "=position()";
@@ -1764,7 +1764,7 @@
function check_node_test ( $context, $node_test )
{
// Check whether it's a function.
- if ( ereg("\(", $node_test) )
+ if ( preg_match("/\(/", $node_test) )
{
// Get the type of function to use.
$function = $this->prestr($node_test, "(");
@@ -1840,7 +1840,7 @@
// Add this node to the node-set.
return true;
}
- elseif ( ereg("^[a-zA-Z0-9\-_]+", $node_test) )
+ elseif ( preg_match("/^[a-zA-Z0-9\-_]+/", $node_test) )
{
// Check whether the node-test can be fulfilled.
if ( $this->nodes[$context]["name"] == $node_test )
@@ -2570,8 +2570,8 @@
function handle_function_string ( $node, $arguments )
{
// Check what type of parameter is given
- if ( ereg("^[0-9]+(\.[0-9]+)?$", $arguments) ||
- ereg("^\.[0-9]+$", $arguments) )
+ if ( preg_match("/^[0-9]+(\.[0-9]+)?$/", $arguments) ||
+ preg_match("/^\.[0-9]+$/", $arguments) )
{
// Convert the digits to a number.
$number = doubleval($arguments);
@@ -2679,7 +2679,7 @@
$second = $this->evaluate_predicate($node, $second);
// Check whether the first string starts with the second one.
- if ( ereg("^".$second, $first) )
+ if ( preg_match("/^".$second.'/', $first) )
{
// Return true.
return true;
@@ -2717,7 +2717,7 @@
$second = $this->evaluate_predicate($node, $second);
// Check whether the first string starts with the second one.
- if ( ereg($second, $first) )
+ if ( preg_match("/$second/", $first) )
{
// Return true.
return true;
@@ -2913,8 +2913,8 @@
$arguments = trim($arguments);
// Check what type of parameter is given
- if ( ereg("^[0-9]+(\.[0-9]+)?$", $arguments) ||
- ereg("^\.[0-9]+$", $arguments) )
+ if ( preg_match("/^[0-9]+(\.[0-9]+)?$/", $arguments) ||
+ preg_match("/^\.[0-9]+$/", $arguments) )
{
// Convert the digits to a number.
$number = doubleval($arguments);
@@ -3054,7 +3054,7 @@
if (
!empty($this->nodes[$node]["attributes"]["xml:lang"]) )
{
// Check whether it's the language, the
user asks for.
- if ( eregi("^".$arguments,
$this->nodes[$node]
+ if ( preg_match("/^$arguments/i",
$this->nodes[$node]
["attributes"]["xml:lang"]) )
{
// Return true.
@@ -3074,7 +3074,7 @@
else
{
// Check whether it's the language, the user asks for.
- if ( eregi("^".$arguments,
$this->nodes[$node]["attributes"]
+ if ( preg_match("/^$arguments/i",
$this->nodes[$node]["attributes"]
["xml:lang"]) )
{
// Return true.
@@ -3106,8 +3106,8 @@
function handle_function_number ( $node, $arguments )
{
// Check the type of argument.
- if ( ereg("^[0-9]+(\.[0-9]+)?$", $arguments) ||
- ereg("^\.[0-9]+$", $arguments) )
+ if ( preg_match("/^[0-9]+(\.[0-9]+)?$/", $arguments) ||
+ preg_match("/^\.[0-9]+$/", $arguments) )
{
// Return the argument as a number.
return doubleval($arguments);
@@ -3346,7 +3346,7 @@
}
// Replace the last separator.
- $command = eregi_replace(", $", ");", $command);
+ $command = preg_replace("/, $/i", ");", $command);
// Execute the command.
eval($command);
Modified: trunk/phpgwapi/inc/functions.inc.php
===================================================================
--- trunk/phpgwapi/inc/functions.inc.php 2015-09-15 11:45:38 UTC (rev
13919)
+++ trunk/phpgwapi/inc/functions.inc.php 2015-09-15 19:47:34 UTC (rev
13920)
@@ -300,6 +300,10 @@
case 'S': // Strict
$error_reporting = E_STRICT | E_PARSE;
break;
+
+ case 'DP': // Deprecated
+ $error_reporting = E_ERROR |
E_USER_ERROR| E_DEPRECATED | E_USER_DEPRECATED;
+ break;
}
if( !(!!($error_reporting & $error_level)))
Modified: trunk/phpgwapi/inc/sso/create_account.php
===================================================================
--- trunk/phpgwapi/inc/sso/create_account.php 2015-09-15 11:45:38 UTC (rev
13919)
+++ trunk/phpgwapi/inc/sso/create_account.php 2015-09-15 19:47:34 UTC (rev
13920)
@@ -84,7 +84,7 @@
$error[] = lang('You have to choose a login');
}
- if (!eregi("^[0-9_a-z]*$",$loginn))
+ if (!preg_match("/^[0-9_a-z]*$/i",$loginn))
{
$error[] = lang('Please submit just letters and numbers
for your login');
}
Modified:
trunk/phpgwapi/js/fckeditor/editor/filemanager/browser/default/connectors/php/connector.php
===================================================================
---
trunk/phpgwapi/js/fckeditor/editor/filemanager/browser/default/connectors/php/connector.php
2015-09-15 11:45:38 UTC (rev 13919)
+++
trunk/phpgwapi/js/fckeditor/editor/filemanager/browser/default/connectors/php/connector.php
2015-09-15 19:47:34 UTC (rev 13920)
@@ -39,14 +39,14 @@
else
$GLOBALS["UserFilesPath"] = '/UserFiles/' ;
-if ( ! ereg( '/$', $GLOBALS["UserFilesPath"] ) )
+if ( ! preg_match( '/\/$/', $GLOBALS["UserFilesPath"] ) )
$GLOBALS["UserFilesPath"] .= '/' ;
if ( strlen( $Config['UserFilesAbsolutePath'] ) > 0 )
{
$GLOBALS["UserFilesDirectory"] = $Config['UserFilesAbsolutePath'] ;
- if ( ! ereg( '/$', $GLOBALS["UserFilesDirectory"] ) )
+ if ( ! preg_match( '/\/$/', $GLOBALS["UserFilesDirectory"] ) )
$GLOBALS["UserFilesDirectory"] .= '/' ;
}
else
@@ -72,7 +72,7 @@
return ;
// Check the current folder syntax (must begin and start with a slash).
- if ( ! ereg( '/$', $sCurrentFolder ) ) $sCurrentFolder .= '/' ;
+ if ( ! preg_match( '/\/$/', $sCurrentFolder ) ) $sCurrentFolder .= '/' ;
if ( strpos( $sCurrentFolder, '/' ) !== 0 ) $sCurrentFolder = '/' .
$sCurrentFolder ;
// Check for invalid folder paths (..)
Modified: trunk/property/inc/class.bodocument.inc.php
===================================================================
--- trunk/property/inc/class.bodocument.inc.php 2015-09-15 11:45:38 UTC (rev
13919)
+++ trunk/property/inc/class.bodocument.inc.php 2015-09-15 19:47:34 UTC (rev
13920)
@@ -224,7 +224,7 @@
function read_at_location($location_code='')
{
$use_svn = false;
- if(ereg('svn[s:][:/]/',
$GLOBALS['phpgw_info']['server']['files_dir']))
+ if(preg_match('/svn[s:][:\/]\//',
$GLOBALS['phpgw_info']['server']['files_dir']))
{
// $use_svn = true;
}
@@ -257,7 +257,7 @@
$dateformat
= $GLOBALS['phpgw_info']['user']['preferences']['common']['dateformat'];
$document['document_date'] =
$GLOBALS['phpgw']->common->show_date($document['document_date'],$dateformat);
- if(ereg('svn[s:][:/]/',
$GLOBALS['phpgw_info']['server']['files_dir']))
+ if(preg_match('/svn[s:][:\/]\//',
$GLOBALS['phpgw_info']['server']['files_dir']))
{
$document['journal'] =
$this->get_file($document_id, true, $document);
}
Modified: trunk/property/inc/class.db_oci8.inc.php
===================================================================
--- trunk/property/inc/class.db_oci8.inc.php 2015-09-15 11:45:38 UTC (rev
13919)
+++ trunk/property/inc/class.db_oci8.inc.php 2015-09-15 19:47:34 UTC (rev
13920)
@@ -164,7 +164,7 @@
if ($this->autoCount)
{
/* need to repeat the query to count
the returned rows from a "select" statement. */
- if (eregi("SELECT", $Query_String))
+ if (preg_match("/^SELECT/i",
$Query_String))
{
/* On $this->num_rows I'm
storing the returned rows of the query. */
$this->num_rows =
OCIFetchStatement($this->Parse, $aux);
@@ -326,7 +326,7 @@
}
if ($query_id && $this->last_query_text != "")
{
- if (eregi("^(INSERT{1}|^INSERT
INTO{1})[[:space:]][\"]?([a-zA-Z0-9\_\-]+)[\"]?",
$this->last_query_text[$query_id], $tablename))
+ if (preg_match("/^(INSERT{1}|^INSERT
INTO{1})[[:space:]][\"]?([a-zA-Z0-9\_\-]+)[\"]?/i",
$this->last_query_text[$query_id], $tablename))
{
$query = "SELECT
".$tablename[2]."_id_seq.CURRVAL FROM DUAL";
$temp_q_id = @OCIParse($this->db,
$query);
Modified: trunk/registration/inc/class.boreg.inc.php
===================================================================
--- trunk/registration/inc/class.boreg.inc.php 2015-09-15 11:45:38 UTC (rev
13919)
+++ trunk/registration/inc/class.boreg.inc.php 2015-09-15 19:47:34 UTC (rev
13920)
@@ -198,7 +198,7 @@
if ($type == 'email')
{
- if ($post_value && (!ereg ('@',
$post_value) || ! ereg ("\.", $post_value)))
+ if ($post_value && (!preg_match ('/@/',
$post_value) || ! preg_match ("/\./", $post_value)))
{
if ($required == 'Y')
{
Modified: trunk/registration/main.php
===================================================================
--- trunk/registration/main.php 2015-09-15 11:45:38 UTC (rev 13919)
+++ trunk/registration/main.php 2015-09-15 19:47:34 UTC (rev 13920)
@@ -153,7 +153,7 @@
/********* Optional classes, which can be disabled for
performance increases *********/
while ($phpgw_class_name =
each($GLOBALS['phpgw_info']['flags']))
{
- if (ereg('enable_', $phpgw_class_name[0]))
+ if (preg_match('/enable_/', $phpgw_class_name[0]))
{
$enable_class = str_replace('enable_', '',
$phpgw_class_name[0]);
$enable_class = str_replace('_class', '',
$enable_class);
Modified: trunk/soap/interop_harness.php
===================================================================
--- trunk/soap/interop_harness.php 2015-09-15 11:45:38 UTC (rev 13919)
+++ trunk/soap/interop_harness.php 2015-09-15 19:47:34 UTC (rev 13920)
@@ -181,7 +181,7 @@
if(get_class($return) == "soapval")
{
// fault?
- if(eregi("fault",$return->name))
+
if(preg_match("/fault/i",$return->name))
{
$status = "failed - got
fault";
}
Modified: trunk/soap/test_methods.php
===================================================================
--- trunk/soap/test_methods.php 2015-09-15 11:45:38 UTC (rev 13919)
+++ trunk/soap/test_methods.php 2015-09-15 19:47:34 UTC (rev 13920)
@@ -214,7 +214,7 @@
{
print "Correctly decoded server's response<br>";
// fault?
- if(eregi('fault',$return->name))
+ if(preg_match('/fault/i',$return->name))
{
$status = 'failed';
}
Modified: trunk/soap.php
===================================================================
--- trunk/soap.php 2015-09-15 11:45:38 UTC (rev 13919)
+++ trunk/soap.php 2015-09-15 19:47:34 UTC (rev 13920)
@@ -71,7 +71,7 @@
include(PHPGW_API_INC.'/functions.inc.php');
$headers = getallheaders();
- if(ereg('Basic',$headers['Authorization']))
+ if(preg_match('/Basic/',$headers['Authorization']))
{
$tmp = $headers['Authorization'];
$tmp = str_replace(' ','',$tmp);
Modified: trunk/todo/inc/class.botodo.inc.php
===================================================================
--- trunk/todo/inc/class.botodo.inc.php 2015-09-15 11:45:38 UTC (rev 13919)
+++ trunk/todo/inc/class.botodo.inc.php 2015-09-15 19:47:34 UTC (rev 13920)
@@ -334,7 +334,7 @@
$error[] = lang('Description can not exceed
8000 characters in length');
}
- if ($values['daysfromstart'] && !
ereg('^[0-9]+$',$values[daysfromstart]))
+ if ($values['daysfromstart'] && !
preg_match('/^[0-9]+$/',$values[daysfromstart]))
{
$error[] = lang('You can only enter numbers for
days from now');
}
Modified: trunk/xmlrpc/server.php
===================================================================
--- trunk/xmlrpc/server.php 2015-09-15 11:45:38 UTC (rev 13919)
+++ trunk/xmlrpc/server.php 2015-09-15 19:47:34 UTC (rev 13920)
@@ -171,8 +171,8 @@
// don't even ask me _why_ these come padded with
// hyphens, I couldn't tell you :p
- $a=ereg_replace("-", "", $a);
- $b=ereg_replace("-", "", $b);
+ $a=preg_replace("/-/", "", $a);
+ $b=preg_replace("/-/", "", $b);
if ($agesorter_arr[$a]==$agesorter[$b]) return 0;
return ($agesorter_arr[$a] > $agesorter_arr[$b]) ? -1 : 1;
Modified: trunk/xmlrpc.php
===================================================================
--- trunk/xmlrpc.php 2015-09-15 11:45:38 UTC (rev 13919)
+++ trunk/xmlrpc.php 2015-09-15 19:47:34 UTC (rev 13920)
@@ -133,7 +133,7 @@
}
if ( isset($headers['Authorization'])
- && ereg('Basic', $headers['Authorization']) )
+ && preg_match('/Basic/', $headers['Authorization']) )
{
$tmp = $headers['Authorization'];
$tmp = str_replace(' ','',$tmp);
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Fmsystem-commits] [13920] convert from deprecated ereg and ereg_replace to preg_match and preg_replace,
Sigurd Nes <=