From 232252475fee23eb006dff7b9878f91a2eb06538 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Mon, 8 Jun 2009 16:21:14 +0000 Subject: [PATCH] patch fixing many depricated functions (eg. posix regular expressions) and features, which fill up the error_log under php5.3 (and will no longer be available under php6). Patch is mostly created by script in egroupware/doc/fix_depricated.php in separate commit. I do NOT advice to apply this patch to a production system (it's commited to trunk!), as the automatic modified regular expressions have a good change to break something ... --- addressbook/csv_import.php | 8 ++-- .../inc/class.addressbook_groupdav.inc.php | 4 +- .../inc/class.addressbook_ldap.inc.php | 2 +- .../inc/class.addressbook_merge.inc.php | 4 +- addressbook/inc/class.addressbook_so.inc.php | 4 +- addressbook/inc/class.addressbook_sql.inc.php | 4 +- .../inc/class.addressbook_tracking.inc.php | 2 +- addressbook/inc/class.addressbook_ui.inc.php | 6 +-- .../inc/class.addressbook_vcal.inc.php | 2 +- addressbook/inc/hook_home.inc.php | 2 +- admin/inc/class.admin_cmd.inc.php | 6 +-- admin/inc/class.admin_cmd_change_pw.inc.php | 2 +- admin/inc/class.bocurrentsessions.inc.php | 2 +- admin/inc/class.customfields.inc.php | 2 +- admin/inc/class.uiaccounts.inc.php | 2 +- admin/inc/class.uiconfig.inc.php | 4 +- calendar/csv_import.php | 10 ++-- calendar/inc/class.bocalendar.inc.php | 2 +- calendar/inc/class.boholiday.inc.php | 2 +- calendar/inc/class.calendar_ajax.inc.php | 2 +- calendar/inc/class.calendar_groupdav.inc.php | 4 +- calendar/inc/class.calendar_ical.inc.php | 8 ++-- calendar/inc/class.calendar_sif.inc.php | 4 +- calendar/inc/class.calendar_so.inc.php | 4 +- calendar/inc/class.sbox.inc.php | 2 +- calendar/inc/class.soholiday.inc.php | 2 +- doc/rpm-build/checkout-build-archives.php | 2 +- doc/rpm-build/rpm_post_install.php | 2 +- .../inc/class.advancedsearch_widget.inc.php | 4 +- .../inc/class.ajax_select_widget.inc.php | 2 +- etemplate/inc/class.date_widget.inc.php | 10 ++-- etemplate/inc/class.db_tools.inc.php | 4 +- etemplate/inc/class.editor.inc.php | 12 ++--- etemplate/inc/class.etemplate.inc.php | 8 ++-- etemplate/inc/class.historylog_widget.inc.php | 4 +- etemplate/inc/class.link_widget.inc.php | 6 +-- etemplate/inc/class.nextmatch_widget.inc.php | 8 ++-- etemplate/inc/class.so_sql.inc.php | 4 +- etemplate/inc/class.soetemplate.inc.php | 8 ++-- etemplate/inc/class.solangfile.inc.php | 4 +- etemplate/inc/class.tab_widget.inc.php | 6 +-- etemplate/inc/class.tree_widget.inc.php | 2 +- etemplate/inc/class.uietemplate_gtk.inc.php | 46 +++++++++--------- etemplate/inc/class.xmltool.inc.php | 16 +++---- etemplate/inc/class.xul_io.inc.php | 42 ++++++++-------- importexport/inc/class.uidefinitions.inc.php | 12 ++--- importexport/inc/class.uiexport.inc.php | 2 +- infolog/csv_import.php | 6 +-- infolog/inc/class.infolog_bo.inc.php | 8 ++-- .../inc/class.infolog_customfields.inc.php | 2 +- infolog/inc/class.infolog_datasource.inc.php | 4 +- infolog/inc/class.infolog_groupdav.inc.php | 4 +- infolog/inc/class.infolog_hooks.inc.php | 2 +- infolog/inc/class.infolog_ical.inc.php | 8 ++-- infolog/inc/class.infolog_sif.inc.php | 12 ++--- infolog/inc/class.infolog_so.inc.php | 2 +- infolog/inc/class.infolog_ui.inc.php | 4 +- infolog/inc/class.infolog_widget.inc.php | 2 +- login.php | 2 +- phpgwapi/inc/adodb/adodb-datadict.inc.php | 2 +- phpgwapi/inc/adodb/adodb-pear.inc.php | 4 +- phpgwapi/inc/adodb/adodb-perf.inc.php | 4 +- phpgwapi/inc/adodb/adodb-time.inc.php | 4 +- phpgwapi/inc/adodb/adodb-xmlschema.inc.php | 4 +- phpgwapi/inc/adodb/adodb.inc.php | 4 +- .../adodb/drivers/adodb-informix72.inc.php | 2 +- phpgwapi/inc/adodb/drivers/adodb-odbc.inc.php | 2 +- .../adodb/drivers/adodb-postgres64.inc.php | 2 +- .../adodb/drivers/adodb-sybase_ase.inc.php | 2 +- .../inc/adodb/session/adodb-encrypt-md5.php | 4 +- phpgwapi/inc/class.accounts_sql.inc.php | 2 +- phpgwapi/inc/class.acl.inc.php | 2 +- phpgwapi/inc/class.asyncservice.inc.php | 2 +- phpgwapi/inc/class.auth_ads.inc.php | 2 +- phpgwapi/inc/class.auth_sql.inc.php | 2 +- phpgwapi/inc/class.browser.inc.php | 16 +++---- phpgwapi/inc/class.common.inc.php | 8 ++-- phpgwapi/inc/class.contenthistory.inc.php | 4 +- phpgwapi/inc/class.egw_db.inc.php | 2 +- phpgwapi/inc/class.egw_framework.inc.php | 2 +- phpgwapi/inc/class.egw_session.inc.php | 4 +- phpgwapi/inc/class.error.inc.php | 2 +- phpgwapi/inc/class.html.inc.php | 8 ++-- phpgwapi/inc/class.http.inc.php | 2 +- phpgwapi/inc/class.interserver.inc.php | 2 +- phpgwapi/inc/class.javascript.inc.php | 2 +- phpgwapi/inc/class.jscalendar.inc.php | 4 +- phpgwapi/inc/class.phpmailer.inc.php | 4 +- phpgwapi/inc/class.soap_client.inc.php | 4 +- phpgwapi/inc/class.soap_parser.inc.php | 16 +++---- phpgwapi/inc/class.soap_server.inc.php | 10 ++-- phpgwapi/inc/class.soapmsg.inc.php | 8 ++-- phpgwapi/inc/class.soapval.inc.php | 4 +- phpgwapi/inc/class.validator.inc.php | 4 +- phpgwapi/inc/class.vcard.inc.php | 20 ++++---- phpgwapi/inc/class.wsdl.inc.php | 2 +- phpgwapi/inc/class.xml.inc.php | 48 +++++++++---------- phpgwapi/inc/class.xmlrpc_client.inc.php | 14 +++--- phpgwapi/inc/class.xmlrpc_server.inc.php | 4 +- phpgwapi/inc/class.xmlrpc_server_epi.inc.php | 6 +-- phpgwapi/inc/class.xmlrpc_server_php.inc.php | 10 ++-- phpgwapi/inc/class.xmlrpcmsg.inc.php | 10 ++-- phpgwapi/inc/class.xmlrpcresp.inc.php | 2 +- phpgwapi/inc/class.xmlrpcval.inc.php | 2 +- phpgwapi/inc/common_functions.inc.php | 18 +++---- phpgwapi/inc/fpdf/tutorial/tuto6.php | 2 +- phpgwapi/inc/functions.inc.php | 5 +- phpgwapi/inc/horde/Horde/Browser/imode.php | 3 +- phpgwapi/inc/horde/Horde/RPC.php | 2 +- phpgwapi/inc/horde/Horde/RPC/syncml.php | 6 +-- phpgwapi/inc/horde/Horde/RPC/syncml_wbxml.php | 4 +- phpgwapi/inc/horde/Horde/SyncML.php | 14 +++--- phpgwapi/inc/horde/Horde/SyncML/Command.php | 2 +- .../inc/horde/Horde/SyncML/Command/Alert.php | 8 ++-- .../inc/horde/Horde/SyncML/Command/Get.php | 2 +- .../inc/horde/Horde/SyncML/Command/Map.php | 2 +- .../inc/horde/Horde/SyncML/Command/Put.php | 2 +- .../horde/Horde/SyncML/Command/Results.php | 2 +- .../inc/horde/Horde/SyncML/Command/Sync.php | 2 +- .../horde/Horde/SyncML/Command/Sync/Add.php | 2 +- .../Horde/SyncML/Command/Sync/Delete.php | 2 +- .../Horde/SyncML/Command/Sync/Replace.php | 2 +- .../Horde/SyncML/Command/Sync/SyncElement.php | 2 +- phpgwapi/inc/horde/Horde/SyncML/State.php | 8 ++-- phpgwapi/inc/horde/Horde/SyncML/State_egw.php | 12 ++--- phpgwapi/inc/horde/Horde/SyncML/Sync.php | 12 ++--- .../SyncML/Sync/RefreshFromServerSync.php | 2 +- .../inc/horde/Horde/SyncML/Sync/SlowSync.php | 2 +- .../horde/Horde/SyncML/Sync/TwoWaySync.php | 6 +-- phpgwapi/inc/horde/Horde/iCalendar.php | 8 ++-- phpgwapi/inc/horde/Horde/iCalendar/vcard.php | 2 +- .../inc/horde/XML/WBXML/ContentHandler.php | 2 +- phpgwapi/inc/horde/XML/WBXML/Decoder.php | 8 ++-- phpgwapi/inc/horde/XML/WBXML/Encoder.php | 6 +-- phpgwapi/inc/horde/lib/base.php | 2 +- phpgwapi/inc/savant2/Savant2.php | 8 ++-- .../Savant2/Savant2_Compiler_basic.php | 2 +- .../inc/savant2/Savant2/tests/1_assign.php | 2 +- .../inc/savant2/Savant2/tests/2_display.php | 2 +- .../inc/savant2/Savant2/tests/3_fetch.php | 2 +- .../inc/savant2/Savant2/tests/4_plugins.php | 2 +- .../inc/savant2/Savant2/tests/5_filters.php | 2 +- .../inc/savant2/Savant2/tests/6_paths.php | 2 +- .../inc/savant2/Savant2/tests/7_include.php | 2 +- .../inc/savant2/Savant2/tests/8_extend.php | 2 +- .../inc/savant2/Savant2/tests/9_errors.php | 2 +- .../inc/savant2/Savant2/tests/compile.php | 4 +- phpgwapi/inc/savant2/Savant2/tests/form.php | 2 +- phpgwapi/inc/savant2/Savant2/tests/form2.php | 2 +- .../tests/templates/compile_bad.tpl.php | 2 +- phpgwapi/inc/xml_functions.inc.php | 12 ++--- phpgwapi/setup/tables_update_1_4.inc.php | 4 +- .../idots/class.idots_framework.inc.php | 8 ++-- preferences/inc/class.ajaxpreferences.inc.php | 2 +- .../inc/class.resources_select_widget.inc.php | 2 +- setup/inc/class.setup_cmd_header.inc.php | 4 +- setup/inc/class.setup_cmd_install.inc.php | 2 +- setup/inc/class.setup_html.inc.php | 2 +- setup/inc/functions.inc.php | 2 +- setup/lang.php | 2 +- setup/manageheader.php | 2 +- setup/setup-cli.php | 2 +- soap.php | 4 +- timesheet/fix_lost_links.php | 4 +- .../inc/class.timesheet_datasource.inc.php | 2 +- timesheet/inc/class.timesheet_ui.inc.php | 4 +- xajax.php | 4 +- xmlrpc.php | 4 +- 168 files changed, 441 insertions(+), 439 deletions(-) diff --git a/addressbook/csv_import.php b/addressbook/csv_import.php index d34b214ce8..4091409d94 100644 --- a/addressbook/csv_import.php +++ b/addressbook/csv_import.php @@ -92,7 +92,7 @@ function cat_id($cats) return ''; } $ids = array(); - foreach(split(' *[,;] *',$cats) as $cat) + foreach(preg_split('/ *[,;] */',$cats) as $cat) { if (is_numeric($cat) && $GLOBALS['egw']->categories->id2name($cat) != '--') { @@ -330,8 +330,8 @@ switch($_POST['action']) { if(ereg((string) $pattern,$val)) { - // echo "

csv_idx='$csv_idx',info='$addr',trans_csv=".print_r($trans_csv).",ereg_replace('$pattern','$replace','$val') = "; - $val = ereg_replace((string) $pattern,str_replace($VPre,'\\',$replace),(string) $val); + // echo "

csv_idx='$csv_idx',info='$addr',trans_csv=".print_r($trans_csv).",preg_replace('/$pattern/','$replace','$val') = "; + $val = preg_replace('/'.(string) $pattern.'/',str_replace($VPre,'\\',$replace),(string) $val); // echo "'$val'

"; $reg = $CPreReg.'([a-zA-Z_0-9]+)'.$CPosReg; @@ -377,7 +377,7 @@ switch($_POST['action']) if (isset($values[$date]) && !is_numeric($date)) { // convert german DD.MM.YYYY format into ISO YYYY-MM-DD format - $values[$date] = ereg_replace('([0-9]{1,2}).([0-9]{1,2}).([0-9]{4})','\3-\2-\1',$values[$date]); + $values[$date] = preg_replace('/([0-9]{1,2}).([0-9]{1,2}).([0-9]{4})/','\3-\2-\1',$values[$date]); // remove fractures of seconds if present at the end of the string if (ereg('(.*)\.[0-9]+',$values[$date],$parts)) $values[$date] = $parts[1]; $values[$date] = strtotime($values[$date]); diff --git a/addressbook/inc/class.addressbook_groupdav.inc.php b/addressbook/inc/class.addressbook_groupdav.inc.php index cd0bb6056b..9c9275bafc 100644 --- a/addressbook/inc/class.addressbook_groupdav.inc.php +++ b/addressbook/inc/class.addressbook_groupdav.inc.php @@ -57,7 +57,7 @@ class addressbook_groupdav extends groupdav_handler { parent::__construct($app,$debug,$base_uri); - $this->bo =& new addressbook_bo(); + $this->bo = new addressbook_bo(); //$this->starttime = microtime(true); } @@ -310,7 +310,7 @@ class addressbook_groupdav extends groupdav_handler */ private function _get_handler() { - $handler =& new addressbook_vcal(); + $handler = new addressbook_vcal(); $handler->setSupportedFields('GroupDAV',$this->agent); return $handler; diff --git a/addressbook/inc/class.addressbook_ldap.inc.php b/addressbook/inc/class.addressbook_ldap.inc.php index fff1a49a34..06b2826dff 100644 --- a/addressbook/inc/class.addressbook_ldap.inc.php +++ b/addressbook/inc/class.addressbook_ldap.inc.php @@ -936,7 +936,7 @@ class addressbook_ldap return $this->_error(__LINE__); // baseDN does NOT exist and we cant/wont create it } // create a admin connection to add the needed DN - $adminLDAP =& new ldap; + $adminLDAP = new ldap; $adminDS = $adminLDAP->ldapConnect(); list(,$ou) = explode(',',$baseDN); diff --git a/addressbook/inc/class.addressbook_merge.inc.php b/addressbook/inc/class.addressbook_merge.inc.php index dadfe45238..48506e7a12 100644 --- a/addressbook/inc/class.addressbook_merge.inc.php +++ b/addressbook/inc/class.addressbook_merge.inc.php @@ -35,7 +35,7 @@ class addressbook_merge // extends bo_merge */ function __construct() { - $this->contacts =& new addressbook_bo(); + $this->contacts = new addressbook_bo(); } /** @@ -131,7 +131,7 @@ class addressbook_merge // extends bo_merge function calendar_replacements($id,$last_event_too=false) { require_once(EGW_INCLUDE_ROOT.'/calendar/inc/class.calendar_boupdate.inc.php'); - $calendar =& new calendar_boupdate(); + $calendar = new calendar_boupdate(); // next events $events = $calendar->search(array( diff --git a/addressbook/inc/class.addressbook_so.inc.php b/addressbook/inc/class.addressbook_so.inc.php index 0ff78328ed..e99a39a5ab 100755 --- a/addressbook/inc/class.addressbook_so.inc.php +++ b/addressbook/inc/class.addressbook_so.inc.php @@ -217,7 +217,7 @@ class addressbook_so if($GLOBALS['egw_info']['server']['contact_repository'] == 'ldap' && $this->account_repository == 'ldap') { $this->contact_repository = 'ldap'; - $this->somain =& new addressbook_ldap(); + $this->somain = new addressbook_ldap(); if ($this->user) // not set eg. in setup { @@ -236,7 +236,7 @@ class addressbook_so { $this->contact_repository = 'sql-ldap'; } - $this->somain =& new addressbook_sql(); + $this->somain = new addressbook_sql(); if ($this->user) // not set eg. in setup { diff --git a/addressbook/inc/class.addressbook_sql.inc.php b/addressbook/inc/class.addressbook_sql.inc.php index 30c602cea8..57c0d43831 100644 --- a/addressbook/inc/class.addressbook_sql.inc.php +++ b/addressbook/inc/class.addressbook_sql.inc.php @@ -516,7 +516,7 @@ class addressbook_sql extends so_sql if ($this->db->select($this->lists_table,'list_id',array( 'list_name' => $name, 'list_owner' => $owner, - ),__LINE__,__FILE__)->fetchSingle()) + ),__LINE__,__FILE__)->fetchColumn()) { return true; // return existing list-id } @@ -551,7 +551,7 @@ class addressbook_sql extends so_sql if ($this->db->select($this->ab2list_table,'list_id',array( 'contact_id' => $contact, 'list_id' => $list, - ),__LINE__,__FILE__)->fetchSingle()) + ),__LINE__,__FILE__)->fetchColumn()) { return true; // no need to insert it, would give sql error } diff --git a/addressbook/inc/class.addressbook_tracking.inc.php b/addressbook/inc/class.addressbook_tracking.inc.php index d5cba6b78c..916448c01e 100644 --- a/addressbook/inc/class.addressbook_tracking.inc.php +++ b/addressbook/inc/class.addressbook_tracking.inc.php @@ -92,7 +92,7 @@ class addressbook_tracking extends bo_tracking case 'copy': if ($data['is_contactform']) { - return split(', ?',$data['email_contactform']); + return preg_split('/, ?/',$data['email_contactform']); } break; diff --git a/addressbook/inc/class.addressbook_ui.inc.php b/addressbook/inc/class.addressbook_ui.inc.php index b4d1b0b932..48faa8af8c 100644 --- a/addressbook/inc/class.addressbook_ui.inc.php +++ b/addressbook/inc/class.addressbook_ui.inc.php @@ -421,7 +421,7 @@ class addressbook_ui extends addressbook_bo $query['filter2'] = (int)$list; $this->action($email_type,array(),true,$success,$failed,$action_msg,$query,$msg); - $response =& new xajaxResponse(); + $response = new xajaxResponse(); if ($success) $response->addScript($GLOBALS['egw']->js->body['onLoad']); @@ -1497,7 +1497,7 @@ class addressbook_ui extends addressbook_bo 'n_suffix' => $n_suffix, 'org_name' => $org_name, ); - $response =& new xajaxResponse(); + $response = new xajaxResponse(); $response->addScript("setOptions('".addslashes(implode("\b",$this->fileas_options($names)))."');"); return $response->getXML(); @@ -2003,7 +2003,7 @@ $readonlys['button[vcard]'] = true; return lang("Document '%1' does not exist or is not readable for you!",$document); } require_once(EGW_INCLUDE_ROOT.'/addressbook/inc/class.addressbook_merge.inc.php'); - $document_merge =& new addressbook_merge(); + $document_merge = new addressbook_merge(); return $document_merge->download($document,$ids); } diff --git a/addressbook/inc/class.addressbook_vcal.inc.php b/addressbook/inc/class.addressbook_vcal.inc.php index cd0970352f..8a718a8973 100644 --- a/addressbook/inc/class.addressbook_vcal.inc.php +++ b/addressbook/inc/class.addressbook_vcal.inc.php @@ -64,7 +64,7 @@ class addressbook_vcal extends addressbook_bo { require_once(EGW_SERVER_ROOT.'/phpgwapi/inc/horde/Horde/iCalendar/vcard.php'); - $vCard =& new Horde_iCalendar_vcard; + $vCard = new Horde_iCalendar_vcard; if(!is_array($this->supportedFields)) { $this->setSupportedFields(); diff --git a/addressbook/inc/hook_home.inc.php b/addressbook/inc/hook_home.inc.php index abe1ddd6fe..d0ea313c0c 100644 --- a/addressbook/inc/hook_home.inc.php +++ b/addressbook/inc/hook_home.inc.php @@ -15,7 +15,7 @@ if ($GLOBALS['egw_info']['user']['apps']['addressbook'] && if (!(int) $days) $days = 1; // old pref - $contacts =& new addressbook_bo(); + $contacts = new addressbook_bo(); $month_start = date('*-m-*',$contacts->now_su); $bdays =& $contacts->search(array('bday' => $month_start),array('id','n_family','n_given','bday'),'n_given,n_family'); diff --git a/admin/inc/class.admin_cmd.inc.php b/admin/inc/class.admin_cmd.inc.php index 7747fd51f6..15043050dc 100644 --- a/admin/inc/class.admin_cmd.inc.php +++ b/admin/inc/class.admin_cmd.inc.php @@ -487,7 +487,7 @@ abstract class admin_cmd * @param mixed $value * @return mixed */ - protected function __set($property,$value) + function __set($property,$value) { $this->data[$property] = $value; } @@ -497,7 +497,7 @@ abstract class admin_cmd * * @param string $property */ - protected function __unset($property) + function __unset($property) { unset($this->data[$property]); } @@ -795,7 +795,7 @@ abstract class admin_cmd return admin_cmd::run_queued_jobs(); } include_once(EGW_API_INC.'/class.asyncservice.inc.php'); - $async =& new asyncservice(); + $async = new asyncservice(); // we cant use this class as callback, as it's abstract and ExecMethod used by the async service instanciated the class! list($app) = explode('_',$class=$next['type']); diff --git a/admin/inc/class.admin_cmd_change_pw.inc.php b/admin/inc/class.admin_cmd_change_pw.inc.php index 939c9c1b29..211ea10777 100644 --- a/admin/inc/class.admin_cmd_change_pw.inc.php +++ b/admin/inc/class.admin_cmd_change_pw.inc.php @@ -50,7 +50,7 @@ class admin_cmd_change_pw extends admin_cmd if ($check_only) return true; - $auth =& new auth; + $auth = new auth; if (!$auth->change_password(null, $this->password, $account_id)) { diff --git a/admin/inc/class.bocurrentsessions.inc.php b/admin/inc/class.bocurrentsessions.inc.php index 06a6fd8034..814b7d4b34 100644 --- a/admin/inc/class.bocurrentsessions.inc.php +++ b/admin/inc/class.bocurrentsessions.inc.php @@ -33,7 +33,7 @@ { if (ereg('@',$value['session_lid'])) { - $t = split('@',$value['session_lid']); + $t = explode('@',$value['session_lid']); $session_lid = $t[0]; } else diff --git a/admin/inc/class.customfields.inc.php b/admin/inc/class.customfields.inc.php index 4eb1594743..0276abd154 100644 --- a/admin/inc/class.customfields.inc.php +++ b/admin/inc/class.customfields.inc.php @@ -230,7 +230,7 @@ class customfields { foreach(explode("\n",$field['values']) as $line) { - list($var,$value) = split('=',trim($line),2); + list($var,$value) = explode('=',trim($line),2); $var = trim($var); $values[$var] = empty($value) ? $var : $value; } diff --git a/admin/inc/class.uiaccounts.inc.php b/admin/inc/class.uiaccounts.inc.php index 70e0c108b0..dcc160d26f 100755 --- a/admin/inc/class.uiaccounts.inc.php +++ b/admin/inc/class.uiaccounts.inc.php @@ -1583,7 +1583,7 @@ function ajax_check_account_email($first,$last,$account_lid,$account_id,$email,$id) { - $response =& new xajaxResponse(); + $response = new xajaxResponse(); if (!$email) { $response->addAssign('email','value',$GLOBALS['egw']->common->email_address($first,$last,$account_lid)); diff --git a/admin/inc/class.uiconfig.inc.php b/admin/inc/class.uiconfig.inc.php index 5aec610fd6..9c0f8b8c7f 100644 --- a/admin/inc/class.uiconfig.inc.php +++ b/admin/inc/class.uiconfig.inc.php @@ -108,7 +108,7 @@ } } /* don't erase passwords, since we also don't print them */ - elseif(!ereg('passwd',$key) && !ereg('password',$key) && !ereg('root_pw',$key)) + elseif(strpos($key,'passwd') === false && strpos($key,'password') === false && strpos($key,'root_pw') === false) { unset($c->config_data[$key]); } @@ -181,7 +181,7 @@ case 'value': $newval = str_replace(' ','_',$newval); /* Don't show passwords in the form */ - if(ereg('passwd',$value) || ereg('password',$value) || ereg('root_pw',$value)) + if(strpos($value,'passwd') !== false || strpos($value,'password') !== false || strpos($value,'root_pw') !== false) { $t->set_var($value,''); } diff --git a/calendar/csv_import.php b/calendar/csv_import.php index 317f793db4..bdb66695f4 100644 --- a/calendar/csv_import.php +++ b/calendar/csv_import.php @@ -104,7 +104,7 @@ function cat_id($cats) return ''; } - foreach(split('[,;]',$cats) as $cat) + foreach(preg_split('/[,;]/',$cats) as $cat) { if (isset($cat2id[$cat])) { @@ -374,8 +374,8 @@ case 'import': { if (ereg((string) $pattern,$val)) { - //echo "

csv_idx='$csv_idx',info='$info',trans_csv=".print_r($trans_csv).",ereg_replace('$pattern','$replace','$val') = "; - $val = ereg_replace((string) $pattern,str_replace($VPre,'\\',$replace),(string) $val); + //echo "

csv_idx='$csv_idx',info='$info',trans_csv=".print_r($trans_csv).",preg_replace('/$pattern/','$replace','$val') = "; + $val = preg_replace('/'.(string) $pattern.'/',str_replace($VPre,'\\',$replace),(string) $val); //echo "'$val'"; $reg = $CPreReg.'([a-zA-Z_0-9 ]+)'.$CPosReg; @@ -440,14 +440,14 @@ case 'import': if (isset($values[$date]) && !is_numeric($date)) { // convert german DD.MM.YYYY format into ISO YYYY-MM-DD format - $values[$date] = ereg_replace('([0-9]{1,2}).([0-9]{1,2}).([0-9]{4})','\3-\2-\1',$values[$date]); + $values[$date] = preg_replace('/([0-9]{1,2}).([0-9]{1,2}).([0-9]{4})/','\3-\2-\1',$values[$date]); // remove fractures of seconds if present at the end of the string if (ereg('(.*)\.[0-9]+',$values[$date],$parts)) $values[$date] = $parts[1]; $values[$date] = strtotime($values[$date]); } } // convert participants-names to user-id's - $parts = $values['participants'] ? split('[,;]',$values['participants']) : array(); + $parts = $values['participants'] ? preg_split('/[,;]/',$values['participants']) : array(); $values['participants'] = array(); foreach($parts as $part_status) { diff --git a/calendar/inc/class.bocalendar.inc.php b/calendar/inc/class.bocalendar.inc.php index 66236cba0a..cb8d0f095a 100755 --- a/calendar/inc/class.bocalendar.inc.php +++ b/calendar/inc/class.bocalendar.inc.php @@ -35,7 +35,7 @@ class bocalendar function __construct() { - $this->cal =& new calendar_boupdate(); + $this->cal = new calendar_boupdate(); if (is_object($GLOBALS['server']) && $GLOBALS['server']->simpledate) { diff --git a/calendar/inc/class.boholiday.inc.php b/calendar/inc/class.boholiday.inc.php index f541d84931..58be3188f0 100755 --- a/calendar/inc/class.boholiday.inc.php +++ b/calendar/inc/class.boholiday.inc.php @@ -301,7 +301,7 @@ // reading the holidayfile from egroupware.org via network::gethttpsocketfile contains all the headers! foreach($lines as $n => $line) { - $fields = split("[\t\n ]+",$line); + $fields = preg_split("/[\t\n ]+/",$line); if ($fields[0] == 'charset' && $fields[1]) { diff --git a/calendar/inc/class.calendar_ajax.inc.php b/calendar/inc/class.calendar_ajax.inc.php index 8e2f16eaf9..a76b0aa21f 100644 --- a/calendar/inc/class.calendar_ajax.inc.php +++ b/calendar/inc/class.calendar_ajax.inc.php @@ -52,7 +52,7 @@ class calendar_ajax { $conflicts=$this->calendar->update($event); - $response =& new xajaxResponse(); + $response = new xajaxResponse(); if(!is_array($conflicts)) { $response->addRedirect(''); diff --git a/calendar/inc/class.calendar_groupdav.inc.php b/calendar/inc/class.calendar_groupdav.inc.php index 00db6f0bce..b9b78e2836 100644 --- a/calendar/inc/class.calendar_groupdav.inc.php +++ b/calendar/inc/class.calendar_groupdav.inc.php @@ -47,7 +47,7 @@ class calendar_groupdav extends groupdav_handler { parent::__construct($app,$debug,$base_uri); - $this->bo =& new calendar_boupdate(); + $this->bo = new calendar_boupdate(); } const PATH_ATTRIBUTE = 'id'; @@ -425,7 +425,7 @@ class calendar_groupdav extends groupdav_handler */ private function _get_handler() { - $handler =& new calendar_ical(); + $handler = new calendar_ical(); $handler->setSupportedFields('GroupDAV',$this->agent); if ($this->debug > 1) error_log("ical Handler called:" . $this->agent); return $handler; diff --git a/calendar/inc/class.calendar_ical.inc.php b/calendar/inc/class.calendar_ical.inc.php index 22555f2c66..ab46449f65 100644 --- a/calendar/inc/class.calendar_ical.inc.php +++ b/calendar/inc/class.calendar_ical.inc.php @@ -145,7 +145,7 @@ class calendar_ical extends calendar_boupdate $palm_enddate_workaround=True; } - $vcal = &new Horde_iCalendar; + $vcal = new Horde_iCalendar; $vcal->setAttribute('PRODID','-//eGroupWare//NONSGML eGroupWare Calendar '.$GLOBALS['egw_info']['apps']['calendar']['version'].'//'. strtoupper($GLOBALS['egw_info']['user']['preferences']['common']['lang'])); $vcal->setAttribute('VERSION',$version); @@ -516,7 +516,7 @@ class calendar_ical extends calendar_boupdate { // our (patched) horde classes, do NOT unfold folded lines, which causes a lot trouble in the import $_vcalData = preg_replace("/[\r\n]+ /",'',$_vcalData); - $vcal = &new Horde_iCalendar; + $vcal = new Horde_iCalendar; if(!$vcal->parsevCalendar($_vcalData)) { return FALSE; @@ -1331,7 +1331,7 @@ class calendar_ical extends calendar_boupdate // our (patched) horde classes, do NOT unfold folded lines, which causes a lot trouble in the import $_vcalData = preg_replace("/[\r\n]+ /",'',$_vcalData); - $vcal = &new Horde_iCalendar; + $vcal = new Horde_iCalendar; if(!$vcal->parsevCalendar($_vcalData)) { return FALSE; @@ -1662,7 +1662,7 @@ class calendar_ical extends calendar_boupdate { if (!$end) $end = $this->now_su + 100*DAY_s; // default next 100 days - $vcal = &new Horde_iCalendar; + $vcal = new Horde_iCalendar; $vcal->setAttribute('PRODID','-//eGroupWare//NONSGML eGroupWare Calendar '.$GLOBALS['egw_info']['apps']['calendar']['version'].'//'. strtoupper($GLOBALS['egw_info']['user']['preferences']['common']['lang'])); $vcal->setAttribute('VERSION','2.0'); diff --git a/calendar/inc/class.calendar_sif.inc.php b/calendar/inc/class.calendar_sif.inc.php index f47a8ef9e6..85c1338a8e 100644 --- a/calendar/inc/class.calendar_sif.inc.php +++ b/calendar/inc/class.calendar_sif.inc.php @@ -84,7 +84,7 @@ class calendar_sif extends calendar_boupdate } function siftoegw($_sifdata) { - $vcal = &new Horde_iCalendar; + $vcal = new Horde_iCalendar; $finalEvent = array(); $sysCharSet = $GLOBALS['egw']->translation->charset(); $sifData = base64_decode($_sifdata); @@ -324,7 +324,7 @@ class calendar_sif extends calendar_boupdate if($event = $this->read($_id,null,false,'server')) { $sysCharSet = $GLOBALS['egw']->translation->charset(); - $vcal = &new Horde_iCalendar; + $vcal = new Horde_iCalendar; $sifEvent = ''; diff --git a/calendar/inc/class.calendar_so.inc.php b/calendar/inc/class.calendar_so.inc.php index 26ecc626e1..8d07d90ce9 100644 --- a/calendar/inc/class.calendar_so.inc.php +++ b/calendar/inc/class.calendar_so.inc.php @@ -583,7 +583,7 @@ ORDER BY cal_user_type, cal_usre_id if ($set_recurrences) { // delete all, but the lowest dates record - $min = (int) $this->db->select($this->dates_table,'MIN(cal_start)',array('cal_id'=>$cal_id),__LINE__,__FILE__,false,'','calendar')->fetchSingle(); + $min = (int) $this->db->select($this->dates_table,'MIN(cal_start)',array('cal_id'=>$cal_id),__LINE__,__FILE__,false,'','calendar')->fetchColumn(); $this->db->delete($this->dates_table,array( 'cal_id' => $cal_id, @@ -657,7 +657,7 @@ ORDER BY cal_user_type, cal_usre_id } if (is_null($etag)) { - $etag = $this->db->select($this->cal_table,'cal_etag',array('cal_id' => $cal_id),__LINE__,__FILE__,false,'','calendar')->fetchSingle(); + $etag = $this->db->select($this->cal_table,'cal_etag',array('cal_id' => $cal_id),__LINE__,__FILE__,false,'','calendar')->fetchColumn(); } return $cal_id; } diff --git a/calendar/inc/class.sbox.inc.php b/calendar/inc/class.sbox.inc.php index 58038b6c40..c641087742 100644 --- a/calendar/inc/class.sbox.inc.php +++ b/calendar/inc/class.sbox.inc.php @@ -265,7 +265,7 @@ "group" => "Group public" ); - if (ereg(",", $selected)) + if (strpos($selected,",") !== false) { $selected = "group"; } diff --git a/calendar/inc/class.soholiday.inc.php b/calendar/inc/class.soholiday.inc.php index 15d5f6c274..442d9d8a62 100755 --- a/calendar/inc/class.soholiday.inc.php +++ b/calendar/inc/class.soholiday.inc.php @@ -192,7 +192,7 @@ class soholiday echo 'HOLIDAY_TOTAL : '.$where.'
'."\n"; } - $retval = $this->db->select($this->table,'count(*)',$where,__LINE__,__FILE__,false,'','calendar')->fetchSingle(); + $retval = $this->db->select($this->table,'count(*)',$where,__LINE__,__FILE__,false,'','calendar')->fetchColumn(); if($this->debug) { diff --git a/doc/rpm-build/checkout-build-archives.php b/doc/rpm-build/checkout-build-archives.php index 9f125618ee..28cfc7b2c1 100755 --- a/doc/rpm-build/checkout-build-archives.php +++ b/doc/rpm-build/checkout-build-archives.php @@ -71,7 +71,7 @@ while(($arg = array_shift($argv))) } else { - $config[$name] = array_unique(split('[ ,]+',$value)); + $config[$name] = array_unique(preg_split('/[ ,]+/',$value)); } break; diff --git a/doc/rpm-build/rpm_post_install.php b/doc/rpm-build/rpm_post_install.php index 7b0b4fa822..846153ff8e 100755 --- a/doc/rpm-build/rpm_post_install.php +++ b/doc/rpm-build/rpm_post_install.php @@ -46,7 +46,7 @@ $config = array( // read language from LANG enviroment variable if (($lang = isset($_ENV['LANG']) ? $_ENV['LANG'] : $_SERVER['LANG'])) { - list($lang,$nat) = split('[_.]',$lang); + list($lang,$nat) = preg_split('/[_.]/',$lang); if (in_array($lang.'-'.strtolower($nat),array('es-es','pt-br','zh-tw'))) { $lang .= '-'.strtolower($nat); diff --git a/etemplate/inc/class.advancedsearch_widget.inc.php b/etemplate/inc/class.advancedsearch_widget.inc.php index 3422242bd6..b270f40faf 100644 --- a/etemplate/inc/class.advancedsearch_widget.inc.php +++ b/etemplate/inc/class.advancedsearch_widget.inc.php @@ -76,7 +76,7 @@ (is_array($GLOBALS['egw']->session->appsession('advanced_search_query',$GLOBALS['egw_info']['flags']['currentapp'])) ? $GLOBALS['egw']->session->appsession('advanced_search_query',$GLOBALS['egw_info']['flags']['currentapp']) : $value); - $tpl =& new etemplate; + $tpl = new etemplate; $tpl->init('*** generated advanced search widget','','',0,'',0,0); // make an empty template if($extension_data['message']) @@ -96,7 +96,7 @@ // 'width' => '800px', ))); - $result_rows_tpl =& new etemplate; + $result_rows_tpl = new etemplate; $result_rows_tpl->init('*** generated rows template for advanced search results','','',0,'',0,0); $grid =& $result_rows_tpl->children[0]; foreach((array)$extension_data['colums_to_present'] as $field => $label) diff --git a/etemplate/inc/class.ajax_select_widget.inc.php b/etemplate/inc/class.ajax_select_widget.inc.php index f2d6403734..e984c2e6a3 100644 --- a/etemplate/inc/class.ajax_select_widget.inc.php +++ b/etemplate/inc/class.ajax_select_widget.inc.php @@ -146,7 +146,7 @@ class ajax_select_widget $cell['type'] = 'template'; $cell['size'] = $cell['name']; $value = array('value' => $current_value, 'search' => $title); - $widget =& new etemplate('etemplate.ajax_select_widget'); + $widget = new etemplate('etemplate.ajax_select_widget'); $widget->no_onclick = True; // Link if readonly & link is set diff --git a/etemplate/inc/class.date_widget.inc.php b/etemplate/inc/class.date_widget.inc.php index 8e61f8033d..5e1663c4ab 100644 --- a/etemplate/inc/class.date_widget.inc.php +++ b/etemplate/inc/class.date_widget.inc.php @@ -113,9 +113,9 @@ class date_widget } elseif ($data_format != '') { - $date = split('[- /.:,]',$value); + $date = preg_split('/[- \\/.:,]/',$value); //echo "date=

"; print_r($date); echo "
"; - $mdy = split('[- /.:,]',$data_format); + $mdy = preg_split('/[- \\/.:,]/',$data_format); if (count($mdy) == 1) // no seperators, eg. YmdHi { @@ -166,7 +166,7 @@ class date_widget $value['H'] = $value['H'] % 12 ? $value['H'] % 12 : 12; // no leading 0 and 0h => 12am $timeformat += array(5 => 'a'); } - $format = split('[/.-]',$this->dateformat); + $format = preg_split('/[\\/.-]/',$this->dateformat); // no time also if $options&8 and readonly and time=0h0 if ($type != 'date' && !($readonly && ($options & 8) && $time_0h0)) @@ -235,7 +235,7 @@ class date_widget 'needed' => $cell['needed'], )); } - $tpl =& new etemplate; + $tpl = new etemplate; $tpl->init('*** generated fields for date','','',0,'',0,0); // make an empty template // keep the editor away from the generated tmpls $tpl->no_onclick = true; @@ -410,7 +410,7 @@ class date_widget 'value' => $value, 'unit' => $unit, ); - $tpl =& new etemplate; + $tpl = new etemplate; $tpl->init('*** generated fields for duration','','',0,'',0,0); // make an empty template // keep the editor away from the generated tmpls $tpl->no_onclick = true; diff --git a/etemplate/inc/class.db_tools.inc.php b/etemplate/inc/class.db_tools.inc.php index 91462aca3b..6c7004132c 100644 --- a/etemplate/inc/class.db_tools.inc.php +++ b/etemplate/inc/class.db_tools.inc.php @@ -330,7 +330,7 @@ class db_tools $new_version[$minor] = sprintf('%03d',1+$new_version[$minor]); $content['new_version'] = implode('.',$new_version); - $tmpl =& new etemplate('etemplate.db-tools.ask_save'); + $tmpl = new etemplate('etemplate.db-tools.ask_save'); if (!file_exists(EGW_SERVER_ROOT."/$posted_app/setup/tables_current.inc.php")) { @@ -516,7 +516,7 @@ class db_tools $opts = array(); foreach(explode(',',$col['options']) as $opt) { - list($db,$opt) = split('[(:)]',$opt); + list($db,$opt) = preg_split('/[(:)]/',$opt); $opts[$db] = is_numeric($opt) ? intval($opt) : $opt; } $table[$prop][] = array( diff --git a/etemplate/inc/class.editor.inc.php b/etemplate/inc/class.editor.inc.php index 8c6d9aed05..412100f65c 100644 --- a/etemplate/inc/class.editor.inc.php +++ b/etemplate/inc/class.editor.inc.php @@ -276,7 +276,7 @@ class editor { $content[$row] = $param; } - $list_result =& new etemplate('etemplate.editor.list_result'); + $list_result = new etemplate('etemplate.editor.list_result'); $GLOBALS['egw_info']['flags']['app_header'] = lang('Editable Templates - Search'); $list_result->exec('etemplate.editor.list_result',$content,'','',array( 'result' => $result, @@ -465,7 +465,7 @@ class editor 'xml' => $xml ? '
'.html::htmlspecialchars($xml)."
\n" : '', ); - $editor =& new etemplate('etemplate.editor.new'); + $editor = new etemplate('etemplate.editor.new'); if (!$msg && isset($content['values']) && !isset($content['vals'])) { $r = 1; @@ -1337,8 +1337,8 @@ class editor $content['cell']['options'] = explode(',',$content['cell']['size']); - $editor =& new etemplate('etemplate.editor.widget'); - $type_tmpl =& new etemplate; + $editor = new etemplate('etemplate.editor.widget'); + $type_tmpl = new etemplate; list($ext_type) = explode('-',$widget['type']); // allow to read template of app-specific widgets from their app: eg. "infolog-value" --> "infolog.widget.infolog-value" @@ -1488,7 +1488,7 @@ class editor 'java_script' => $js ? '' : '', 'msg' => $msg ); - $tmpl =& new etemplate('etemplate.editor.styles'); + $tmpl = new etemplate('etemplate.editor.styles'); if ($content['from']) { @@ -1542,7 +1542,7 @@ class editor $dir = @opendir(EGW_SERVER_ROOT.'/'.$app.'/inc'); while ($dir && ($file = readdir($dir))) { - if (ereg('class\\.([a-zA-Z0-9_]*)_widget.inc.php',$file,$regs) && + if (preg_match('/class\\.([a-zA-Z0-9_]*)_widget.inc.php/',$file,$regs) && ($regs[1] != 'xslt' || $this->etemplate->xslt) && ($ext = $this->etemplate->loadExtension($regs[1].'.'.$app,$this->etemplate))) { diff --git a/etemplate/inc/class.etemplate.inc.php b/etemplate/inc/class.etemplate.inc.php index 03b839e7f9..d5b980aa62 100644 --- a/etemplate/inc/class.etemplate.inc.php +++ b/etemplate/inc/class.etemplate.inc.php @@ -309,7 +309,7 @@ class etemplate extends boetemplate echo '
'."\n"; if ($GLOBALS['egw_info']['user']['apps']['manual']) // adding a manual icon to every popup { - $manual =& new etemplate('etemplate.popup.manual'); + $manual = new etemplate('etemplate.popup.manual'); echo $manual->show(array()); unset($manual); echo ''."\n"; @@ -1331,7 +1331,7 @@ class etemplate extends boetemplate $obj_read = 'already loaded'; if (is_array($cell['obj'])) { - $obj =& new etemplate(); + $obj = new etemplate(); $obj->init($cell['obj']); $cell['obj'] =& $obj; unset($obj); @@ -1344,12 +1344,12 @@ class etemplate extends boetemplate $obj_read = is_object($cell['obj']) ? 'obj from content' : 'obj read, obj-name from content'; if (!is_object($cell['obj'])) { - $cell['obj'] =& new etemplate($cell['obj'],$this->as_array()); + $cell['obj'] = new etemplate($cell['obj'],$this->as_array()); } } else { $obj_read = 'obj read'; - $cell['obj'] =& new etemplate($name,$this->as_array()); + $cell['obj'] = new etemplate($name,$this->as_array()); } } if (is_int($this->debug) && $this->debug >= 3 || $this->debug == $cell['type']) diff --git a/etemplate/inc/class.historylog_widget.inc.php b/etemplate/inc/class.historylog_widget.inc.php index ed62c7351b..c2cf819b59 100644 --- a/etemplate/inc/class.historylog_widget.inc.php +++ b/etemplate/inc/class.historylog_widget.inc.php @@ -61,14 +61,14 @@ class historylog_widget $status_widgets = is_array($value) && isset($value['status-widgets']) ? $value['status-widgets'] : null; $id = is_array($value) ? $value['id'] : $value; - $historylog =& new historylog($app); + $historylog = new historylog($app); if (!$id || method_exists($historylog,'search')) { $value = $id ? $historylog->search($id) : false; } unset($historylog); - $tpl =& new etemplate; + $tpl = new etemplate; $tpl->init('*** generated fields for historylog','','',0,'',0,0); // make an empty template // keep the editor away from the generated tmpls $tpl->no_onclick = true; diff --git a/etemplate/inc/class.link_widget.inc.php b/etemplate/inc/class.link_widget.inc.php index f9bb0919c9..210e64278f 100644 --- a/etemplate/inc/class.link_widget.inc.php +++ b/etemplate/inc/class.link_widget.inc.php @@ -254,7 +254,7 @@ class link_widget // modify add_app default to the action used as value if (isset($value['add_app']) && $app == $value['add_app']) $value['add_app'] = $action; } - $tpl =& new etemplate('etemplate.link_widget.add'); + $tpl = new etemplate('etemplate.link_widget.add'); break; case 'link-to': @@ -288,7 +288,7 @@ class link_widget return True; } $value['link_list_format'] = $GLOBALS['egw_info']['user']['preferences']['common']['link_list_format']; - $tpl =& new etemplate('etemplate.link_widget.list'); + $tpl = new etemplate('etemplate.link_widget.list'); for($row=$tpl->rows-1; list(,$link) = each($links); ++$row) { $value[$row] = $link; @@ -324,7 +324,7 @@ class link_widget case 'link-entry': $GLOBALS['egw_info']['flags']['include_xajax'] = true; - $tpl =& new etemplate('etemplate.link_widget.entry'); + $tpl = new etemplate('etemplate.link_widget.entry'); $options = $cell['size'] ? explode(',',$cell['size']) : array(); $app = $extension_data['app'] = $options[0]; // handle extra args for onclick like: values2url(this.form,'start,end,duration,participants,recur_type,whole_day')+'&exec[event_id]= diff --git a/etemplate/inc/class.nextmatch_widget.inc.php b/etemplate/inc/class.nextmatch_widget.inc.php index 4da07089b1..71e6a1de03 100644 --- a/etemplate/inc/class.nextmatch_widget.inc.php +++ b/etemplate/inc/class.nextmatch_widget.inc.php @@ -363,7 +363,7 @@ class nextmatch_widget } if (!is_object($value['template'])) { - $value['template'] =& new etemplate($value['template'],$tmpl->as_array()); + $value['template'] = new etemplate($value['template'],$tmpl->as_array()); } if (is_array($value['rows'][0])) // pad 0 based arrays with rows-1 false values { @@ -386,7 +386,7 @@ class nextmatch_widget { // disable whole nextmatch line if no scrolling necessary if ($value['header_left'] || $value['header_right']) { - $nextmatch =& new etemplate('etemplate.nextmatch_widget.header_only'); + $nextmatch = new etemplate('etemplate.nextmatch_widget.header_only'); $cell['size'] = $cell['name']; $cell['obj'] = &$nextmatch; $cell['name'] = $nextmatch->name; @@ -400,7 +400,7 @@ class nextmatch_widget } else { - $nextmatch =& new etemplate('etemplate.nextmatch_widget'); + $nextmatch = new etemplate('etemplate.nextmatch_widget'); $nextmatch->read('etemplate.nextmatch_widget'); // keep the editor away from the generated tmpls $nextmatch->no_onclick = true; @@ -1129,7 +1129,7 @@ class nextmatch_widget if ($app) { include_once(EGW_API_INC.'/class.config.inc.php'); - $config =& new config($app); + $config = new config($app); $config->read_repository(); $customfields = isset($config->config_data['customfields']) ? $config->config_data['customfields'] : $config->config_data['custom_fields']; diff --git a/etemplate/inc/class.so_sql.inc.php b/etemplate/inc/class.so_sql.inc.php index 46a99f59f1..f33c8233d5 100644 --- a/etemplate/inc/class.so_sql.inc.php +++ b/etemplate/inc/class.so_sql.inc.php @@ -841,7 +841,7 @@ class so_sql } elseif (!$need_full_no_count && (!$join || stripos($join,'LEFT JOIN')!==false)) { - $this->total = $this->db->select($this->table_name,'COUNT(*)',$query,__LINE__,__FILE__,false,'',$this->app,0,$join)->fetchSingle(); + $this->total = $this->db->select($this->table_name,'COUNT(*)',$query,__LINE__,__FILE__,false,'',$this->app,0,$join)->fetchColumn(); } else // cant do a count, have to run the query without limit { @@ -857,7 +857,7 @@ class so_sql if ($mysql_calc_rows) { - $this->total = $this->db->query('SELECT FOUND_ROWS()')->fetchSingle(); + $this->total = $this->db->query('SELECT FOUND_ROWS()')->fetchColumn(); } $arr = array(); if ($rs) foreach($rs as $row) diff --git a/etemplate/inc/class.soetemplate.inc.php b/etemplate/inc/class.soetemplate.inc.php index c7248763fb..86c14e4ba8 100644 --- a/etemplate/inc/class.soetemplate.inc.php +++ b/etemplate/inc/class.soetemplate.inc.php @@ -953,7 +953,7 @@ class soetemplate $tpls = $this->search($app); - $tpl =& new soetemplate; // to not alter our own data + $tpl = new soetemplate; // to not alter our own data while (list(,$keys) = each($tpls)) { @@ -1062,7 +1062,7 @@ class soetemplate $templ_version=0; include($path = EGW_SERVER_ROOT."/$app/setup/etemplates.inc.php"); - $templ =& new etemplate($app); + $templ = new etemplate($app); foreach($templ_data as $data) { @@ -1106,7 +1106,7 @@ class soetemplate if ($time = @filemtime($path)) { - $templ =& new soetemplate(".$app",'','##'); + $templ = new soetemplate(".$app",'','##'); if ($templ->lang != '##' || $templ->modified < $time) // need to import { $ret = self::import_dump($app); @@ -1288,7 +1288,7 @@ class soetemplate case 'template': if (!isset($widget['obj']) && $widget['name'][0] != '@') { - $widget['obj'] =& new etemplate; + $widget['obj'] = new etemplate; if (!$widget['obj']->read($widget['name'])) $widget['obj'] = false; } if (!is_object($widget['obj'])) break; // cant descent into template diff --git a/etemplate/inc/class.solangfile.inc.php b/etemplate/inc/class.solangfile.inc.php index a12bd2967c..5338e882e6 100644 --- a/etemplate/inc/class.solangfile.inc.php +++ b/etemplate/inc/class.solangfile.inc.php @@ -74,7 +74,7 @@ class solangfile } foreach($lines as $n => $line) { - while (ereg('\{lang_([^}]+)\}(.*)',$line,$found)) + while (preg_match('/\{lang_([^}]+)\}(.*)/',$line,$found)) { $lang = str_replace('_',' ',$found[1]); $this->plist[$lang] = $app; @@ -256,7 +256,7 @@ class solangfile } $rest = substr($rest,$next+1); } - if(!ereg("[ \t\n]*,[ \t\n]*(.*)$",$rest,$parts)) + if(!preg_match('/'."[ \t\n]*,[ \t\n]*(.*)$".'/',$rest,$parts)) { break; // nothing found } diff --git a/etemplate/inc/class.tab_widget.inc.php b/etemplate/inc/class.tab_widget.inc.php index 2d24624263..1fb0dce492 100644 --- a/etemplate/inc/class.tab_widget.inc.php +++ b/etemplate/inc/class.tab_widget.inc.php @@ -86,7 +86,7 @@ } $all_names = implode('|',$names); - $tab_widget =& new etemplate('etemplate.tab_widget'); + $tab_widget = new etemplate('etemplate.tab_widget'); $tab_widget->no_onclick = true; if ($value && strpos($value,'.') === false) @@ -150,7 +150,7 @@ foreach($names as $n => $name) { $bcell = $tab_widget->empty_cell('template',$name); - $bcell['obj'] =& new etemplate($name,$tmpl->as_array()); + $bcell['obj'] = new etemplate($name,$tmpl->as_array()); $tab_widget->set_cell_attribute('body',$n+1,$bcell); } $tab_widget->set_cell_attribute('body','type','deck'); @@ -160,7 +160,7 @@ } else { - $stab =& new etemplate($selected_tab,$tmpl->as_array()); + $stab = new etemplate($selected_tab,$tmpl->as_array()); $tab_widget->set_cell_attribute('body','type','template'); $tab_widget->set_cell_attribute('body','size',''); // the deck has a '1' there $tab_widget->set_cell_attribute('body','obj',$stab); diff --git a/etemplate/inc/class.tree_widget.inc.php b/etemplate/inc/class.tree_widget.inc.php index c1a8f33c79..5b7bc699d4 100644 --- a/etemplate/inc/class.tree_widget.inc.php +++ b/etemplate/inc/class.tree_widget.inc.php @@ -81,7 +81,7 @@ class tree_widget } else // we need to instanciate a new cat object for the correct application { - $categories =& new categories('',$type3); + $categories = new categories('',$type3); } $cat2path=array(); foreach((array)$categories->return_sorted_array(0,False,'','','',!$type) as $cat) diff --git a/etemplate/inc/class.uietemplate_gtk.inc.php b/etemplate/inc/class.uietemplate_gtk.inc.php index 7a5e1128f4..a564cbe149 100644 --- a/etemplate/inc/class.uietemplate_gtk.inc.php +++ b/etemplate/inc/class.uietemplate_gtk.inc.php @@ -108,7 +108,7 @@ */ if (!$GLOBALS['egw_info']['etemplate']['window']) { - $window = &new GtkWindow(); + $window = new GtkWindow(); $window->connect('destroy',array('etemplate','destroy')); $window->connect('delete-event',array('etemplate','delete_event')); $window->set_title('eGroupWareGTK: '.$GLOBALS['egw_info']['server']['site_title']); @@ -125,7 +125,7 @@ $table->set_border_width(10); $table->show(); - $swindow = &new GtkScrolledWindow(null,null); + $swindow = new GtkScrolledWindow(null,null); $swindow->set_policy(GTK_POLICY_AUTOMATIC,GTK_POLICY_AUTOMATIC); $swindow->add_with_viewport($table); $swindow->show(); @@ -287,7 +287,7 @@ '.row' => $show_row ); - $table = &new GtkTable($this->rows,$this->cols,False); + $table = new GtkTable($this->rows,$this->cols,False); $table->set_row_spacings(2); $table->set_col_spacings(5); $table->show(); @@ -369,7 +369,7 @@ default: $align = 0.0; } - $align = &new GtkAlignment($align,$valign,$cell['type'] == 'hrule' ? 1.0 : 0.0,0.0); + $align = new GtkAlignment($align,$valign,$cell['type'] == 'hrule' ? 1.0 : 0.0,0.0); $align->add($widget); } $table->attach($align ? $align : $widget, $c, $c+$colspan, $r, $r+1,GTK_FILL,GTK_FILL,0,0); @@ -444,7 +444,7 @@ $name = $this->expand_name($cell['name'],$show_c,$show_row,$content['.c'],$content['.row'],$content); // building the form-field-name depending on prefix $cname and possibl. Array-subscript in name - if (ereg('^([^[]*)(\\[.*\\])$',$name,$regs)) // name contains array-index + if (preg_match('/^([^[]*)(\\[.*\\])$/',$name,$regs)) // name contains array-index { $form_name = $cname == '' ? $name : $cname.'['.$regs[1].']'.$regs[2]; eval(str_replace(']',"']",str_replace('[',"['",'$value = $content['.$regs[1].']'.$regs[2].';'))); @@ -492,7 +492,7 @@ if ($value) { - $widget = &new GtkLabel($value); + $widget = new GtkLabel($value); if ($cell['align'] != 'center') { $widget->set_justify($cell['align'] == 'right' ? GTK_JUSTIFY_RIGHT : GTK_JUSTIFY_LEFT); @@ -520,7 +520,7 @@ //$html .= $this->html->input($form_name,$value,'',$options.$this->html->formatOptions($cell['size'],'SIZE,MAXLENGTH')); } list($len,$max) = explode(',',$cell['size']); - $widget = &new GtkEntry(); + $widget = new GtkEntry(); $widget->set_text($value); if ($max) { @@ -534,15 +534,15 @@ break; case 'textarea': // Multiline Text Input, size: [rows][,cols] //$html .= $this->html->textarea($form_name,$value,$options.$this->html->formatOptions($cell['size'],'ROWS,COLS')); - $widget = &new GtkText(null,null); + $widget = new GtkText(null,null); $widget->insert_text($value,strlen($value)); $widget->set_editable(!$readonly); break; /* case 'date': if ($cell['size'] != '') { - $date = split('[/.-]',$value); - $mdy = split('[/.-]',$cell['size']); + $date = preg_split('/[\\/.-]/',$value); + $mdy = preg_split('/[\\/.-]/',$cell['size']); for ($value=array(),$n = 0; $n < 3; ++$n) { switch($mdy[$n]) @@ -572,7 +572,7 @@ $options .= ' CHECKED'; } //$html .= $this->html->input($form_name,'1','CHECKBOX',$options); - $widget = &new GtkCheckButton($right_label); + $widget = new GtkCheckButton($right_label); $right_label = ''; $widget->set_active($value); break; @@ -584,23 +584,23 @@ //$html .= $this->html->input($form_name,$cell['size'],'RADIO',$options); if (isset($this->buttongroup[$form_name])) { - $widget = &new GtkRadioButton($this->buttongroup[$form_name],$right_label); + $widget = new GtkRadioButton($this->buttongroup[$form_name],$right_label); } else { - $this->buttongroup[$form_name] = $widget = &new GtkRadioButton(null,$right_label); + $this->buttongroup[$form_name] = $widget = new GtkRadioButton(null,$right_label); } $right_label = ''; $widget->set_active($value == $cell['size']); break; case 'button': //$html .= $this->html->submit_button($form_name,$cell['label'],'',strlen($cell['label']) <= 1 || $cell['no_lang'],$options); - $widget = &new GtkButton(strlen($cell['label']) > 1 ? lang($cell['label']) : $cell['label']); + $widget = new GtkButton(strlen($cell['label']) > 1 ? lang($cell['label']) : $cell['label']); $widget->connect_object('clicked', array('etemplate', 'button_clicked'),&$var,$form_name); break; case 'hrule': //$html .= $this->html->hr($cell['size']); - $widget = &new GtkHSeparator(); + $widget = new GtkHSeparator(); break; case 'template': // size: index in content-array (if not full content is past further on) if ($this->autorepeat_idx($cell,$show_c,$show_row,$idx,$idx_cname) || $cell['size'] != '') @@ -661,7 +661,7 @@ $maxlen = $len; } } - $widget = &new GtkCombo(); + $widget = new GtkCombo(); $widget->set_popdown_strings($sel_options); $entry = $widget->entry; $entry->set_text($sel_options[$value]); @@ -709,7 +709,7 @@ $pixbuf = &$GLOBALS['egw_info']['etemplate']['pixbufs'][$path]; if ($pixbuf) { - $widget = &new GtkDrawingArea(); + $widget = new GtkDrawingArea(); $widget->size($pixbuf->get_width(),$pixbuf->get_height()); $widget->connect('expose_event',array('etemplate','draw_image'),$pixbuf); } @@ -720,7 +720,7 @@ break; default: //$html .= 'unknown type'; - $widget = &new GtkLabel('unknown type: '.$cell['type']); + $widget = new GtkLabel('unknown type: '.$cell['type']); $widget->set_justify(GTK_JUSTIFY_LEFT); break; } @@ -738,14 +738,14 @@ { if (!$widget && !$right_label) { - $widget = &new GtkLabel($left_label); + $widget = new GtkLabel($left_label); } else { - $hbox = &new GtkHBox(False,5); + $hbox = new GtkHBox(False,5); if ($left_label) { - $left = &new GtkLabel($left_label); + $left = new GtkLabel($left_label); $left->show(); $hbox->add($left); } @@ -756,7 +756,7 @@ } if ($right_label) { - $right = &new GtkLabel($right_label); + $right = new GtkLabel($right_label); $right->show(); $hbox->add($right); } @@ -766,7 +766,7 @@ { if (!$this->tooltips) { - $this->tooltips = &new GtkTooltips(); + $this->tooltips = new GtkTooltips(); } $this->tooltips->set_tip($widget,lang($cell['help']),$this->name.'/'.$form_name); } diff --git a/etemplate/inc/class.xmltool.inc.php b/etemplate/inc/class.xmltool.inc.php index c90ee21a39..27404d3da0 100644 --- a/etemplate/inc/class.xmltool.inc.php +++ b/etemplate/inc/class.xmltool.inc.php @@ -12,7 +12,7 @@ function var2xml($name, $data) { - $doc =& new xmltool('root','',''); + $doc = new xmltool('root','',''); return $doc->import_var($name,$data,True,True); } @@ -167,7 +167,7 @@ function import_var($name, $value,$is_root=False,$export_xml=False) { //echo "

import_var: this->indentstring='$this->indentstring'

\n"; - $node =& new xmltool('node',$name,$this->indentstring); + $node = new xmltool('node',$name,$this->indentstring); switch (gettype($value)) { case 'string': @@ -220,12 +220,12 @@ case 'integer': case 'double': case 'NULL': - $subnode =& new xmltool('node', $nextkey,$this->indentstring); + $subnode = new xmltool('node', $nextkey,$this->indentstring); $subnode->set_value($val); $node->add_node($subnode); break; case 'boolean': - $subnode =& new xmltool('node', $nextkey,$this->indentstring); + $subnode = new xmltool('node', $nextkey,$this->indentstring); if($val == True) { $subnode->set_value('1'); @@ -251,7 +251,7 @@ } break; case 'object': - $subnode =& new xmltool('node', $nextkey,$this->indentstring); + $subnode = new xmltool('node', $nextkey,$this->indentstring); $subnode->set_value('PHP_SERIALIZED_OBJECT&:'.serialize($val)); $node->add_node($subnode); break; @@ -390,7 +390,7 @@ { case 'cdata': case 'complete': - $node =& new xmltool('node',$data[$i]['tag'],$this->indentstring); + $node = new xmltool('node',$data[$i]['tag'],$this->indentstring); if(is_array($data[$i]['attributes']) && count($data[$i]['attributes']) > 0) { while(list($k,$v)=each($data[$i]['attributes'])) @@ -402,7 +402,7 @@ $parent_node->add_node($node); break; case 'open': - $node =& new xmltool('node',$data[$i]['tag'],$this->indentstring); + $node = new xmltool('node',$data[$i]['tag'],$this->indentstring); if(is_array($data[$i]['attributes']) && count($data[$i]['attributes']) > 0) { while(list($k,$v)=each($data[$i]['attributes'])) @@ -428,7 +428,7 @@ xml_parse_into_struct($parser, $xmldata, $vals, $index); xml_parser_free($parser); unset($index); - $node =& new xmltool('node',$vals[0]['tag'],$this->indentstring); + $node = new xmltool('node',$vals[0]['tag'],$this->indentstring); if(isset($vals[0]['attributes'])) { while(list($key,$value) = each($vals[0]['attributes'])) diff --git a/etemplate/inc/class.xul_io.inc.php b/etemplate/inc/class.xul_io.inc.php index 374df3f182..92f5a306b1 100644 --- a/etemplate/inc/class.xul_io.inc.php +++ b/etemplate/inc/class.xul_io.inc.php @@ -165,16 +165,16 @@ $widgetattr2xul = isset($this->widget2xul[$type]) ? $this->widget2xul[$type] : array(); $type = isset($widgetattr2xul['.name']) ? $widgetattr2xul['.name'] : $type; list($type,$child,$child2) = explode(',',$type); - $widget =& new xmlnode($type); + $widget = new xmlnode($type); $attr_widget = &$widget; if ($child) { - $child =& new xmlnode($child); + $child = new xmlnode($child); if ($type != 'tabbox') $attr_widget = &$child; } if ($child2) { - $child2 =& new xmlnode($child2); + $child2 = new xmlnode($child2); } if (isset($widgetattr2xul['.set'])) // set default-attr for type { @@ -189,7 +189,7 @@ { case 'nextmatch': list($tpl) = explode(',',$cell['size']); - $embeded =& new etemplate($tpl,$this->load_via); + $embeded = new etemplate($tpl,$this->load_via); if ($embeded_too) { $this->add_etempl($embeded,$embeded_too); @@ -207,17 +207,17 @@ $names = explode('|',$tab_names); for ($n = 0; $n < count($labels); ++$n) { - $tab =& new xmlnode('tab'); + $tab = new xmlnode('tab'); $tab->set_attribute('label',$labels[$n]); $tab->set_attribute('statustext',$helps[$n]); $child->add_node($tab); - $embeded =& new etemplate($names[$n],$this->load_via); + $embeded = new etemplate($names[$n],$this->load_via); if ($embeded_too) { $this->add_etempl($embeded,$embeded_too); } - $template =& new xmlnode('template'); + $template = new xmlnode('template'); $template->set_attribute('id',$embeded->name); $child2->add_node($template); unset($embeded); @@ -240,7 +240,7 @@ case 'groupbox': if ($cell['label']) { - $caption =& new xmlnode('caption'); + $caption = new xmlnode('caption'); $caption->set_attribute('label',$cell['label']); $widget->add_node($caption); unset($cell['label']); @@ -250,7 +250,7 @@ case 'hbox': case 'box': case 'deck': - list($anz,$orient,$options) = split(',',$cell['size'],3); + list($anz,$orient,$options) = explode(',',$cell['size'],3); for ($n = 1; $n <= $anz; ++$n) { $this->add_widget($widget,$cell[$n],$embeded_too); @@ -265,7 +265,7 @@ case 'template': if ($cell['name'][0] != '@' && $embeded_too) { - $templ =& new etemplate(); + $templ = new etemplate(); if ($templ->read(boetemplate::expand_name($cell['name'],0,0),'default','default',0,'',$this->load_via)) { $this->add_etempl($templ,$embeded_too); @@ -314,18 +314,18 @@ */ function add_grid(&$parent,$grid,&$embeded_too) { - $xul_grid =& new xmlnode('grid'); + $xul_grid = new xmlnode('grid'); $this->set_attributes($xul_grid,'width,height,border,class,spacing,padding,overflow',$grid['size']); $this->set_attributes($xul_grid,'id',$grid['name']); - $xul_columns =& new xmlnode('columns'); - $xul_rows =& new xmlnode('rows'); + $xul_columns = new xmlnode('columns'); + $xul_rows = new xmlnode('rows'); reset($grid['data']); list(,$opts) = each ($grid['data']); // read over options-row while (list($r,$row) = each ($grid['data'])) { - $xul_row =& new xmlnode('row'); + $xul_row = new xmlnode('row'); $this->set_attributes($xul_row,'class,valign',$opts["c$r"]); $this->set_attributes($xul_row,'height,disabled,part',$opts["h$r"]); @@ -334,7 +334,7 @@ { if ($r == '1') // write columns only once in the first row { - $xul_column =& new xmlnode('column'); + $xul_column = new xmlnode('column'); $this->set_attributes($xul_column,'width,disabled',$opts[$c]); $xul_columns->add_node($xul_column); } @@ -375,7 +375,7 @@ } $embeded_too[$etempl->name] = True; - $template =& new xmlnode('template'); + $template = new xmlnode('template'); $template->set_attribute('id',$etempl->name); $template->set_attribute('template',$etempl->template); $template->set_attribute('lang',$etempl->lang); @@ -388,7 +388,7 @@ } if ($etempl->style != '') { - $styles =& new xmlnode('styles'); + $styles = new xmlnode('styles'); $styles->set_value(str_replace("\r",'',$etempl->style)); $template->add_node($styles); } @@ -407,10 +407,10 @@ { echo "

etempl->data = "; _debug_array($etempl->data); } - $doc =& new xmldoc(); + $doc = new xmldoc(); $doc->add_comment('$'.'Id$'); - $this->xul_overlay =& new xmlnode('overlay'); // global for all add_etempl calls + $this->xul_overlay = new xmlnode('overlay'); // global for all add_etempl calls $this->load_via = $etempl->as_array(); $embeded_too = True; @@ -572,7 +572,7 @@ { break; } - $nul = null; soetemplate::add_child($parent,$nul); // null =& new row + $nul = null; soetemplate::add_child($parent,$nul); // null = new row $parent['data'][0]['c'.$parent['rows']] = $attr['class'] . ($attr['valign'] ? ','.$attr['valign'] : ''); $parent['data'][0]['h'.$parent['rows']] = $attr['height'] . ($attr['disabled']||$attr['part'] ? ','.$attr['disabled'] : ''). @@ -696,7 +696,7 @@ unset($attr['src']); break; case 'listbox': - $attr['size'] = ereg_replace(',*$','',$attr['rows'].','.$attr['size']); + $attr['size'] = preg_replace('/,*$/','',$attr['rows'].','.$attr['size']); unset($attr['rows']); break; case 'button': diff --git a/importexport/inc/class.uidefinitions.inc.php b/importexport/inc/class.uidefinitions.inc.php index c28b32d4d3..a6c648a875 100644 --- a/importexport/inc/class.uidefinitions.inc.php +++ b/importexport/inc/class.uidefinitions.inc.php @@ -59,7 +59,7 @@ class uidefinitions $GLOBALS['egw_info']['flags']['currentapp'] = self::_appname; $GLOBALS['egw_info']['flags']['include_xajax'] = true; - $this->etpl =& new etemplate(); + $this->etpl = new etemplate(); $this->clock = html::image(self::_appname,'clock'); $this->steps = array( 'wizzard_step10' => lang('Choose an application'), @@ -112,7 +112,7 @@ class uidefinitions } } - $etpl =& new etemplate(self::_appname.'.definition_index'); + $etpl = new etemplate(self::_appname.'.definition_index'); // we need an offset because of autocontinued rows in etemplate ... $definitions = array('row0'); @@ -213,7 +213,7 @@ class uidefinitions if(class_exists('xajaxResponse')) { - $this->response =& new xajaxResponse(); + $this->response = new xajaxResponse(); if ($content['closewindow']) { @@ -245,7 +245,7 @@ class uidefinitions // adding a manual icon to every popup if ($GLOBALS['egw_info']['user']['apps']['manual']) { - $manual =& new etemplate('etemplate.popup.manual'); + $manual = new etemplate('etemplate.popup.manual'); echo $manual->exec(self::_appname.'.uidefinitions.wizzard',$content,$sel_options,$readonlys,$preserv,1); unset($manual); } @@ -271,7 +271,7 @@ class uidefinitions /*if($content['plugin'] && $content['application']&& !is_object($this->plugin)) { $plugin_definition = $this->plugins[$content['application']][$content['plugin']]['definition']; - if($plugin_definition) $this->plugin =& new $plugin_definition; + if($plugin_definition) $this->plugin = new $plugin_definition; }*/ if(is_object($this->plugin)) { @@ -446,7 +446,7 @@ class uidefinitions } else { - $etpl =& new etemplate(self::_appname.'.import_definition'); + $etpl = new etemplate(self::_appname.'.import_definition'); return $etpl->exec(self::_appname.'.uidefinitions.import_definition',$content,array(),$readonlys,$preserv); } } diff --git a/importexport/inc/class.uiexport.inc.php b/importexport/inc/class.uiexport.inc.php index 114e937b29..211e6a46c1 100644 --- a/importexport/inc/class.uiexport.inc.php +++ b/importexport/inc/class.uiexport.inc.php @@ -167,7 +167,7 @@ class uiexport { elseif(class_exists('xajaxResponse')) { //error_log(__LINE__.__FILE__.'$_content: '.print_r($_content,true)); - $response =& new xajaxResponse(); + $response = new xajaxResponse(); if ($_content['defintion'] == 'expert') { $definition = new definition(); diff --git a/infolog/csv_import.php b/infolog/csv_import.php index d7fdab1897..64bce4dc8c 100644 --- a/infolog/csv_import.php +++ b/infolog/csv_import.php @@ -429,8 +429,8 @@ case 'import': { if (ereg((string) $pattern,$val)) { - // echo "

csv_idx='$csv_idx',info='$info',trans_csv=".print_r($trans_csv).",ereg_replace('$pattern','$replace','$val') = "; - $val = ereg_replace((string) $pattern,str_replace($VPre,'\\',$replace),(string) $val); + // echo "

csv_idx='$csv_idx',info='$info',trans_csv=".print_r($trans_csv).",preg_replace('/$pattern/','$replace','$val') = "; + $val = preg_replace('/'.(string) $pattern.'/',str_replace($VPre,'\\',$replace),(string) $val); // echo "'$val'

"; $reg = $CPreReg.'([a-zA-Z_0-9]+)'.$CPosReg; @@ -485,7 +485,7 @@ case 'import': { $responsible = $values['responsible']; $values['responsible'] = array(); - foreach(split('[,;]',$responsible) as $user) + foreach(preg_split('/[,;]/',$responsible) as $user) { if (preg_match('/\[([^\]]+)\]/',$user,$matches)) $user = $matches[1]; if ($user && !is_numeric($user)) $user = $GLOBALS['egw']->accounts->name2id($user); diff --git a/infolog/inc/class.infolog_bo.inc.php b/infolog/inc/class.infolog_bo.inc.php index ae4ff0348a..7b0448910f 100644 --- a/infolog/inc/class.infolog_bo.inc.php +++ b/infolog/inc/class.infolog_bo.inc.php @@ -236,7 +236,7 @@ class infolog_bo $this->user_time_now = time() + $this->tz_offset_s; $this->grants = $GLOBALS['egw']->acl->get_grants('infolog',$this->group_owners ? $this->group_owners : true); - $this->so =& new infolog_so($this->grants); + $this->so = new infolog_so($this->grants); if ($info_id) { @@ -516,7 +516,7 @@ class infolog_bo require_once(EGW_INCLUDE_ROOT.'/infolog/inc/class.infolog_tracking.inc.php'); if (!is_object($this->tracking)) { - $this->tracking =& new infolog_tracking($this); + $this->tracking = new infolog_tracking($this); } $this->tracking->track($deleted,$info,$this->user,true); } @@ -720,7 +720,7 @@ class infolog_bo // send email notifications and do the history logging if (!is_object($this->tracking)) { - $this->tracking =& new infolog_tracking($this); + $this->tracking = new infolog_tracking($this); } $this->tracking->track($values,$old,$this->user,$values['info_status'] == 'deleted' || $old['info_status'] == 'deleted'); } @@ -1146,7 +1146,7 @@ class infolog_bo $GLOBALS['egw']->acl->acl($user); $GLOBALS['egw']->acl->read_repository(); $this->grants = $GLOBALS['egw']->acl->get_grants('infolog',$this->group_owners ? $this->group_owners : true); - $this->so =& new infolog_so($this->grants); // so caches it's filters + $this->so = new infolog_so($this->grants); // so caches it's filters $notified_info_ids = array(); foreach(array( diff --git a/infolog/inc/class.infolog_customfields.inc.php b/infolog/inc/class.infolog_customfields.inc.php index ab86b03371..6639f977f4 100644 --- a/infolog/inc/class.infolog_customfields.inc.php +++ b/infolog/inc/class.infolog_customfields.inc.php @@ -209,7 +209,7 @@ class infolog_customfields { foreach(explode("\n",$field['values']) as $line) { - list($var,$value) = split('=',trim($line),2); + list($var,$value) = explode('=',trim($line),2); $var = trim($var); $values[$var] = empty($value) ? $var : $value; } diff --git a/infolog/inc/class.infolog_datasource.inc.php b/infolog/inc/class.infolog_datasource.inc.php index 4937856249..3101233680 100644 --- a/infolog/inc/class.infolog_datasource.inc.php +++ b/infolog/inc/class.infolog_datasource.inc.php @@ -44,7 +44,7 @@ class infolog_datasource extends datasource // we use $GLOBALS['infolog_bo'] as an already running instance might be availible there if (!is_object($GLOBALS['infolog_bo'])) { - $GLOBALS['infolog_bo'] =& new infolog_bo(); + $GLOBALS['infolog_bo'] = new infolog_bo(); } $this->infolog_bo =& $GLOBALS['infolog_bo']; } @@ -150,7 +150,7 @@ class infolog_datasource extends datasource if (!is_object($GLOBALS['infolog_bo'])) { include_once(EGW_INCLUDE_ROOT.'/infolog/inc/class.infolog_bo.inc.php'); - $GLOBALS['infolog_bo'] =& new infolog_bo(); + $GLOBALS['infolog_bo'] = new infolog_bo(); } // dont delete infolog, which are linked to other elements, but their project if (count(egw_link::get_links('infolog',$id)) > 1) diff --git a/infolog/inc/class.infolog_groupdav.inc.php b/infolog/inc/class.infolog_groupdav.inc.php index 0fa8a23a46..f0e3a5471e 100644 --- a/infolog/inc/class.infolog_groupdav.inc.php +++ b/infolog/inc/class.infolog_groupdav.inc.php @@ -36,7 +36,7 @@ class infolog_groupdav extends groupdav_handler if (self::$debugInfo) error_log(__METHOD__." called "); parent::__construct($app,$debug,$base_uri); if (self::$debugInfo) error_log(__METHOD__." parent constructed with $app,$debug,$base_uri; initializing infolog_bo "); - $this->bo =& new infolog_bo(); + $this->bo = new infolog_bo(); } const PATH_ATTRIBUTE = 'info_id'; @@ -231,7 +231,7 @@ class infolog_groupdav extends groupdav_handler private function _get_handler() { if (self::$debugInfo) error_log(__METHOD__." called "); - $handler =& new infolog_ical(); + $handler = new infolog_ical(); $handler->setSupportedFields('GroupDAV',$this->agent); return $handler; diff --git a/infolog/inc/class.infolog_hooks.inc.php b/infolog/inc/class.infolog_hooks.inc.php index 160d606185..28dbd9fb81 100644 --- a/infolog/inc/class.infolog_hooks.inc.php +++ b/infolog/inc/class.infolog_hooks.inc.php @@ -357,7 +357,7 @@ class infolog_hooks if ($data['prefs']['notify_due_delegated'] || $data['prefs']['notify_due_responsible'] || $data['prefs']['notify_start_delegated'] || $data['prefs']['notify_start_responsible']) { - $async =& new asyncservice(); + $async = new asyncservice(); if (!$async->read('infolog-async-notification')) { diff --git a/infolog/inc/class.infolog_ical.inc.php b/infolog/inc/class.infolog_ical.inc.php index e331ca5f6e..5dd4609b77 100644 --- a/infolog/inc/class.infolog_ical.inc.php +++ b/infolog/inc/class.infolog_ical.inc.php @@ -57,7 +57,7 @@ class infolog_ical extends infolog_bo $taskGUID = $GLOBALS['egw']->common->generate_uid('infolog_task',$_taskID); - $vcal = &new Horde_iCalendar; + $vcal = new Horde_iCalendar; $vcal->setAttribute('VERSION',$_version); $vcal->setAttribute('METHOD',$_method); @@ -164,7 +164,7 @@ class infolog_ical extends infolog_bo function vtodotoegw($_vcalData,$_taskID=-1) { - $vcal = &new Horde_iCalendar; + $vcal = new Horde_iCalendar; if(!$vcal->parsevCalendar($_vcalData)) { return FALSE; @@ -274,7 +274,7 @@ class infolog_ical extends infolog_bo case 'text/x-vnote': $noteGUID = $GLOBALS['egw']->common->generate_uid('infolog_note',$_noteID); - $vnote = &new Horde_iCalendar_vnote(); + $vnote = new Horde_iCalendar_vnote(); $vNote->setAttribute('VERSION', '1.1'); $vnote->setAttribute('SUMMARY',$note['info_subject']); $vnote->setAttribute('BODY',$note['info_des']); @@ -368,7 +368,7 @@ class infolog_ical extends infolog_bo break; case 'text/x-vnote': - $vnote = &new Horde_iCalendar; + $vnote = new Horde_iCalendar; if (!$vcal->parsevCalendar($_data)) { return FALSE; diff --git a/infolog/inc/class.infolog_sif.inc.php b/infolog/inc/class.infolog_sif.inc.php index c7f50bc410..8c24beda10 100644 --- a/infolog/inc/class.infolog_sif.inc.php +++ b/infolog/inc/class.infolog_sif.inc.php @@ -129,7 +129,7 @@ class infolog_sif extends infolog_bo switch($_sifType) { case 'task': $taskData = array(); - $vcal = &new Horde_iCalendar; + $vcal = new Horde_iCalendar; $taskData['info_type'] = 'task'; @@ -201,7 +201,7 @@ class infolog_sif extends infolog_bo case 'note': $noteData = array(); $noteData['info_type'] = 'note'; - $vcal = &new Horde_iCalendar; + $vcal = new Horde_iCalendar; foreach($this->_extractedSIFData as $key => $value) { @@ -280,7 +280,7 @@ class infolog_sif extends infolog_bo case 'task': if($taskData = $this->read($_id)) { $sysCharSet = $GLOBALS['egw']->translation->charset(); - $vcal = &new Horde_iCalendar; + $vcal = new Horde_iCalendar; $sifTask = ''; @@ -388,7 +388,7 @@ class infolog_sif extends infolog_bo case 'note': if($taskData = $this->read($_id)) { $sysCharSet = $GLOBALS['egw']->translation->charset(); - $vcal = &new Horde_iCalendar; + $vcal = new Horde_iCalendar; $sifNote = ''; @@ -448,7 +448,7 @@ class infolog_sif extends infolog_bo $taskGUID = $GLOBALS['phpgw']->common->generate_uid('infolog_task',$_taskID); - $vcal = &new Horde_iCalendar; + $vcal = new Horde_iCalendar; $vcal->setAttribute('VERSION',$_version); $vcal->setAttribute('METHOD','PUBLISH'); @@ -492,7 +492,7 @@ class infolog_sif extends infolog_bo { $botranslation = CreateObject('phpgwapi.translation'); - $vcal = &new Horde_iCalendar; + $vcal = new Horde_iCalendar; if(!$vcal->parsevCalendar($_vcalData)) { return FALSE; diff --git a/infolog/inc/class.infolog_so.inc.php b/infolog/inc/class.infolog_so.inc.php index 5f653e298e..f9de5e2d22 100644 --- a/infolog/inc/class.infolog_so.inc.php +++ b/infolog/inc/class.infolog_so.inc.php @@ -284,7 +284,7 @@ class infolog_so preg_match('/(upcoming|today|overdue|date|enddate)([-\\/.0-9]*)/',$filter,$vars); $filter = $vars[1]; - if (isset($vars[2]) && !empty($vars[2]) && ($date = split('[-/.]',$vars[2]))) + if (isset($vars[2]) && !empty($vars[2]) && ($date = preg_split('/[-\\/.]/',$vars[2]))) { $today = mktime(-$this->tz_offset,0,0,intval($date[1]),intval($date[2]),intval($date[0])); $tomorrow = mktime(-$this->tz_offset,0,0,intval($date[1]),intval($date[2])+1,intval($date[0])); diff --git a/infolog/inc/class.infolog_ui.inc.php b/infolog/inc/class.infolog_ui.inc.php index 5cfab4cfbb..68cee705ca 100644 --- a/infolog/inc/class.infolog_ui.inc.php +++ b/infolog/inc/class.infolog_ui.inc.php @@ -91,7 +91,7 @@ class infolog_ui */ function __construct() { - $this->bo =& new infolog_bo(); + $this->bo = new infolog_bo(); $this->tmpl = new etemplate(); @@ -302,7 +302,7 @@ class infolog_ui unset($query['custom_fields']); if ($query['col_filter']['info_type']) { - $tpl =& new etemplate; + $tpl = new etemplate; if ($tpl->read('infolog.index.rows.'.$query['col_filter']['info_type'])) { $query['template'] =& $tpl; diff --git a/infolog/inc/class.infolog_widget.inc.php b/infolog/inc/class.infolog_widget.inc.php index 6cf3826acb..0ebbf25d86 100644 --- a/infolog/inc/class.infolog_widget.inc.php +++ b/infolog/inc/class.infolog_widget.inc.php @@ -60,7 +60,7 @@ class infolog_widget function infolog_widget($ui) { $this->ui = $ui; - $this->infolog =& new infolog_bo(); + $this->infolog = new infolog_bo(); } /** diff --git a/login.php b/login.php index 2e8c93a1e8..73476c1d30 100755 --- a/login.php +++ b/login.php @@ -385,7 +385,7 @@ else foreach($_GET as $name => $value) { - if(ereg('phpgw_',$name)) + if(strpos($name,'phpgw_') !== false) { $extra_vars .= '&' . $name . '=' . urlencode($value); } diff --git a/phpgwapi/inc/adodb/adodb-datadict.inc.php b/phpgwapi/inc/adodb/adodb-datadict.inc.php index ec309f197b..1a76021f7f 100644 --- a/phpgwapi/inc/adodb/adodb-datadict.inc.php +++ b/phpgwapi/inc/adodb/adodb-datadict.inc.php @@ -390,7 +390,7 @@ class ADODB_DataDict { if ($flds) { list($lines,$pkey) = $this->_GenFields($flds); list(,$first) = each($lines); - list(,$column_def) = split("[\t ]+",$first,2); + list(,$column_def) = preg_split("/[\t ]+/",$first,2); } return array(sprintf($this->renameColumn,$tabname,$this->NameQuote($oldcolumn),$this->NameQuote($newcolumn),$column_def)); } diff --git a/phpgwapi/inc/adodb/adodb-pear.inc.php b/phpgwapi/inc/adodb/adodb-pear.inc.php index 9a938b5c29..b99080f670 100644 --- a/phpgwapi/inc/adodb/adodb-pear.inc.php +++ b/phpgwapi/inc/adodb/adodb-pear.inc.php @@ -113,7 +113,7 @@ class DB { include_once(ADODB_DIR."/drivers/adodb-$type.inc.php"); $obj = &NewADOConnection($type); - if (!is_object($obj)) $obj =& new PEAR_Error('Unknown Database Driver: '.$dsninfo['phptype'],-1); + if (!is_object($obj)) $obj = new PEAR_Error('Unknown Database Driver: '.$dsninfo['phptype'],-1); return $obj; } @@ -159,7 +159,7 @@ class DB @$obj =& NewADOConnection($type); if (!is_object($obj)) { - $obj =& new PEAR_Error('Unknown Database Driver: '.$dsninfo['phptype'],-1); + $obj = new PEAR_Error('Unknown Database Driver: '.$dsninfo['phptype'],-1); return $obj; } if (is_array($options)) { diff --git a/phpgwapi/inc/adodb/adodb-perf.inc.php b/phpgwapi/inc/adodb/adodb-perf.inc.php index 4895809c33..2f25283b8f 100644 --- a/phpgwapi/inc/adodb/adodb-perf.inc.php +++ b/phpgwapi/inc/adodb/adodb-perf.inc.php @@ -75,10 +75,10 @@ function& adodb_log_sql(&$conn,$sql,$inputarr) $conn->_logsql = false; // disable logsql error simulation $dbT = $conn->databaseType; - $a0 = split(' ',$t0); + $a0 = explode(' ',$t0); $a0 = (float)$a0[1]+(float)$a0[0]; - $a1 = split(' ',$t1); + $a1 = explode(' ',$t1); $a1 = (float)$a1[1]+(float)$a1[0]; $time = $a1 - $a0; diff --git a/phpgwapi/inc/adodb/adodb-time.inc.php b/phpgwapi/inc/adodb/adodb-time.inc.php index 896e9a23ee..91486e15b3 100644 --- a/phpgwapi/inc/adodb/adodb-time.inc.php +++ b/phpgwapi/inc/adodb/adodb-time.inc.php @@ -656,7 +656,7 @@ function adodb_get_gmt_diff() static $TZ; if (isset($TZ)) return $TZ; - $TZ = mktime(0,0,0,1,2,1970,0) - gmmktime(0,0,0,1,2,1970,0); + $TZ = mktime(0,0,0,1,2,1970) - gmmktime(0,0,0,1,2,1970); return $TZ; } @@ -1284,4 +1284,4 @@ global $ADODB_DATE_LOCALE; } -?> \ No newline at end of file +?> diff --git a/phpgwapi/inc/adodb/adodb-xmlschema.inc.php b/phpgwapi/inc/adodb/adodb-xmlschema.inc.php index 7b92a7b81a..7a6a857bb7 100644 --- a/phpgwapi/inc/adodb/adodb-xmlschema.inc.php +++ b/phpgwapi/inc/adodb/adodb-xmlschema.inc.php @@ -350,7 +350,7 @@ class dbTable extends dbObject { */ function &addIndex( $attributes ) { $name = strtoupper( $attributes['NAME'] ); - $this->indexes[$name] =& new dbIndex( $this, $attributes ); + $this->indexes[$name] = new dbIndex( $this, $attributes ); return $this->indexes[$name]; } @@ -362,7 +362,7 @@ class dbTable extends dbObject { */ function &addData( $attributes ) { if( !isset( $this->data ) ) { - $this->data =& new dbData( $this, $attributes ); + $this->data = new dbData( $this, $attributes ); } return $this->data; } diff --git a/phpgwapi/inc/adodb/adodb.inc.php b/phpgwapi/inc/adodb/adodb.inc.php index 9e6cab9fb4..ebd3d7d309 100644 --- a/phpgwapi/inc/adodb/adodb.inc.php +++ b/phpgwapi/inc/adodb/adodb.inc.php @@ -885,7 +885,7 @@ } if ($this->_queryID === true) { // return simplified recordset for inserts/updates/deletes with lower overhead - $rs =& new ADORecordSet_empty(); + $rs = new ADORecordSet_empty(); return $rs; } @@ -1853,7 +1853,7 @@ if (empty($this->_metars)) { $rsclass = $this->rsPrefix.$this->databaseType; - $this->_metars =& new $rsclass(false,$this->fetchMode); + $this->_metars = new $rsclass(false,$this->fetchMode); } return $this->_metars->MetaType($t,$len,$fieldobj); diff --git a/phpgwapi/inc/adodb/drivers/adodb-informix72.inc.php b/phpgwapi/inc/adodb/drivers/adodb-informix72.inc.php index ca03cb6ba8..cb0f138c91 100644 --- a/phpgwapi/inc/adodb/drivers/adodb-informix72.inc.php +++ b/phpgwapi/inc/adodb/drivers/adodb-informix72.inc.php @@ -369,7 +369,7 @@ class ADORecordset_informix72 extends ADORecordSet { foreach($fp as $k => $v) { $o = new ADOFieldObject; $o->name = $k; - $arr = split(';',$v); //"SQLTYPE;length;precision;scale;ISNULLABLE" + $arr = explode(';',$v); //"SQLTYPE;length;precision;scale;ISNULLABLE" $o->type = $arr[0]; $o->max_length = $arr[1]; $this->_fieldprops[] = $o; diff --git a/phpgwapi/inc/adodb/drivers/adodb-odbc.inc.php b/phpgwapi/inc/adodb/drivers/adodb-odbc.inc.php index fc07584ad8..de70e7de79 100644 --- a/phpgwapi/inc/adodb/drivers/adodb-odbc.inc.php +++ b/phpgwapi/inc/adodb/drivers/adodb-odbc.inc.php @@ -422,7 +422,7 @@ See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/od } if (empty($qid)) return $false; - $rs =& new ADORecordSet_odbc($qid); + $rs = new ADORecordSet_odbc($qid); $ADODB_FETCH_MODE = $savem; if (!$rs) return $false; diff --git a/phpgwapi/inc/adodb/drivers/adodb-postgres64.inc.php b/phpgwapi/inc/adodb/drivers/adodb-postgres64.inc.php index cd3be2848c..eafd5473d2 100644 --- a/phpgwapi/inc/adodb/drivers/adodb-postgres64.inc.php +++ b/phpgwapi/inc/adodb/drivers/adodb-postgres64.inc.php @@ -647,7 +647,7 @@ WHERE c2.relname=\'%s\' or c2.relname=lower(\'%s\')'; if (strlen($db) == 0) $db = 'template1'; $db = adodb_addslashes($db); if ($str) { - $host = split(":", $str); + $host = explode(":", $str); if ($host[0]) $str = "host=".adodb_addslashes($host[0]); else $str = 'host=localhost'; if (isset($host[1])) $str .= " port=$host[1]"; diff --git a/phpgwapi/inc/adodb/drivers/adodb-sybase_ase.inc.php b/phpgwapi/inc/adodb/drivers/adodb-sybase_ase.inc.php index 4f4b0e0a41..e356fcd01f 100644 --- a/phpgwapi/inc/adodb/drivers/adodb-sybase_ase.inc.php +++ b/phpgwapi/inc/adodb/drivers/adodb-sybase_ase.inc.php @@ -77,7 +77,7 @@ class ADODB_sybase_ase extends ADODB_sybase { $retarr = array(); while (!$rs->EOF) { - $fld =& new ADOFieldObject(); + $fld = new ADOFieldObject(); $fld->name = $rs->Fields('field_name'); $fld->type = $rs->Fields('type'); $fld->max_length = $rs->Fields('width'); diff --git a/phpgwapi/inc/adodb/session/adodb-encrypt-md5.php b/phpgwapi/inc/adodb/session/adodb-encrypt-md5.php index 87269be12a..607e60f398 100644 --- a/phpgwapi/inc/adodb/session/adodb-encrypt-md5.php +++ b/phpgwapi/inc/adodb/session/adodb-encrypt-md5.php @@ -21,14 +21,14 @@ class ADODB_Encrypt_MD5 { /** */ function write($data, $key) { - $md5crypt =& new MD5Crypt(); + $md5crypt = new MD5Crypt(); return $md5crypt->encrypt($data, $key); } /** */ function read($data, $key) { - $md5crypt =& new MD5Crypt(); + $md5crypt = new MD5Crypt(); return $md5crypt->decrypt($data, $key); } diff --git a/phpgwapi/inc/class.accounts_sql.inc.php b/phpgwapi/inc/class.accounts_sql.inc.php index a022cf4671..6b751622a2 100644 --- a/phpgwapi/inc/class.accounts_sql.inc.php +++ b/phpgwapi/inc/class.accounts_sql.inc.php @@ -481,7 +481,7 @@ class accounts_sql */ function update_lastlogin($account_id, $ip) { - $previous_login = $this->db->select($this->table,'account_lastlogin',array('account_id'=>abs($account_id)),__LINE__,__FILE__)->fetchSingle(); + $previous_login = $this->db->select($this->table,'account_lastlogin',array('account_id'=>abs($account_id)),__LINE__,__FILE__)->fetchColumn(); $this->db->update($this->table,array( 'account_lastloginfrom' => $ip, diff --git a/phpgwapi/inc/class.acl.inc.php b/phpgwapi/inc/class.acl.inc.php index 8330e3ac83..bfdac2467e 100644 --- a/phpgwapi/inc/class.acl.inc.php +++ b/phpgwapi/inc/class.acl.inc.php @@ -436,7 +436,7 @@ class acl 'acl_location' => $location, 'acl_account' => $account_id, 'acl_appname' => $appname, - ),__LINE__,__FILE__)->fetchSingle(); + ),__LINE__,__FILE__)->fetchColumn(); } /** diff --git a/phpgwapi/inc/class.asyncservice.inc.php b/phpgwapi/inc/class.asyncservice.inc.php index bb7c3aded2..c51bd754ef 100644 --- a/phpgwapi/inc/class.asyncservice.inc.php +++ b/phpgwapi/inc/class.asyncservice.inc.php @@ -604,7 +604,7 @@ class asyncservice while ($line = fgets($crontab,256)) { if ($this->debug) echo 'line '.++$n.": $line
\n"; - $parts = split(' ',$line,6); + $parts = explode(' ',$line,6); if ($line{0} == '#' || count($parts) < 6 || ($parts[5]{0} != '/' && substr($parts[5],0,3) != 'php')) { diff --git a/phpgwapi/inc/class.auth_ads.inc.php b/phpgwapi/inc/class.auth_ads.inc.php index 6b59b91265..bf649ba79d 100644 --- a/phpgwapi/inc/class.auth_ads.inc.php +++ b/phpgwapi/inc/class.auth_ads.inc.php @@ -31,7 +31,7 @@ function authenticate($username, $passwd) { - if (ereg('[()|&=*,<>!~]',$username)) + if (preg_match('/[()|&=*,<>!~]/',$username)) { return False; } diff --git a/phpgwapi/inc/class.auth_sql.inc.php b/phpgwapi/inc/class.auth_sql.inc.php index 2dce59c721..aa0b4f3e2b 100644 --- a/phpgwapi/inc/class.auth_sql.inc.php +++ b/phpgwapi/inc/class.auth_sql.inc.php @@ -130,7 +130,7 @@ class auth_ 'account_id' => $account_id, 'account_type' => 'u', 'account_status' => 'A', - ),__LINE__,__FILE__)->fetchSingle()) === false) + ),__LINE__,__FILE__)->fetchColumn()) === false) { return false; // account not found } diff --git a/phpgwapi/inc/class.browser.inc.php b/phpgwapi/inc/class.browser.inc.php index 68e98328b9..8ab2e85134 100644 --- a/phpgwapi/inc/class.browser.inc.php +++ b/phpgwapi/inc/class.browser.inc.php @@ -39,30 +39,30 @@ /* Determine browser and version */ - if(ereg('MSIE ([0-9].[0-9]{1,2})',$HTTP_USER_AGENT,$log_version)) + if(preg_match('/MSIE ([0-9].[0-9]{1,2})/',$HTTP_USER_AGENT,$log_version)) { $this->BROWSER_VER = $log_version[1]; $this->BROWSER_AGENT = 'IE'; } - elseif(ereg('Opera ([0-9].[0-9]{1,2})',$HTTP_USER_AGENT,$log_version) || - ereg('Opera/([0-9].[0-9]{1,2})',$HTTP_USER_AGENT,$log_version)) + elseif(preg_match('/Opera ([0-9].[0-9]{1,2})/',$HTTP_USER_AGENT,$log_version) || + preg_match('/Opera\\/([0-9].[0-9]{1,2})/',$HTTP_USER_AGENT,$log_version)) { $this->BROWSER_VER = $log_version[1]; $this->BROWSER_AGENT = 'OPERA'; } - elseif(eregi('iCab ([0-9].[0-9a-zA-Z]{1,4})',$HTTP_USER_AGENT,$log_version) || - eregi('iCab/([0-9].[0-9a-zA-Z]{1,4})',$HTTP_USER_AGENT,$log_version)) + elseif(preg_match('/iCab ([0-9].[0-9a-zA-Z]{1,4})/i',$HTTP_USER_AGENT,$log_version) || + preg_match('/iCab\\/([0-9].[0-9a-zA-Z]{1,4})/i',$HTTP_USER_AGENT,$log_version)) { $this->BROWSER_VER = $log_version[1]; $this->BROWSER_AGENT = 'iCab'; } - elseif(ereg('Gecko',$HTTP_USER_AGENT,$log_version)) + elseif(strpos($HTTP_USER_AGENT,'Gecko') !== false) { $this->BROWSER_VER = $log_version[1]; $this->BROWSER_AGENT = 'MOZILLA'; } - elseif(ereg('Konqueror/([0-9].[0-9].[0-9]{1,2})',$HTTP_USER_AGENT,$log_version) || - ereg('Konqueror/([0-9].[0-9]{1,2})',$HTTP_USER_AGENT,$log_version)) + elseif(preg_match('/Konqueror\\/([0-9].[0-9].[0-9]{1,2})/',$HTTP_USER_AGENT,$log_version) || + preg_match('/Konqueror\\/([0-9].[0-9]{1,2})/',$HTTP_USER_AGENT,$log_version)) { $this->BROWSER_VER=$log_version[1]; $this->BROWSER_AGENT='Konqueror'; diff --git a/phpgwapi/inc/class.common.inc.php b/phpgwapi/inc/class.common.inc.php index 702404b442..3c798d1bbb 100644 --- a/phpgwapi/inc/class.common.inc.php +++ b/phpgwapi/inc/class.common.inc.php @@ -581,7 +581,7 @@ class common { while ($file = readdir($dh)) { - if (eregi("\.css$", $file) && $file != 'phpgw.css') + if (preg_match('/'."\.css$".'/i', $file) && $file != 'phpgw.css') { $list[] = substr($file,0,strpos($file,'.')); } @@ -593,7 +593,7 @@ class common $dh = opendir(EGW_SERVER_ROOT . '/phpgwapi/themes'); while ($file = readdir($dh)) { - if (eregi("\.theme$", $file)) + if (preg_match('/'."\.theme$".'/i', $file)) { $list[] = substr($file,0,strpos($file,'.')); } @@ -1563,7 +1563,7 @@ class common return -1; } - $id = (int) $GLOBALS['egw']->db->select(self::NEXTID_TABLE,'id',array('appname' => $appname),__LINE__,__FILE__)->fetchSingle(); + $id = (int) $GLOBALS['egw']->db->select(self::NEXTID_TABLE,'id',array('appname' => $appname),__LINE__,__FILE__)->fetchColumn(); if ($max && $id >= $max) { @@ -1593,7 +1593,7 @@ class common return -1; } - $id = (int)$GLOBALS['egw']->db->select(self::NEXTID_TABLE,'id',array('appname' => $appname),__LINE__,__FILE__)->fetchSingle(); + $id = (int)$GLOBALS['egw']->db->select(self::NEXTID_TABLE,'id',array('appname' => $appname),__LINE__,__FILE__)->fetchColumn(); if (!$id || $id < $min) { diff --git a/phpgwapi/inc/class.contenthistory.inc.php b/phpgwapi/inc/class.contenthistory.inc.php index 44429c4008..afd7bf9ac5 100644 --- a/phpgwapi/inc/class.contenthistory.inc.php +++ b/phpgwapi/inc/class.contenthistory.inc.php @@ -116,7 +116,7 @@ class contenthistory 'sync_contentid' => $_id, ); - if (($ts = $this->db->select(self::TABLE,$col,$where,__LINE__,__FILE__)->fetchSingle())) + if (($ts = $this->db->select(self::TABLE,$col,$where,__LINE__,__FILE__)->fetchColumn())) { $ts = $this->db->from_timestamp($ts); } @@ -155,7 +155,7 @@ class contenthistory 'sync_contentid' => $_id, ); - if (!$this->db->select(self::TABLE,'sync_contentid',$where,__LINE__,__FILE__)->fetchSingle()) + if (!$this->db->select(self::TABLE,'sync_contentid',$where,__LINE__,__FILE__)->fetchColumn()) { $this->db->insert(self::TABLE,$newData,array(),__LINE__,__FILE__); } diff --git a/phpgwapi/inc/class.egw_db.inc.php b/phpgwapi/inc/class.egw_db.inc.php index 8d7ef094be..aa9b67281a 100644 --- a/phpgwapi/inc/class.egw_db.inc.php +++ b/phpgwapi/inc/class.egw_db.inc.php @@ -39,7 +39,7 @@ * egw_db allows to use exceptions to catch sql-erros, not existing tables or failure to connect to the database, eg.: * try { * $this->db->connect(); - * $num_config = $this->db->select(config::TABLE,'COUNT(config_name)',false,__LINE__,__FILE__)->fetchSingle(); + * $num_config = $this->db->select(config::TABLE,'COUNT(config_name)',false,__LINE__,__FILE__)->fetchColumn(); * } * catch(Exception $e) { * echo "Connection to DB failed (".$e->getMessage().")!\n"; diff --git a/phpgwapi/inc/class.egw_framework.inc.php b/phpgwapi/inc/class.egw_framework.inc.php index 69da1f8e20..052b0be5f8 100644 --- a/phpgwapi/inc/class.egw_framework.inc.php +++ b/phpgwapi/inc/class.egw_framework.inc.php @@ -651,7 +651,7 @@ abstract class egw_framework { require_once(EGW_SERVER_ROOT.'/phpgwapi/inc/xajax.inc.php'); - $xajax =& new xajax($GLOBALS['egw']->link('/xajax.php'), 'xajax_', $GLOBALS['egw']->translation->charset()); + $xajax = new xajax($GLOBALS['egw']->link('/xajax.php'), 'xajax_', $GLOBALS['egw']->translation->charset()); $xajax->waitCursorOff(); $xajax->registerFunction("doXMLHTTP"); diff --git a/phpgwapi/inc/class.egw_session.inc.php b/phpgwapi/inc/class.egw_session.inc.php index 46e653abb7..f80865b2fb 100644 --- a/phpgwapi/inc/class.egw_session.inc.php +++ b/phpgwapi/inc/class.egw_session.inc.php @@ -679,7 +679,7 @@ class egw_session 'account_id = 0', 'ip' => $ip, "li > $block_time", - ),__LINE__,__FILE__)->fetchSingle()) > $GLOBALS['egw_info']['server']['num_unsuccessful_ip']) + ),__LINE__,__FILE__)->fetchColumn()) > $GLOBALS['egw_info']['server']['num_unsuccessful_ip']) { //echo "

login_blocked: ip='$ip' ".$this->db->f(0)." trys (".$GLOBALS['egw_info']['server']['num_unsuccessful_ip']." max.) since ".date('Y/m/d H:i',$block_time)."

\n"; $blocked = true; @@ -688,7 +688,7 @@ class egw_session 'account_id = 0', '(loginid = '.$GLOBALS['egw']->db->quote($login).' OR loginid LIKE '.$GLOBALS['egw']->db->quote($login.'@%').')', "li > $block_time", - ),__LINE__,__FILE__)->fetchSingle()) > $GLOBALS['egw_info']['server']['num_unsuccessful_id']) + ),__LINE__,__FILE__)->fetchColumn()) > $GLOBALS['egw_info']['server']['num_unsuccessful_id']) { //echo "

login_blocked: login='$login' ".$this->db->f(0)." trys (".$GLOBALS['egw_info']['server']['num_unsuccessful_id']." max.) since ".date('Y/m/d H:i',$block_time)."

\n"; $blocked = true; diff --git a/phpgwapi/inc/class.error.inc.php b/phpgwapi/inc/class.error.inc.php index c661d206ec..cf2695ec31 100755 --- a/phpgwapi/inc/class.error.inc.php +++ b/phpgwapi/inc/class.error.inc.php @@ -61,7 +61,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]; diff --git a/phpgwapi/inc/class.html.inc.php b/phpgwapi/inc/class.html.inc.php index 91cf826732..3a8122d473 100644 --- a/phpgwapi/inc/class.html.inc.php +++ b/phpgwapi/inc/class.html.inc.php @@ -886,14 +886,14 @@ class html */ static function image( $app,$name,$title='',$options='' ) { - if (substr($name,0,5) == 'vfs:/') // vfs pseudo protocoll - { - $name = egw_vfs::download_url(substr($name,4)); - } if (is_array($name)) // menuaction and other get-vars { $name = $GLOBALS['egw']->link('/index.php',$name); } + if (substr($name,0,5) == 'vfs:/') // vfs pseudo protocoll + { + $name = egw_vfs::download_url(substr($name,4)); + } if ($name[0] == '/' || substr($name,0,7) == 'http://' || substr($name,0,8) == 'https://' || stripos($name,'etemplate/thumbnail.php') ) { if (!($name[0] == '/' || substr($name,0,7) == 'http://' || substr($name,0,8) == 'https://')) $name = '/'.$name; diff --git a/phpgwapi/inc/class.http.inc.php b/phpgwapi/inc/class.http.inc.php index 7324072b8e..58b42523b5 100644 --- a/phpgwapi/inc/class.http.inc.php +++ b/phpgwapi/inc/class.http.inc.php @@ -459,7 +459,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$".'/',$value,$matches)) { $year = (int)$matches[5]; if($year<1900) diff --git a/phpgwapi/inc/class.interserver.inc.php b/phpgwapi/inc/class.interserver.inc.php index 337fa9147a..11704860c9 100644 --- a/phpgwapi/inc/class.interserver.inc.php +++ b/phpgwapi/inc/class.interserver.inc.php @@ -81,7 +81,7 @@ function interserver($serverid='') { - $url = eregi_replace('https*://[^/]*/','',$GLOBALS['egw_info']['server']['webserver_url']); + $url = preg_replace('/https*:\\/\\/[^\\/]*\\//i','',$GLOBALS['egw_info']['server']['webserver_url']); $this->urlparts = array( 'xmlrpc' => $url.'/xmlrpc.php', 'soap' => $url.'/soap.php' diff --git a/phpgwapi/inc/class.javascript.inc.php b/phpgwapi/inc/class.javascript.inc.php index d303e0ea76..f144de598d 100644 --- a/phpgwapi/inc/class.javascript.inc.php +++ b/phpgwapi/inc/class.javascript.inc.php @@ -309,7 +309,7 @@ $thyapi_comp = 'thyapi_comp_gecko.js'; } - $GLOBALS['egw_info']['flags']['java_script_globals']['jsapi']['imgDir'] = $GLOBALS['egw_info']['server']['webserver_url'].'/'.'phpgwapi/images'; + $GLOBALS['egw_info']['flags']['java_script_globals']['jsapi']['imgDir'] = $GLOBALS['egw_info']['server']['webserver_url'].'/phpgwapi/images'; if (EGW_UNCOMPRESSED_THYAPI) { $jsCode = "\n" . diff --git a/phpgwapi/inc/class.jscalendar.inc.php b/phpgwapi/inc/class.jscalendar.inc.php index ae37eaee02..e0ade483fc 100644 --- a/phpgwapi/inc/class.jscalendar.inc.php +++ b/phpgwapi/inc/class.jscalendar.inc.php @@ -204,8 +204,8 @@ function monthClicked(calendar,monthstart) { { return False; } - $fields = split('[./-]',$datestr); - foreach(split('[./-]',$this->dateformat) as $n => $field) + $fields = preg_split('/[.\\/-]/',$datestr); + foreach(preg_split('/[.\\/-]/',$this->dateformat) as $n => $field) { if ($field == 'M') { diff --git a/phpgwapi/inc/class.phpmailer.inc.php b/phpgwapi/inc/class.phpmailer.inc.php index f9f367814a..82abf5bd95 100644 --- a/phpgwapi/inc/class.phpmailer.inc.php +++ b/phpgwapi/inc/class.phpmailer.inc.php @@ -496,7 +496,7 @@ class PHPMailer { $to .= $this->AddrFormat($this->to[$i]); } - $toArr = split(',', $to); + $toArr = explode(',', $to); $params = sprintf("-oi -f %s", $this->Sender); if ($this->Sender != '' && strlen(ini_get('safe_mode'))< 1) { @@ -1779,7 +1779,7 @@ class PHPMailer { $directory = dirname($url); ($directory == '.')?$directory='':''; $cid = 'cid:' . md5($filename); - $fileParts = split("\.", $filename); + $fileParts = explode("\.", $filename); $ext = $fileParts[1]; $mimeType = $this->_mime_types($ext); if ( strlen($basedir) > 1 && substr($basedir,-1) != '/') { $basedir .= '/'; } diff --git a/phpgwapi/inc/class.soap_client.inc.php b/phpgwapi/inc/class.soap_client.inc.php index b6c31397c8..ad3c6cfdc1 100644 --- a/phpgwapi/inc/class.soap_client.inc.php +++ b/phpgwapi/inc/class.soap_client.inc.php @@ -53,12 +53,12 @@ $this->action = ''; // endpoint mangling - if(ereg("^http://",$path)) + if(preg_match('/'."^http:\\/\\/".'/',$path)) { $path = str_replace('http://','',$path); $this->path = strstr($path,'/'); $this->debug("path = $this->path"); - if(ereg(':',$path)) + if(preg_match('/:/',$path)) { $this->server = substr($path,0,strpos($path,':')); $this->port = substr(strstr($path,':'),1); diff --git a/phpgwapi/inc/class.soap_parser.inc.php b/phpgwapi/inc/class.soap_parser.inc.php index 0e5228719d..ec7d3d22d6 100644 --- a/phpgwapi/inc/class.soap_parser.inc.php +++ b/phpgwapi/inc/class.soap_parser.inc.php @@ -134,15 +134,15 @@ $this->parent = $pos; // set status - if(ereg(":Envelope$",$name)) + if(preg_match('/'.":Envelope$".'/',$name)) { $this->status = 'envelope'; } - elseif(ereg(":Header$",$name)) + elseif(preg_match('/'.":Header$".'/',$name)) { $this->status = 'header'; } - elseif(ereg(":Body$",$name)) + elseif(preg_match('/'.":Body$".'/',$name)) { $this->status = 'body'; // set method @@ -150,7 +150,7 @@ elseif($this->status == 'body') { $this->status = 'method'; - if(ereg(':',$name)) + if(preg_match('/:/',$name)) { $this->root_struct_name = substr(strrchr($name,':'),1); } @@ -169,7 +169,7 @@ // set attrs $this->message[$pos]['attrs'] = $attrs; // get namespace - if(ereg(":",$name)) + if(preg_match('/'.":".'/',$name)) { $namespace = substr($name,0,strpos($name,':')); $this->message[$pos]['namespace'] = $namespace; @@ -185,7 +185,7 @@ /* foreach($attrs as $key => $value) */ { // if ns declarations, add to class level array of valid namespaces - if(ereg('xmlns:',$key)) + if(preg_match('/xmlns:/',$key)) { $namespaces[substr(strrchr($key,':'),1)] = $value; if($name == $this->root_struct_name) @@ -280,11 +280,11 @@ { $this->status = 'body'; } - elseif(ereg(':Body',$name)) + elseif(preg_match('/:Body/',$name)) { $this->status = 'header'; } - elseif(ereg(':Header',$name)) + elseif(preg_match('/:Header/',$name)) { $this->status = 'envelope'; } diff --git a/phpgwapi/inc/class.soap_server.inc.php b/phpgwapi/inc/class.soap_server.inc.php index badabeff8c..0861ebe3db 100644 --- a/phpgwapi/inc/class.soap_server.inc.php +++ b/phpgwapi/inc/class.soap_server.inc.php @@ -81,13 +81,13 @@ if($headers_array["SOAPAction"]) { $action = str_replace('"','',$headers_array["SOAPAction"]); - if(ereg("^urn:",$action)) + if(preg_match('/'."^urn:".'/',$action)) { $this->service = substr($action,4); } - elseif(ereg(".php",$action)) + elseif(preg_match('/'.".php".'/',$action)) { - $this->service = ereg_replace('"|/','',substr(strrchr($action,".php"),4,strlen(strrchr($action,"/")))); + $this->service = preg_replace('/"|\\//','',substr(strrchr($action,".php"),4,strlen(strrchr($action,"/")))); } $this->debug("got service: $this->service"); } @@ -105,7 +105,7 @@ $this->debug("method name: $this->methodname"); // does method exist? - $test = ereg_replace("\.",'_',$this->methodname); + $test = preg_replace('/'."\.".'/','_',$this->methodname); if(function_exists($test)) { $method = $this->methodname = $test; @@ -115,7 +115,7 @@ { /* egroupware customization - createobject based on methodname */ list($app,$class,$method) = explode('.',$this->methodname); - if(ereg("^service",$app)) + if(preg_match('/'."^service".'/',$app)) { $args = $class; $class = 'service'; diff --git a/phpgwapi/inc/class.soapmsg.inc.php b/phpgwapi/inc/class.soapmsg.inc.php index cdd9208c3f..30900c03c9 100644 --- a/phpgwapi/inc/class.soapmsg.inc.php +++ b/phpgwapi/inc/class.soapmsg.inc.php @@ -111,12 +111,12 @@ $this->debug("Entering parseResponse()"); //$this->debug(" w/ data $data"); // strip headers here - //$clean_data = ereg_replace("\r\n","\n", $data); - if(ereg("^.*\r\n\r\n<",$data)) + //$clean_data = preg_replace('/'."\r\n".'/',"\n", $data); + if(preg_match('/'."^.*\r\n\r\n<".'/',$data)) { $this->debug("found proper seperation of headers and document"); $this->debug("getting rid of headers, stringlen: ".strlen($data)); - $clean_data = ereg_replace("^.*\r\n\r\n<","<", $data); + $clean_data = preg_replace('/'."^.*\r\n\r\n<".'/',"<", $data); $this->debug("cleaned data, stringlen: ".strlen($clean_data)); } else @@ -134,7 +134,7 @@ } /* // if response is a proper http response, and is not a 200 - if(ereg("^HTTP",$clean_data) && !ereg("200$", $clean_data)) + if(preg_match('/'."^HTTP".'/',$clean_data) && !preg_match('/'."200$".'/', $clean_data)) { // get error data $errstr = substr($clean_data, 0, strpos($clean_data, "\n")-1); diff --git a/phpgwapi/inc/class.soapval.inc.php b/phpgwapi/inc/class.soapval.inc.php index 9127ce6a1a..01e2a93b97 100644 --- a/phpgwapi/inc/class.soapval.inc.php +++ b/phpgwapi/inc/class.soapval.inc.php @@ -94,7 +94,7 @@ } // get type prefix - if(ereg(":",$type)) + if(preg_match('/'.":".'/',$type)) { $this->type = substr(strrchr($type,':'),1,strlen(strrchr($type,':'))); $this->type_prefix = substr($type,0,strpos($type,':')); @@ -198,7 +198,7 @@ $type = 'array'; } } - elseif(!ereg("^[0-9]*$",$k) && in_array($k,array_keys($this->soapTypes))) + elseif(!preg_match('/'."^[0-9]*$".'/',$k) && in_array($k,array_keys($this->soapTypes))) { $type = $k; } diff --git a/phpgwapi/inc/class.validator.inc.php b/phpgwapi/inc/class.validator.inc.php index 9eeafce78b..2e250bf724 100644 --- a/phpgwapi/inc/class.validator.inc.php +++ b/phpgwapi/inc/class.validator.inc.php @@ -50,7 +50,7 @@ /* strips all whitespace from a string */ function strip_space($text) { - return ereg_replace("( |\n|\t|\r)+", '', $text); + return preg_replace('/'."( |\n|\t|\r)+".'/', '', $text); } function is_allnumbers($text) @@ -196,7 +196,7 @@ foreach($segs as $seg) { //echo "Checking $seg
"; - if(eregi("[a-z0-9\-]{0,62}",$seg)) + if(preg_match('/'."[a-z0-9\-]{0,62}".'/i',$seg)) { $return = True; } diff --git a/phpgwapi/inc/class.vcard.inc.php b/phpgwapi/inc/class.vcard.inc.php index 82a71db278..7d38cdfe0b 100644 --- a/phpgwapi/inc/class.vcard.inc.php +++ b/phpgwapi/inc/class.vcard.inc.php @@ -123,7 +123,7 @@ $fp = fopen($filename,'r'); while($data = fgets($fp,8000)) { - list($name,$value,$extra) = split(':', $data); + list($name,$value,$extra) = explode(':', $data); if(substr($value,0,5) == 'http') { $value = $value . ':'.$extra; @@ -216,12 +216,12 @@ settype($buffer,'array'); foreach($buffer as $name => $value) { - $field = split(';',$name); - $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]); - $values = split(';',$value); + $field = explode(';',$name); + $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 = explode(';',$value); if($field[1]) { //echo $field[0]; @@ -594,7 +594,7 @@ } else { - $tmp = split('-',$values[0]); + $tmp = explode('-',$values[0]); if($tmp[0]) { $entry['bday'] = $tmp[1] . '/' . $tmp[2] . '/' . $tmp[0]; @@ -612,7 +612,7 @@ $entry['adr_one_type'] = substr($buffer['adr_one_type'],0,-1); $entry['adr_two_type'] = substr($buffer['adr_two_type'],0,-1); - if(count($street = split("\r*\n",$buffer['adr_one_street'],3)) > 1) + if(count($street = preg_split("/\r*\n/",$buffer['adr_one_street'],3)) > 1) { $entry['adr_one_street'] = $street[0]; // RB 2001/05/08 added for Lotus Organizer to split multiline adresses $entry['address2'] = $street[1]; @@ -650,7 +650,7 @@ } elseif($value == 'BDAY') { - $tmp = split('/',$buffer[$value]); # 12/31/1969 -> 1969-12-31 + $tmp = explode('/',$buffer[$value]); # 12/31/1969 -> 1969-12-31 if($tmp[0]) { if(strlen($tmp[0]) == 1) { $tmp[0] = '0'.$tmp[0]; } diff --git a/phpgwapi/inc/class.wsdl.inc.php b/phpgwapi/inc/class.wsdl.inc.php index a633f4967a..b1e2770030 100644 --- a/phpgwapi/inc/class.wsdl.inc.php +++ b/phpgwapi/inc/class.wsdl.inc.php @@ -205,7 +205,7 @@ break; } // get element prefix - if(ereg(":",$name)) + if(preg_match('/'.":".'/',$name)) { $prefix = substr($name,0,strpos($name,':')); } diff --git a/phpgwapi/inc/class.xml.inc.php b/phpgwapi/inc/class.xml.inc.php index efd56fc1e7..e67033b26a 100644 --- a/phpgwapi/inc/class.xml.inc.php +++ b/phpgwapi/inc/class.xml.inc.php @@ -494,7 +494,7 @@ class XML 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::"); @@ -612,7 +612,7 @@ class XML 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::"); @@ -649,7 +649,7 @@ class XML 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::"); @@ -688,7 +688,7 @@ class XML 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::"); @@ -1053,7 +1053,7 @@ class XML ); // Check whether there are predicates. - if ( ereg("\[", $step) ) + if ( preg_match('/'."\[".'/', $step) ) { // Get the predicates. $predicates = substr($step, strpos($step, "[")); @@ -1099,7 +1099,7 @@ class XML $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, "(")) ) @@ -1130,13 +1130,13 @@ class XML $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"; @@ -1154,7 +1154,7 @@ class XML $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"; @@ -1496,7 +1496,7 @@ class XML 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, "-"); @@ -1615,7 +1615,7 @@ class XML } // Check whether the predicate is a function. - if ( ereg("\(", $predicate) ) + if ( preg_match('/'."\(".'/', $predicate) ) { // Get the position of the first bracket. $start = strpos($predicate, "("); @@ -1664,8 +1664,8 @@ class XML } // 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); @@ -1718,7 +1718,7 @@ class XML 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()"; @@ -1786,7 +1786,7 @@ class XML 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, "("); @@ -1862,7 +1862,7 @@ class XML // 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 ) @@ -2592,8 +2592,8 @@ class XML 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); @@ -2701,7 +2701,7 @@ class XML $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; @@ -2935,8 +2935,8 @@ class XML $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); @@ -3128,8 +3128,8 @@ class XML 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); @@ -3367,7 +3367,7 @@ class XML } // Replace the last separator. - $command = eregi_replace(", $", ");", $command); + $command = preg_replace('/'.", $".'/i', ");", $command); // Execute the command. eval($command); diff --git a/phpgwapi/inc/class.xmlrpc_client.inc.php b/phpgwapi/inc/class.xmlrpc_client.inc.php index 87f36bf2c0..19e773d779 100644 --- a/phpgwapi/inc/class.xmlrpc_client.inc.php +++ b/phpgwapi/inc/class.xmlrpc_client.inc.php @@ -211,7 +211,7 @@ } elseif(is_string($msg)) { - $n =& new xmlrpcmsg(''); + $n = new xmlrpcmsg(''); $n->payload = $msg; $msg = $n; } @@ -668,17 +668,17 @@ $calls = array(); foreach($msgs as $msg) { - $call['methodName'] =& new xmlrpcval($msg->method(),'string'); + $call['methodName'] = new xmlrpcval($msg->method(),'string'); $numParams = $msg->getNumParams(); $params = array(); for($i = 0; $i < $numParams; $i++) { $params[$i] = $msg->getParam($i); } - $call['params'] =& new xmlrpcval($params, 'array'); - $calls[] =& new xmlrpcval($call, 'struct'); + $call['params'] = new xmlrpcval($params, 'array'); + $calls[] = new xmlrpcval($call, 'struct'); } - $multicall =& new xmlrpcmsg('system.multicall'); + $multicall = new xmlrpcmsg('system.multicall'); $multicall->addParam(new xmlrpcval($calls, 'array')); // Attempt RPC call @@ -717,7 +717,7 @@ return false; // Bad value } // Normal return value - $response[$i] =& new xmlrpcresp($val->arraymem(0)); + $response[$i] = new xmlrpcresp($val->arraymem(0)); break; case 'struct': $code = $val->structmem('faultCode'); @@ -730,7 +730,7 @@ { return false; } - $response[$i] =& new xmlrpcresp(0, $code->scalarval(), $str->scalarval()); + $response[$i] = new xmlrpcresp(0, $code->scalarval(), $str->scalarval()); break; default: return false; diff --git a/phpgwapi/inc/class.xmlrpc_server.inc.php b/phpgwapi/inc/class.xmlrpc_server.inc.php index 80540ea0bb..16e842646e 100644 --- a/phpgwapi/inc/class.xmlrpc_server.inc.php +++ b/phpgwapi/inc/class.xmlrpc_server.inc.php @@ -52,12 +52,12 @@ { $arr = array(); - if (ereg('^([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})$',$isodate,$arr)) + if (preg_match('/^([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})$/',$isodate,$arr)) { // $isodate is simple ISO8601, remove the difference between split and ereg array_shift($arr); } - elseif (($arr = split('[-:T]',$isodate)) && count($arr) == 6) + elseif (($arr = preg_split('/[-:T]/',$isodate)) && count($arr) == 6) { // $isodate is extended ISO8601, do nothing } diff --git a/phpgwapi/inc/class.xmlrpc_server_epi.inc.php b/phpgwapi/inc/class.xmlrpc_server_epi.inc.php index 6cc0c8166d..199dc2015a 100644 --- a/phpgwapi/inc/class.xmlrpc_server_epi.inc.php +++ b/phpgwapi/inc/class.xmlrpc_server_epi.inc.php @@ -161,7 +161,7 @@ $syscall = 0; /* Setup dispatch map based on the function, if this is a system call */ - if(ereg('^system\.', $methName)) + if(preg_match('/^system\./', $methName)) { foreach($GLOBALS['_xmlrpcs_dmap'] as $meth => $dat) { @@ -170,8 +170,8 @@ $sysCall = 1; $dmap = $this->dmap; } - elseif(ereg('^examples\.',$methName) || - ereg('^validator1\.',$methName) || + elseif(preg_match('/^examples\./',$methName) || + preg_match('/^validator1\./',$methName) || ereg('^interopEchoTests\.', $methName) ) { diff --git a/phpgwapi/inc/class.xmlrpc_server_php.inc.php b/phpgwapi/inc/class.xmlrpc_server_php.inc.php index 18575dd742..fb66925eb1 100644 --- a/phpgwapi/inc/class.xmlrpc_server_php.inc.php +++ b/phpgwapi/inc/class.xmlrpc_server_php.inc.php @@ -238,8 +238,8 @@ } $_type = (is_integer($_res) ? 'int' : gettype($_res)); - if ($_type == 'string' && (ereg('^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}$',$_res) || - ereg('^[0-9]{4}[0-9]{2}[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}$',$_res))) + if ($_type == 'string' && (preg_match('/^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}$/',$_res) || + preg_match('/^[0-9]{4}[0-9]{2}[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}$/',$_res))) { $_type = 'dateTime.iso8601'; } @@ -312,7 +312,7 @@ $_methName = $GLOBALS['_xh'][$parser]['method']; $this->last_method = $methName; - if(ereg("^system\.", $methName)) + if(preg_match('/'."^system\.".'/', $methName)) { $dmap = $GLOBALS['_xmlrpcs_dmap']; $sysCall=1; @@ -346,7 +346,7 @@ $service = $tmp[1]; $class = $tmp[0]; - if(ereg('^service',$method)) + if(preg_match('/^service/',$method)) { $t = 'phpgwapi.' . $class . '.exec'; $dmap = ExecMethod($t,array($service,'list_methods','xmlrpc')); @@ -420,7 +420,7 @@ // decode from utf-8 to our charset $this->req_array = $GLOBALS['egw']->translation->convert($this->req_array,'utf-8'); //_debug_array($this->req_array); - if (ereg('^service',$method)) + if (preg_match('/^service/',$method)) { $res = ExecMethod('phpgwapi.service.exec',array($service,$methName,$this->req_array)); } diff --git a/phpgwapi/inc/class.xmlrpcmsg.inc.php b/phpgwapi/inc/class.xmlrpcmsg.inc.php index b4e406da6b..38bb94f821 100644 --- a/phpgwapi/inc/class.xmlrpcmsg.inc.php +++ b/phpgwapi/inc/class.xmlrpcmsg.inc.php @@ -130,10 +130,10 @@ } // see if we got an HTTP 200 OK, else bomb // but only do this if we're using the HTTP protocol. - if(ereg("^HTTP",$data)) + if(preg_match('/'."^HTTP".'/',$data)) { // Strip HTTP 1.1 100 Continue header if present - while(ereg('^HTTP/1.1 1[0-9]{2} ', $data)) + while(preg_match('/^HTTP\\/1.1 1[0-9]{2} /', $data)) { $pos = strpos($data, 'HTTP', 12); // server sent a Continue header without any (valid) content following... @@ -144,7 +144,7 @@ } $data = substr($data, $pos); } - if(!ereg("^HTTP/[0-9\\.]+ 200 ", $data)) + if(!preg_match('/'."^HTTP\\/[0-9\\.]+ 200 ".'/', $data)) { $errstr= substr($data, 0, strpos($data, "\n")-1); error_log('HTTP error, got response: ' .$errstr); @@ -159,7 +159,7 @@ $GLOBALS['_xh'][$parser]['valuestack'] = array(); // separate HTTP headers from data - if(ereg("^HTTP", $data)) + if(preg_match('/'."^HTTP".'/', $data)) { // be tolerant to usage of \n instead of \r\n to separate headers and data // (even though it is not valid http) @@ -182,7 +182,7 @@ } } // be tolerant to line endings, and extra empty lines - $ar = split("\r?\n", trim(substr($data, 0, $pos))); + $ar = preg_split("/\r?\n/", trim(substr($data, 0, $pos))); while(list(,$line) = @each($ar)) { // take care of multi-line headers diff --git a/phpgwapi/inc/class.xmlrpcresp.inc.php b/phpgwapi/inc/class.xmlrpcresp.inc.php index 0d1c327287..41b8522d33 100644 --- a/phpgwapi/inc/class.xmlrpcresp.inc.php +++ b/phpgwapi/inc/class.xmlrpcresp.inc.php @@ -40,7 +40,7 @@ // programmer error // TODO error_log("Invalid type '" . gettype($val) . "' (value: $val) passed to xmlrpcresp. Defaulting to empty value."); - $this->val =& new xmlrpcval(); + $this->val = new xmlrpcval(); } else { diff --git a/phpgwapi/inc/class.xmlrpcval.inc.php b/phpgwapi/inc/class.xmlrpcval.inc.php index 812c27227c..520ae28f95 100644 --- a/phpgwapi/inc/class.xmlrpcval.inc.php +++ b/phpgwapi/inc/class.xmlrpcval.inc.php @@ -84,7 +84,7 @@ case 2: // we're adding a scalar value to an array here //$ar=$this->me['array']; - //$ar[]=&new xmlrpcval($val, $type); + //$ar[]= new xmlrpcval($val, $type); //$this->me['array']=$ar; // Faster (?) avoid all the costly array-copy-by-val done here... $this->me['array'][]=& CreateObject('phpgwapi.xmlrpcval',$val, $type); diff --git a/phpgwapi/inc/common_functions.inc.php b/phpgwapi/inc/common_functions.inc.php index 547103584e..1900e71b82 100755 --- a/phpgwapi/inc/common_functions.inc.php +++ b/phpgwapi/inc/common_functions.inc.php @@ -152,7 +152,7 @@ function print_debug($message,$var = 'messageonly',$part = 'app', $level = 3) /* if (!!(DEBUG_OUTPUT & 32)) { - $obj_debug =& new COM('Some_COM_App.Class','localhost'); + $obj_debug = new COM('Some_COM_App.Class','localhost'); if (is_object($obj_debug)) { $DebugMessage_return = $obj_debug->DebugMessage($output); @@ -376,9 +376,9 @@ function sanitize($string,$type) } break; case 'ip': - if (eregi("^[0-9]{1,3}(\.[0-9]{1,3}){3}$",$string)) + if (preg_match('/'."^[0-9]{1,3}(\.[0-9]{1,3}){3}$".'/i',$string)) { - $octets = split('\.',$string); + $octets = preg_split('/\./',$string); for ($i=0; $i != count($octets); $i++) { if ($octets[$i] < 0 || $octets[$i] > 255) @@ -397,7 +397,7 @@ function sanitize($string,$type) } break; case 'email': - if (eregi("^([[:alnum:]_%+=.-]+)@([[:alnum:]_.-]+)\.([a-z]{2,3}|[0-9]{1,3})$",$string)) + if (preg_match('/'."^([[:alnum:]_%+=.-]+)@([[:alnum:]_.-]+)\.([a-z]{2,3}|[0-9]{1,3})$".'/i',$string)) { return True; } @@ -749,19 +749,19 @@ function &CreateObject($class) switch(count($args)) { case 1: - $obj =& new $classname; + $obj = new $classname; break; case 2: - $obj =& new $classname($args[1]); + $obj = new $classname($args[1]); break; case 3: - $obj =& new $classname($args[1],$args[2]); + $obj = new $classname($args[1],$args[2]); break; case 4: - $obj =& new $classname($args[1],$args[2],$args[3]); + $obj = new $classname($args[1],$args[2],$args[3]); break; default: - $code = '$obj =& new ' . $classname . '('; + $code = '$obj = new ' . $classname . '('; foreach($args as $n => $arg) { if ($n) diff --git a/phpgwapi/inc/fpdf/tutorial/tuto6.php b/phpgwapi/inc/fpdf/tutorial/tuto6.php index 0d81a706ea..1893fbe6ff 100755 --- a/phpgwapi/inc/fpdf/tutorial/tuto6.php +++ b/phpgwapi/inc/fpdf/tutorial/tuto6.php @@ -47,7 +47,7 @@ function WriteHTML($html) $tag=strtoupper(array_shift($a2)); $attr=array(); foreach($a2 as $v) - if(ereg('^([^=]*)=["\']?([^"\']*)["\']?$',$v,$a3)) + if(preg_match('/^([^=]*)=["\']?([^"\']*)["\']?$/',$v,$a3)) $attr[strtoupper($a3[1])]=$a3[2]; $this->OpenTag($tag,$attr); } diff --git a/phpgwapi/inc/functions.inc.php b/phpgwapi/inc/functions.inc.php index 591ab09700..2314265898 100644 --- a/phpgwapi/inc/functions.inc.php +++ b/phpgwapi/inc/functions.inc.php @@ -18,7 +18,10 @@ */ error_reporting(E_ALL & ~E_NOTICE); -magic_quotes_runtime(false); +if (function_exists('get_magic_quotes_runtime') && get_magic_quotes_runtime()) +{ + set_magic_quotes_runtime(false); +} $egw_min_php_version = '5.1'; if (!function_exists('version_compare') || version_compare(PHP_VERSION,$egw_min_php_version) < 0) diff --git a/phpgwapi/inc/horde/Horde/Browser/imode.php b/phpgwapi/inc/horde/Horde/Browser/imode.php index 9c244af1a0..6e0641e7e2 100644 --- a/phpgwapi/inc/horde/Horde/Browser/imode.php +++ b/phpgwapi/inc/horde/Horde/Browser/imode.php @@ -289,14 +289,13 @@ class Browser_imode { var $_manufacturer; var $_httpversion; var $_cache = 5; - var $_extra; /** * Does not handle bogus user_agents or most of the other error * situation properly yet. * * Example usage: - * $ua = &new Browser_imode($_SERVEr['HTTP_USER_AGENT']); + * $ua = new Browser_imode($_SERVEr['HTTP_USER_AGENT']); * * @param string $input The user agent to match. */ diff --git a/phpgwapi/inc/horde/Horde/RPC.php b/phpgwapi/inc/horde/Horde/RPC.php index 0be53fa29b..4f01799312 100644 --- a/phpgwapi/inc/horde/Horde/RPC.php +++ b/phpgwapi/inc/horde/Horde/RPC.php @@ -206,7 +206,7 @@ class Horde_RPC { } $class = 'Horde_RPC_' . $driver; if (class_exists($class)) { - $rpc = &new $class($params); + $rpc = new $class($params); } else { require_once 'PEAR.php'; $rpc = PEAR::raiseError('Class definition of ' . $class . ' not found.'); diff --git a/phpgwapi/inc/horde/Horde/RPC/syncml.php b/phpgwapi/inc/horde/Horde/RPC/syncml.php index a25ab8a63c..f276e2f6b2 100644 --- a/phpgwapi/inc/horde/Horde/RPC/syncml.php +++ b/phpgwapi/inc/horde/Horde/RPC/syncml.php @@ -89,7 +89,7 @@ class Horde_RPC_syncml extends Horde_RPC { } require_once 'XML/WBXML/ContentHandler.php'; - $this->_output = &new XML_WBXML_ContentHandler(); + $this->_output = new XML_WBXML_ContentHandler(); $this->_parse($request); $response = $this->_output->getOutput(); @@ -200,7 +200,7 @@ class Horde_RPC_syncml extends Horde_RPC { // Either or if (!isset($this->_contentHandler)) { // If not defined then create SyncHdr. - $this->_contentHandler = &new Horde_SyncML_SyncmlHdr(); + $this->_contentHandler = new Horde_SyncML_SyncmlHdr(); $this->_contentHandler->setOutput($this->_output); } @@ -233,7 +233,7 @@ class Horde_RPC_syncml extends Horde_RPC { unset($this->_contentHandler); - $this->_contentHandler = &new Horde_SyncML_SyncmlBody(); + $this->_contentHandler = new Horde_SyncML_SyncmlBody(); $this->_contentHandler->setOutput($this->_output); } else { // No longer used. diff --git a/phpgwapi/inc/horde/Horde/RPC/syncml_wbxml.php b/phpgwapi/inc/horde/Horde/RPC/syncml_wbxml.php index 1cf5920b17..3d478996a3 100644 --- a/phpgwapi/inc/horde/Horde/RPC/syncml_wbxml.php +++ b/phpgwapi/inc/horde/Horde/RPC/syncml_wbxml.php @@ -51,8 +51,8 @@ class Horde_RPC_syncml_wbxml extends Horde_RPC_syncml { } - $decoder = &new XML_WBXML_Decoder(); - $this->_output = &new XML_WBXML_Encoder(); + $decoder = new XML_WBXML_Decoder(); + $this->_output = new XML_WBXML_Encoder(); $decoder->setContentHandler($this); diff --git a/phpgwapi/inc/horde/Horde/SyncML.php b/phpgwapi/inc/horde/Horde/SyncML.php index e57da5d0ec..50bd3935bd 100644 --- a/phpgwapi/inc/horde/Horde/SyncML.php +++ b/phpgwapi/inc/horde/Horde/SyncML.php @@ -174,8 +174,8 @@ class Horde_SyncML_SyncMLHdr extends Horde_SyncML_ContentHandler { // Create a new state if one does not already exist. Horde::logMessage('SyncML['. session_id() .']: create new session state variable', __FILE__, __LINE__, PEAR_LOG_DEBUG); -# LK $_SESSION['SyncML.state'] = &new Horde_SyncML_State($sourceURI, $locName, $sessionID); - $_SESSION['SyncML.state'] = &new EGW_SyncML_State($sourceURI, $locName, $sessionID); +# LK $_SESSION['SyncML.state'] = new Horde_SyncML_State($sourceURI, $locName, $sessionID); + $_SESSION['SyncML.state'] = new EGW_SyncML_State($sourceURI, $locName, $sessionID); } #if($_SESSION['SyncML.state']->_isAuthorized) # Horde::logMessage('SyncML['. session_id() .']: is session authorized', __FILE__, __LINE__, PEAR_LOG_DEBUG); @@ -269,7 +269,7 @@ class Horde_SyncML_SyncMLHdr extends Horde_SyncML_ContentHandler { $this->_credData = base64_decode($this->_credData); //} - $tmp = split(':', $this->_credData, 2); + $tmp = explode(':', $this->_credData, 2); // set only if not set by LocName already if(!isset($this->_locName)) { @@ -463,13 +463,13 @@ class Horde_SyncML_SyncMLBody extends Horde_SyncML_ContentHandler { if($state->getLocName()) { // Right our status about the header. - $status = &new Horde_SyncML_Command_Status(($state->isAuthorized()) ? + $status = new Horde_SyncML_Command_Status(($state->isAuthorized()) ? RESPONSE_AUTHENTICATION_ACCEPTED : RESPONSE_INVALID_CREDENTIALS, 'SyncHdr'); } else { // Request credentials if not sent so far - $status = &new Horde_SyncML_Command_Status(RESPONSE_MISSING_CREDENTIALS, 'SyncHdr'); + $status = new Horde_SyncML_Command_Status(RESPONSE_MISSING_CREDENTIALS, 'SyncHdr'); } $status->setSourceRef($state->getSourceURI()); @@ -533,14 +533,14 @@ class Horde_SyncML_SyncMLBody extends Horde_SyncML_ContentHandler { // we do still have some data to send OR // we should reply to the Sync command if($state->getSyncStatus() >= CLIENT_SYNC_ACKNOWLEDGED && $state->getSyncStatus() < SERVER_SYNC_FINNISHED) { - $sync = &new Horde_SyncML_Command_Sync(); + $sync = new Horde_SyncML_Command_Sync(); $this->_currentCmdID = $sync->syncToClient($this->_currentCmdID, $this->_output); } // send the Final tag if possible #if($state->getSyncStatus() != SERVER_SYNC_DATA_PENDING && $state->getSyncStatus() != CLIENT_SYNC_STARTED) { if($state->getSyncStatus() >= SERVER_SYNC_FINNISHED || $state->_sendFinal) { - $final = &new Horde_SyncML_Command_Final(); + $final = new Horde_SyncML_Command_Final(); $this->_currentCmdID = $final->output($this->_currentCmdID, $this->_output); } diff --git a/phpgwapi/inc/horde/Horde/SyncML/Command.php b/phpgwapi/inc/horde/Horde/SyncML/Command.php index e67c41d1d6..97a2236109 100644 --- a/phpgwapi/inc/horde/Horde/SyncML/Command.php +++ b/phpgwapi/inc/horde/Horde/SyncML/Command.php @@ -30,7 +30,7 @@ class Horde_SyncML_Command { include_once 'Horde/SyncML/Command/' . $command . '.php'; $class = 'Horde_SyncML_Command_' . $command; if (class_exists($class)) { - return $cmd = &new $class($params); + return $cmd = new $class($params); } else { Horde::logMessage('SyncML: Class definition of ' . $class . ' not found.', __FILE__, __LINE__, PEAR_LOG_ERR); require_once 'PEAR.php'; diff --git a/phpgwapi/inc/horde/Horde/SyncML/Command/Alert.php b/phpgwapi/inc/horde/Horde/SyncML/Command/Alert.php index cc5c90d089..642211165d 100644 --- a/phpgwapi/inc/horde/Horde/SyncML/Command/Alert.php +++ b/phpgwapi/inc/horde/Horde/SyncML/Command/Alert.php @@ -70,7 +70,7 @@ class Horde_SyncML_Command_Alert extends Horde_SyncML_Command { // Handle unauthorized first. if (!$state->isAuthorized()) { - $status = &new Horde_SyncML_Command_Status(RESPONSE_INVALID_CREDENTIALS, 'Alert'); + $status = new Horde_SyncML_Command_Status(RESPONSE_INVALID_CREDENTIALS, 'Alert'); $status->setCmdRef($this->_cmdID); $currentCmdID = $status->output($currentCmdID, $output); return $currentCmdID; @@ -127,7 +127,7 @@ class Horde_SyncML_Command_Alert extends Horde_SyncML_Command { //$state->removeAllUID($this->_targetLocURI); } - $status = &new Horde_SyncML_Command_Status($code, 'Alert'); + $status = new Horde_SyncML_Command_Status($code, 'Alert'); $status->setCmdRef($this->_cmdID); if ($this->_sourceLocURI != null) { $status->setSourceRef($this->_sourceLocURI); @@ -241,7 +241,7 @@ class Horde_SyncML_Command_Alert extends Horde_SyncML_Command { } } elseif ($this->_alert == ALERT_NEXT_MESSAGE) { - $status = &new Horde_SyncML_Command_Status(RESPONSE_OK, 'Alert'); + $status = new Horde_SyncML_Command_Status(RESPONSE_OK, 'Alert'); $status->setCmdRef($this->_cmdID); if ($this->_targetLocURI != null) { $status->setTargetRef((isset($this->_targetLocURIParameters) ? $this->_targetLocURI.'?/'.$this->_targetLocURIParameters : $this->_targetLocURI)); @@ -256,7 +256,7 @@ class Horde_SyncML_Command_Alert extends Horde_SyncML_Command { $state->setAlert222Received(true); } else { - $status = &new Horde_SyncML_Command_Status(RESPONSE_OK, 'Alert'); + $status = new Horde_SyncML_Command_Status(RESPONSE_OK, 'Alert'); $status->setCmdRef($this->_cmdID); if ($this->_sourceLocURI != null) { $status->setSourceRef($this->_sourceLocURI); diff --git a/phpgwapi/inc/horde/Horde/SyncML/Command/Get.php b/phpgwapi/inc/horde/Horde/SyncML/Command/Get.php index ddcc6122ae..82199ab933 100644 --- a/phpgwapi/inc/horde/Horde/SyncML/Command/Get.php +++ b/phpgwapi/inc/horde/Horde/SyncML/Command/Get.php @@ -28,7 +28,7 @@ class Horde_SyncML_Command_Get extends Horde_SyncML_Command { $ref = ($state->getVersion() == 0) ? './devinf10' : './devinf11'; - $status = &new Horde_SyncML_Command_Status((($state->isAuthorized()) ? RESPONSE_OK : RESPONSE_INVALID_CREDENTIALS), 'Get'); + $status = new Horde_SyncML_Command_Status((($state->isAuthorized()) ? RESPONSE_OK : RESPONSE_INVALID_CREDENTIALS), 'Get'); $status->setCmdRef($this->_cmdID); $status->setTargetRef($ref); $currentCmdID = $status->output($currentCmdID, $output); diff --git a/phpgwapi/inc/horde/Horde/SyncML/Command/Map.php b/phpgwapi/inc/horde/Horde/SyncML/Command/Map.php index 264682de77..fcca7b266c 100644 --- a/phpgwapi/inc/horde/Horde/SyncML/Command/Map.php +++ b/phpgwapi/inc/horde/Horde/SyncML/Command/Map.php @@ -46,7 +46,7 @@ class Horde_SyncML_Command_Map extends Horde_SyncML_Command { $state = $_SESSION['SyncML.state']; - $status = &new Horde_SyncML_Command_Status($state->isAuthorized() ? RESPONSE_OK : RESPONSE_INVALID_CREDENTIALS, 'Map'); + $status = new Horde_SyncML_Command_Status($state->isAuthorized() ? RESPONSE_OK : RESPONSE_INVALID_CREDENTIALS, 'Map'); $status->setCmdRef($this->_cmdID); if ($this->_sourceLocURI != null) { $status->setSourceRef($this->_sourceLocURI); diff --git a/phpgwapi/inc/horde/Horde/SyncML/Command/Put.php b/phpgwapi/inc/horde/Horde/SyncML/Command/Put.php index 3834cf320e..09f78e784f 100644 --- a/phpgwapi/inc/horde/Horde/SyncML/Command/Put.php +++ b/phpgwapi/inc/horde/Horde/SyncML/Command/Put.php @@ -240,7 +240,7 @@ class Horde_SyncML_Command_Put extends Horde_SyncML_Command { function output($currentCmdID, &$output ) { $state = &$_SESSION['SyncML.state']; - $status = &new Horde_SyncML_Command_Status((($state->isAuthorized()) ? RESPONSE_OK : RESPONSE_INVALID_CREDENTIALS), 'Put'); + $status = new Horde_SyncML_Command_Status((($state->isAuthorized()) ? RESPONSE_OK : RESPONSE_INVALID_CREDENTIALS), 'Put'); $status->setCmdRef($this->_cmdID); $ref = ($state->getVersion() == 0) ? './devinf10' : './devinf11'; diff --git a/phpgwapi/inc/horde/Horde/SyncML/Command/Results.php b/phpgwapi/inc/horde/Horde/SyncML/Command/Results.php index 6adec7fcef..ca06ebd60c 100644 --- a/phpgwapi/inc/horde/Horde/SyncML/Command/Results.php +++ b/phpgwapi/inc/horde/Horde/SyncML/Command/Results.php @@ -184,7 +184,7 @@ class Horde_SyncML_Command_Results extends Horde_SyncML_Command { #Horde::logMessage('SyncML: BIG TODO!!!!!!!!!!!!!!!!!! parse reply', __FILE__, __LINE__, PEAR_LOG_DEBUG); $state = &$_SESSION['SyncML.state']; - $status = &new Horde_SyncML_Command_Status((($state->isAuthorized()) ? RESPONSE_OK : RESPONSE_INVALID_CREDENTIALS), 'Results'); + $status = new Horde_SyncML_Command_Status((($state->isAuthorized()) ? RESPONSE_OK : RESPONSE_INVALID_CREDENTIALS), 'Results'); $status->setCmdRef($this->_cmdID); $ref = ($state->getVersion() == 0) ? './devinf10' : './devinf11'; diff --git a/phpgwapi/inc/horde/Horde/SyncML/Command/Sync.php b/phpgwapi/inc/horde/Horde/SyncML/Command/Sync.php index ad88fdcb7f..c5ff34d483 100644 --- a/phpgwapi/inc/horde/Horde/SyncML/Command/Sync.php +++ b/phpgwapi/inc/horde/Horde/SyncML/Command/Sync.php @@ -35,7 +35,7 @@ class Horde_SyncML_Command_Sync extends Horde_Syncml_Command { Horde::logMessage('SyncML: $this->_targetURI = ' . $this->_targetURI, __FILE__, __LINE__, PEAR_LOG_DEBUG); - $status = &new Horde_SyncML_Command_Status(RESPONSE_OK, 'Sync'); + $status = new Horde_SyncML_Command_Status(RESPONSE_OK, 'Sync'); // $status->setState($state); diff --git a/phpgwapi/inc/horde/Horde/SyncML/Command/Sync/Add.php b/phpgwapi/inc/horde/Horde/SyncML/Command/Sync/Add.php index 8aacf9845a..7b4bec7f43 100644 --- a/phpgwapi/inc/horde/Horde/SyncML/Command/Sync/Add.php +++ b/phpgwapi/inc/horde/Horde/SyncML/Command/Sync/Add.php @@ -21,7 +21,7 @@ class Horde_SyncML_Command_Sync_Add extends Horde_SyncML_Command_Sync_SyncElemen function output($currentCmdID, &$output) { - $status = &new Horde_SyncML_Command_Status($this->_status, 'Add'); + $status = new Horde_SyncML_Command_Status($this->_status, 'Add'); $status->setCmdRef($this->_cmdID); if (isset($this->_luid)) { diff --git a/phpgwapi/inc/horde/Horde/SyncML/Command/Sync/Delete.php b/phpgwapi/inc/horde/Horde/SyncML/Command/Sync/Delete.php index 5ed168b5fc..57132f981d 100644 --- a/phpgwapi/inc/horde/Horde/SyncML/Command/Sync/Delete.php +++ b/phpgwapi/inc/horde/Horde/SyncML/Command/Sync/Delete.php @@ -19,7 +19,7 @@ class Horde_SyncML_Command_Sync_Delete extends Horde_SyncML_Command_Sync_SyncEle function output($currentCmdID, &$output) { - $status = &new Horde_SyncML_Command_Status($this->_status, 'Delete'); + $status = new Horde_SyncML_Command_Status($this->_status, 'Delete'); $status->setCmdRef($this->_cmdID); if (isset($this->_luid)) { diff --git a/phpgwapi/inc/horde/Horde/SyncML/Command/Sync/Replace.php b/phpgwapi/inc/horde/Horde/SyncML/Command/Sync/Replace.php index dc08fb741d..2168700d11 100644 --- a/phpgwapi/inc/horde/Horde/SyncML/Command/Sync/Replace.php +++ b/phpgwapi/inc/horde/Horde/SyncML/Command/Sync/Replace.php @@ -17,7 +17,7 @@ include_once 'Horde/SyncML/Command/Sync/SyncElement.php'; */ class Horde_SyncML_Command_Sync_Replace extends Horde_SyncML_Command_Sync_SyncElement { function output($currentCmdID, &$output) { - $status = &new Horde_SyncML_Command_Status($this->_status, 'Replace'); + $status = new Horde_SyncML_Command_Status($this->_status, 'Replace'); $status->setCmdRef($this->_cmdID); if (isset($this->_luid)) { diff --git a/phpgwapi/inc/horde/Horde/SyncML/Command/Sync/SyncElement.php b/phpgwapi/inc/horde/Horde/SyncML/Command/Sync/SyncElement.php index d4d742a07f..9adef9aabf 100644 --- a/phpgwapi/inc/horde/Horde/SyncML/Command/Sync/SyncElement.php +++ b/phpgwapi/inc/horde/Horde/SyncML/Command/Sync/SyncElement.php @@ -34,7 +34,7 @@ class Horde_SyncML_Command_Sync_SyncElement extends Horde_SyncML_Command { if (class_exists($class)) { #Horde::logMessage('SyncML: Class definition of ' . $class . ' found in SyncElement::factory.', __FILE__, __LINE__, PEAR_LOG_DEBUG); - return $element = &new $class($params); + return $element = new $class($params); } else { Horde::logMessage('SyncML: Class definition of ' . $class . ' not found in SyncElement::factory.', __FILE__, __LINE__, PEAR_LOG_DEBUG); require_once 'PEAR.php'; diff --git a/phpgwapi/inc/horde/Horde/SyncML/State.php b/phpgwapi/inc/horde/Horde/SyncML/State.php index cdda954520..515771d6f3 100644 --- a/phpgwapi/inc/horde/Horde/SyncML/State.php +++ b/phpgwapi/inc/horde/Horde/SyncML/State.php @@ -554,7 +554,7 @@ class Horde_SyncML_State { $dt = &$this->getDataTree(); // Set $locid. - $gid = &new DataTreeObject($this->_locName . $this->_sourceURI . $type . $guid); + $gid = new DataTreeObject($this->_locName . $this->_sourceURI . $type . $guid); $gid->set('type', $type); $gid->set('locid', $locid); $gid->set('ts', $ts); @@ -567,7 +567,7 @@ class Horde_SyncML_State { $this->dieOnError($r, __FILE__, __LINE__); // Set $globaluid - $lid = &new DataTreeObject($this->_locName . $this->_sourceURI . $type . $locid); + $lid = new DataTreeObject($this->_locName . $this->_sourceURI . $type . $locid); $lid->set('globaluid', $guid); $r = $dt->add($lid); if (is_a($r, 'PEAR_Error')) { @@ -926,7 +926,7 @@ class Horde_SyncML_State { $s = $this->_locName . $this->_sourceURI . 'deviceInfo'; // Set $locid. - $info = &new DataTreeObject($s); + $info = new DataTreeObject($s); $info->set('ClientDeviceInfo', $this->_clientDeviceInfo); $r = $dt->add($info); if (is_a($r, 'PEAR_Error')) { @@ -952,7 +952,7 @@ class Horde_SyncML_State { $s = $this->_locName . $this->_sourceURI . $type . 'syncSummary'; // Set $locid. - $info = &new DataTreeObject($s); + $info = new DataTreeObject($s); $info->set('ClientAnchor', $this->_clientAnchorNext); $info->set('ServerAnchor', $this->_serverAnchorNext); $r = $dt->add($info); diff --git a/phpgwapi/inc/horde/Horde/SyncML/State_egw.php b/phpgwapi/inc/horde/Horde/SyncML/State_egw.php index 3e5be1abdc..e1570c9409 100644 --- a/phpgwapi/inc/horde/Horde/SyncML/State_egw.php +++ b/phpgwapi/inc/horde/Horde/SyncML/State_egw.php @@ -92,7 +92,7 @@ class EGW_SyncML_State extends Horde_SyncML_State if ($ts = $GLOBALS['egw']->db->select('egw_contentmap', 'map_timestamp', array( 'map_id' => $mapID, 'map_guid' => $guid, - ), __LINE__, __FILE__, false, '', 'syncml')->fetchSingle()) + ), __LINE__, __FILE__, false, '', 'syncml')->fetchColumn()) { #Horde::logMessage('SyncML: getChangeTS changets is ' . $GLOBALS['egw']->db->from_timestamp($ts), __FILE__, __LINE__, PEAR_LOG_DEBUG); return $GLOBALS['egw']->db->from_timestamp($ts); @@ -112,7 +112,7 @@ class EGW_SyncML_State extends Horde_SyncML_State if(($deviceID = $GLOBALS['egw']->db->select('egw_syncmldeviceowner', 'owner_devid',array ( 'owner_locname' => $this->_locName, 'owner_deviceid' => $this->_sourceURI, - ), __LINE__, __FILE__, false, '', 'syncml')->fetchSingle())) + ), __LINE__, __FILE__, false, '', 'syncml')->fetchColumn())) { $cols = array( 'dev_dtdversion', @@ -190,7 +190,7 @@ class EGW_SyncML_State extends Horde_SyncML_State 'map_id' => $mapID, 'map_locuid' => $locid, 'map_expired' => 0, - ), __LINE__, __FILE__, false, '', 'syncml')->fetchSingle(); + ), __LINE__, __FILE__, false, '', 'syncml')->fetchColumn(); } /** @@ -208,7 +208,7 @@ class EGW_SyncML_State extends Horde_SyncML_State if (($locuid = $GLOBALS['egw']->db->select('egw_contentmap', 'map_locuid', array( 'map_id' => $mapID, 'map_guid' => $guid - ), __LINE__, __FILE__, false, '', 'syncml')->fetchSingle())) + ), __LINE__, __FILE__, false, '', 'syncml')->fetchColumn())) { Horde::logMessage('SyncML: found LocID: '.$locuid, __FILE__, __LINE__, PEAR_LOG_DEBUG); } @@ -337,7 +337,7 @@ class EGW_SyncML_State extends Horde_SyncML_State 'map_locuid' => $locid ); - if (!($guid = $GLOBALS['egw']->db->select('egw_contentmap', 'map_guid', $where, __LINE__, __FILE__, false, '', 'syncml')->fetchSingle())) + if (!($guid = $GLOBALS['egw']->db->select('egw_contentmap', 'map_guid', $where, __LINE__, __FILE__, false, '', 'syncml')->fetchColumn())) { Horde::logMessage("SyncML: state->removeUID(type=$type,locid=$locid) : nothing to remove", __FILE__, __LINE__, PEAR_LOG_INFO); return false; @@ -437,7 +437,7 @@ class EGW_SyncML_State extends Horde_SyncML_State 'dev_fwversion' => $firmwareVersion, ); - if (($deviceID = $GLOBALS['egw']->db->select('egw_syncmldevinfo', 'dev_id', $where, __LINE__, __FILE__, false, '', 'syncml')->fetchSingle())) + if (($deviceID = $GLOBALS['egw']->db->select('egw_syncmldevinfo', 'dev_id', $where, __LINE__, __FILE__, false, '', 'syncml')->fetchColumn())) { $data = array ( 'dev_datastore' => serialize($this->_clientDeviceInfo['dataStore']), diff --git a/phpgwapi/inc/horde/Horde/SyncML/Sync.php b/phpgwapi/inc/horde/Horde/SyncML/Sync.php index 970e831c07..184cb2761d 100644 --- a/phpgwapi/inc/horde/Horde/SyncML/Sync.php +++ b/phpgwapi/inc/horde/Horde/SyncML/Sync.php @@ -42,27 +42,27 @@ class Horde_SyncML_Sync { switch ($alert) { case ALERT_TWO_WAY: include_once 'Horde/SyncML/Sync/TwoWaySync.php'; - return $sync = &new Horde_SyncML_Sync_TwoWaySync(); + return $sync = new Horde_SyncML_Sync_TwoWaySync(); case ALERT_SLOW_SYNC: include_once 'Horde/SyncML/Sync/SlowSync.php'; - return $sync = &new Horde_SyncML_Sync_SlowSync(); + return $sync = new Horde_SyncML_Sync_SlowSync(); case ALERT_ONE_WAY_FROM_CLIENT: include_once 'Horde/SyncML/Sync/OneWayFromClientSync.php'; - return $sync = &new Horde_SyncML_Sync_OneWayFromClientSync(); + return $sync = new Horde_SyncML_Sync_OneWayFromClientSync(); case ALERT_REFRESH_FROM_CLIENT: include_once 'Horde/SyncML/Sync/RefreshFromClientSync.php'; - return $sync = &new Horde_SyncML_Sync_RefreshFromClientSync(); + return $sync = new Horde_SyncML_Sync_RefreshFromClientSync(); case ALERT_ONE_WAY_FROM_SERVER: include_once 'Horde/SyncML/Sync/OneWayFromServerSync.php'; - return $sync = &new Horde_SyncML_Sync_OneWayFromServerSync(); + return $sync = new Horde_SyncML_Sync_OneWayFromServerSync(); case ALERT_REFRESH_FROM_SERVER: include_once 'Horde/SyncML/Sync/RefreshFromServerSync.php'; - return $sync = &new Horde_SyncML_Sync_RefreshFromServerSync(); + return $sync = new Horde_SyncML_Sync_RefreshFromServerSync(); } require_once 'PEAR.php'; diff --git a/phpgwapi/inc/horde/Horde/SyncML/Sync/RefreshFromServerSync.php b/phpgwapi/inc/horde/Horde/SyncML/Sync/RefreshFromServerSync.php index cf2f7ff507..4a5c957f9b 100644 --- a/phpgwapi/inc/horde/Horde/SyncML/Sync/RefreshFromServerSync.php +++ b/phpgwapi/inc/horde/Horde/SyncML/Sync/RefreshFromServerSync.php @@ -36,7 +36,7 @@ class Horde_SyncML_Sync_RefreshFromServerSync extends Horde_SyncML_Sync_TwoWaySy } $contentType = $state->getPreferedContentTypeClient($this->_sourceLocURI, $this->_targetLocURI); - $cmd = &new Horde_SyncML_Command_Sync_ContentSyncElement(); + $cmd = new Horde_SyncML_Command_Sync_ContentSyncElement(); $c = $registry->call($hordeType . '/export', array('guid' => $guid, 'contentType' => $contentType)); Horde::logMessage("SyncML: slowsync add $guid to client ". print_r($c, true), __FILE__, __LINE__, PEAR_LOG_DEBUG); if (!is_a($c, 'PEAR_Error')) { diff --git a/phpgwapi/inc/horde/Horde/SyncML/Sync/SlowSync.php b/phpgwapi/inc/horde/Horde/SyncML/Sync/SlowSync.php index 68485d2c17..de538829c7 100644 --- a/phpgwapi/inc/horde/Horde/SyncML/Sync/SlowSync.php +++ b/phpgwapi/inc/horde/Horde/SyncML/Sync/SlowSync.php @@ -41,7 +41,7 @@ class Horde_SyncML_Sync_SlowSync extends Horde_SyncML_Sync_TwoWaySync { } $contentType = $state->getPreferedContentTypeClient($this->_sourceLocURI, $this->_targetLocURI); - $cmd = &new Horde_SyncML_Command_Sync_ContentSyncElement(); + $cmd = new Horde_SyncML_Command_Sync_ContentSyncElement(); $c = $registry->call($hordeType . '/export', array('guid' => $guid, 'contentType' => $contentType)); #Horde::logMessage("SyncML: slowsync add guid $guid to client ". print_r($c, true), __FILE__, __LINE__, PEAR_LOG_DEBUG); if (!is_a($c, 'PEAR_Error')) { diff --git a/phpgwapi/inc/horde/Horde/SyncML/Sync/TwoWaySync.php b/phpgwapi/inc/horde/Horde/SyncML/Sync/TwoWaySync.php index 78f02ab0cf..2ff089d12f 100644 --- a/phpgwapi/inc/horde/Horde/SyncML/Sync/TwoWaySync.php +++ b/phpgwapi/inc/horde/Horde/SyncML/Sync/TwoWaySync.php @@ -85,7 +85,7 @@ class Horde_SyncML_Sync_TwoWaySync extends Horde_SyncML_Sync { if (!is_a($c, 'PEAR_Error')) { // Item in history but not in database. Strange, but can happen. Horde::logMessage("SyncML: change: $guid export content: $c", __FILE__, __LINE__, PEAR_LOG_DEBUG); - $cmd = &new Horde_SyncML_Command_Sync_ContentSyncElement(); + $cmd = new Horde_SyncML_Command_Sync_ContentSyncElement(); # LK $cmd->setContent($state->convertServer2Client($c, $contentType)); $cmd->setContent($c); $cmd->setSourceURI($guid); @@ -133,7 +133,7 @@ class Horde_SyncML_Sync_TwoWaySync extends Horde_SyncML_Sync { Horde::logMessage("SyncML: delete: $guid", __FILE__, __LINE__, PEAR_LOG_DEBUG); // Create a Delete request for client. - $cmd = &new Horde_SyncML_Command_Sync_ContentSyncElement(); + $cmd = new Horde_SyncML_Command_Sync_ContentSyncElement(); $cmd->setTargetURI($locid); $cmd->setSourceURI($guid); $currentCmdID = $cmd->outputCommand($currentCmdID, $output, 'Delete'); @@ -187,7 +187,7 @@ class Horde_SyncML_Sync_TwoWaySync extends Horde_SyncML_Sync { // Create an Add request for client. $contentType = $state->getPreferedContentTypeClient($this->_sourceLocURI, $this->_targetLocURI); - $cmd = &new Horde_SyncML_Command_Sync_ContentSyncElement(); + $cmd = new Horde_SyncML_Command_Sync_ContentSyncElement(); $c = $registry->call($hordeType . '/export', array( 'guid' => $guid , diff --git a/phpgwapi/inc/horde/Horde/iCalendar.php b/phpgwapi/inc/horde/Horde/iCalendar.php index f91d2d3da4..d11227aaed 100644 --- a/phpgwapi/inc/horde/Horde/iCalendar.php +++ b/phpgwapi/inc/horde/Horde/iCalendar.php @@ -55,7 +55,7 @@ class Horde_iCalendar { } if (class_exists($class)) { #include_once dirname(__FILE__) . '/iCalendar/' . $type . '.php'; - $component = &new $class(); + $component = new $class(); if ($container !== false) { $component->_container = &$container; } @@ -608,7 +608,7 @@ class Horde_iCalendar { // Geo fields. case 'GEO': - $floats = split(';', $value); + $floats = explode(';', $value); $value['latitude'] = floatval($floats[0]); $value['longitude'] = floatval($floats[1]); $this->setAttribute($tag, $value, $params); @@ -881,7 +881,7 @@ class Horde_iCalendar { */ function _parsePeriod($text) { - $periodParts = split('/', $text); + $periodParts = explode('/', $text); $start = $this->_parseDateTime($periodParts[0]); @@ -912,7 +912,7 @@ class Horde_iCalendar { */ function _parseDateTime($text) { - $dateParts = split('T', $text); + $dateParts = explode('T', $text); if (count($dateParts) != 2 && !empty($text)) { // Not a datetime field but may be just a date field. if (!$date = $this->_parseDate($text)) { diff --git a/phpgwapi/inc/horde/Horde/iCalendar/vcard.php b/phpgwapi/inc/horde/Horde/iCalendar/vcard.php index 6a08c90343..465e044169 100644 --- a/phpgwapi/inc/horde/Horde/iCalendar/vcard.php +++ b/phpgwapi/inc/horde/Horde/iCalendar/vcard.php @@ -123,7 +123,7 @@ class Horde_iCalendar_vcard extends Horde_iCalendar { static $rfc822; if (is_null($rfc822)) { - $rfc822 = &new Mail_RFC822(); + $rfc822 = new Mail_RFC822(); } $rfc822->validateMailbox($address); diff --git a/phpgwapi/inc/horde/XML/WBXML/ContentHandler.php b/phpgwapi/inc/horde/XML/WBXML/ContentHandler.php index 86337cd9b1..98cdcba8c7 100644 --- a/phpgwapi/inc/horde/XML/WBXML/ContentHandler.php +++ b/phpgwapi/inc/horde/XML/WBXML/ContentHandler.php @@ -32,7 +32,7 @@ class XML_WBXML_ContentHandler { function XML_WBXML_ContentHandler() { - $this->_currentUri = &new XML_WBXML_LifoQueue(); + $this->_currentUri = new XML_WBXML_LifoQueue(); } function raiseError($error) diff --git a/phpgwapi/inc/horde/XML/WBXML/Decoder.php b/phpgwapi/inc/horde/XML/WBXML/Decoder.php index 85faa20c54..9ef6695659 100644 --- a/phpgwapi/inc/horde/XML/WBXML/Decoder.php +++ b/phpgwapi/inc/horde/XML/WBXML/Decoder.php @@ -75,7 +75,7 @@ class XML_WBXML_Decoder extends XML_WBXML_ContentHandler { */ function XML_WBXML_Decoder() { - $this->_dtdManager = &new XML_WBXML_DTDManager(); + $this->_dtdManager = new XML_WBXML_DTDManager(); } /** @@ -112,7 +112,7 @@ class XML_WBXML_Decoder extends XML_WBXML_ContentHandler { */ function decodeToString($wbxml) { - $this->_ch = &new XML_WBXML_ContentHandler(); + $this->_ch = new XML_WBXML_ContentHandler(); $r = $this->decode($wbxml); if (is_a($r, 'PEAR_Error')) { @@ -174,7 +174,7 @@ class XML_WBXML_Decoder extends XML_WBXML_ContentHandler { // Default content handler. - $this->_dtdManager = &new XML_WBXML_DTDManager(); + $this->_dtdManager = new XML_WBXML_DTDManager(); // Get the starting DTD. $this->_tagDTD = $this->_dtdManager->getInstance($this->_dpi); @@ -382,7 +382,7 @@ class XML_WBXML_Decoder extends XML_WBXML_ContentHandler { // document and thus start a new wbxml decoder instance on it. if ($this->_isData && ord($b) <= 10) { - $decoder = &new XML_WBXML_Decoder(true); + $decoder = new XML_WBXML_Decoder(true); $decoder->setContentHandler($this->_ch); $s = $decoder->decode($b); // /* // @todo: FIXME currently we can't decode Nokia diff --git a/phpgwapi/inc/horde/XML/WBXML/Encoder.php b/phpgwapi/inc/horde/XML/WBXML/Encoder.php index 8efe94e1d0..2633302443 100644 --- a/phpgwapi/inc/horde/XML/WBXML/Encoder.php +++ b/phpgwapi/inc/horde/XML/WBXML/Encoder.php @@ -58,8 +58,8 @@ class XML_WBXML_Encoder extends XML_WBXML_ContentHandler { */ function XML_WBXML_Encoder() { - $this->_dtdManager = &new XML_WBXML_DTDManager(); - $this->_stringTable = &new XML_WBXML_HashTable(); + $this->_dtdManager = new XML_WBXML_DTDManager(); + $this->_stringTable = new XML_WBXML_HashTable(); } /** @@ -390,7 +390,7 @@ class XML_WBXML_Encoder extends XML_WBXML_ContentHandler { $this->_currentURI = $uri; } else { - $this->_subParser = &new XML_WBXML_Encoder(true); + $this->_subParser = new XML_WBXML_Encoder(true); $this->_subParserStack = 1; } } diff --git a/phpgwapi/inc/horde/lib/base.php b/phpgwapi/inc/horde/lib/base.php index b658f5f03c..3137eb1efd 100644 --- a/phpgwapi/inc/horde/lib/base.php +++ b/phpgwapi/inc/horde/lib/base.php @@ -48,7 +48,7 @@ $conf = &$GLOBALS['conf']; /* Set up the menu. */ #require_once 'Horde/Menu.php'; -#$menu = &new Menu(); +#$menu = new Menu(); // Compress output #Horde::compressOutput(); diff --git a/phpgwapi/inc/savant2/Savant2.php b/phpgwapi/inc/savant2/Savant2.php index 54c5c9f08c..9fc16c7627 100755 --- a/phpgwapi/inc/savant2/Savant2.php +++ b/phpgwapi/inc/savant2/Savant2.php @@ -657,7 +657,7 @@ class Savant2 { * * * - * $Savant2 =& new Savant2(); + * $Savant2 = new Savant2(); * * // assign directly * $Savant2->var1 = 'something'; @@ -1114,7 +1114,7 @@ class Savant2 { ! is_a($this->_resource['plugin'][$name], $class)) { // instantiate it - $this->_resource['plugin'][$name] =& new $class($conf); + $this->_resource['plugin'][$name] = new $class($conf); // add a Savant reference if requested if ($savantRef) { @@ -1316,7 +1316,7 @@ class Savant2 { ! is_a($this->_resource['filter'][$name], $class)) { // instantiate it - $this->_resource['filter'][$name] =& new $class($conf); + $this->_resource['filter'][$name] = new $class($conf); // add a Savant reference if requested if ($savantRef) { @@ -1455,7 +1455,7 @@ class Savant2 { } // instantiate and return the error class - $err =& new $class($conf); + $err = new $class($conf); return $err; } diff --git a/phpgwapi/inc/savant2/Savant2/Savant2_Compiler_basic.php b/phpgwapi/inc/savant2/Savant2/Savant2_Compiler_basic.php index 440949e89c..e7b6b985ea 100755 --- a/phpgwapi/inc/savant2/Savant2/Savant2_Compiler_basic.php +++ b/phpgwapi/inc/savant2/Savant2/Savant2_Compiler_basic.php @@ -225,7 +225,7 @@ class Savant2_Compiler_basic extends Savant2_Compiler { function Savant2_Compiler_basic($conf = array()) { parent::Savant2_Compiler($conf); - $this->ca =& new PHPCodeAnalyzer(); + $this->ca = new PHPCodeAnalyzer(); $this->allowedFunctions = $this->allowedFunctions(); $this->allowedStatic = $this->allowedStatic(); } diff --git a/phpgwapi/inc/savant2/Savant2/tests/1_assign.php b/phpgwapi/inc/savant2/Savant2/tests/1_assign.php index 1cc7577532..ce10658b3e 100755 --- a/phpgwapi/inc/savant2/Savant2/tests/1_assign.php +++ b/phpgwapi/inc/savant2/Savant2/tests/1_assign.php @@ -12,7 +12,7 @@ error_reporting(E_ALL); require_once 'Savant2.php'; -$savant =& new Savant2(array('template_path' => 'templates')); +$savant = new Savant2(array('template_path' => 'templates')); echo "

assign 0 (string, null)

"; $val = null; diff --git a/phpgwapi/inc/savant2/Savant2/tests/2_display.php b/phpgwapi/inc/savant2/Savant2/tests/2_display.php index 15337ac820..aa5ec1a33b 100755 --- a/phpgwapi/inc/savant2/Savant2/tests/2_display.php +++ b/phpgwapi/inc/savant2/Savant2/tests/2_display.php @@ -17,7 +17,7 @@ $conf = array( 'resource_path' => 'resources' ); -$savant =& new Savant2($conf); +$savant = new Savant2($conf); $array = array( 'key0' => 'val0', diff --git a/phpgwapi/inc/savant2/Savant2/tests/3_fetch.php b/phpgwapi/inc/savant2/Savant2/tests/3_fetch.php index ff02c6088f..d797dc0b91 100755 --- a/phpgwapi/inc/savant2/Savant2/tests/3_fetch.php +++ b/phpgwapi/inc/savant2/Savant2/tests/3_fetch.php @@ -17,7 +17,7 @@ $conf = array( 'resource_path' => 'resources' ); -$savant =& new Savant2($conf); +$savant = new Savant2($conf); $array = array( 'key0' => 'val0', diff --git a/phpgwapi/inc/savant2/Savant2/tests/4_plugins.php b/phpgwapi/inc/savant2/Savant2/tests/4_plugins.php index 2f10a157c1..9b20e1aff9 100755 --- a/phpgwapi/inc/savant2/Savant2/tests/4_plugins.php +++ b/phpgwapi/inc/savant2/Savant2/tests/4_plugins.php @@ -17,7 +17,7 @@ $conf = array( 'resource_path' => 'resources' ); -$savant =& new Savant2($conf); +$savant = new Savant2($conf); $array = array( 'key0' => 'val0', diff --git a/phpgwapi/inc/savant2/Savant2/tests/5_filters.php b/phpgwapi/inc/savant2/Savant2/tests/5_filters.php index 9193088827..0dc1af2202 100755 --- a/phpgwapi/inc/savant2/Savant2/tests/5_filters.php +++ b/phpgwapi/inc/savant2/Savant2/tests/5_filters.php @@ -18,7 +18,7 @@ $conf = array( 'resource_path' => 'resources' ); -$savant =& new Savant2($conf); +$savant = new Savant2($conf); // set up filters $savant->loadFilter('colorizeCode'); diff --git a/phpgwapi/inc/savant2/Savant2/tests/6_paths.php b/phpgwapi/inc/savant2/Savant2/tests/6_paths.php index 59bec9e74c..22fbfbc5cb 100755 --- a/phpgwapi/inc/savant2/Savant2/tests/6_paths.php +++ b/phpgwapi/inc/savant2/Savant2/tests/6_paths.php @@ -24,7 +24,7 @@ $conf = array( 'resource_path' => 'resources' ); -$savant =& new Savant2($conf); +$savant = new Savant2($conf); echo "

Paths to begin with

\n"; preprint($savant->getPath('resource')); diff --git a/phpgwapi/inc/savant2/Savant2/tests/7_include.php b/phpgwapi/inc/savant2/Savant2/tests/7_include.php index c85b782d00..296aded7e6 100755 --- a/phpgwapi/inc/savant2/Savant2/tests/7_include.php +++ b/phpgwapi/inc/savant2/Savant2/tests/7_include.php @@ -17,7 +17,7 @@ $conf = array( 'resource_path' => 'resources' ); -$savant =& new Savant2($conf); +$savant = new Savant2($conf); $array = array( 'key0' => 'val0', diff --git a/phpgwapi/inc/savant2/Savant2/tests/8_extend.php b/phpgwapi/inc/savant2/Savant2/tests/8_extend.php index d8498d781c..9c783136cc 100755 --- a/phpgwapi/inc/savant2/Savant2/tests/8_extend.php +++ b/phpgwapi/inc/savant2/Savant2/tests/8_extend.php @@ -17,7 +17,7 @@ $conf = array( 'resource_path' => 'resources' ); -$savant =& new Savant2($conf); +$savant = new Savant2($conf); $savant->display('extend.tpl.php'); diff --git a/phpgwapi/inc/savant2/Savant2/tests/9_errors.php b/phpgwapi/inc/savant2/Savant2/tests/9_errors.php index 58ab1dcff8..32397e3fd0 100755 --- a/phpgwapi/inc/savant2/Savant2/tests/9_errors.php +++ b/phpgwapi/inc/savant2/Savant2/tests/9_errors.php @@ -12,7 +12,7 @@ error_reporting(E_ALL); require_once 'Savant2.php'; -$savant =& new Savant2(); +$savant = new Savant2(); require_once 'PEAR.php'; PEAR::setErrorHandling(PEAR_ERROR_PRINT); diff --git a/phpgwapi/inc/savant2/Savant2/tests/compile.php b/phpgwapi/inc/savant2/Savant2/tests/compile.php index a68ed08de5..3949cccad1 100755 --- a/phpgwapi/inc/savant2/Savant2/tests/compile.php +++ b/phpgwapi/inc/savant2/Savant2/tests/compile.php @@ -26,11 +26,11 @@ $conf = array( 'restrict' => true // adding path restrictions! ); -$savant =& new Savant2($conf); +$savant = new Savant2($conf); // instantiate a compiler... require_once 'Savant2/Savant2_Compiler_basic.php'; -$compiler =& new Savant2_Compiler_basic(); +$compiler = new Savant2_Compiler_basic(); $compiler->compileDir = '/tmp/'; $compiler->forceCompile = true; diff --git a/phpgwapi/inc/savant2/Savant2/tests/form.php b/phpgwapi/inc/savant2/Savant2/tests/form.php index 2412870312..d6d67e5bdc 100755 --- a/phpgwapi/inc/savant2/Savant2/tests/form.php +++ b/phpgwapi/inc/savant2/Savant2/tests/form.php @@ -2,7 +2,7 @@ error_reporting(E_ALL); require_once 'Savant2.php'; -$Savant2 =& new Savant2(); +$Savant2 = new Savant2(); $Savant2->addPath('template', 'templates/'); $Savant2->addPath('resource', 'resources/'); diff --git a/phpgwapi/inc/savant2/Savant2/tests/form2.php b/phpgwapi/inc/savant2/Savant2/tests/form2.php index cad4706396..04c3ce2901 100755 --- a/phpgwapi/inc/savant2/Savant2/tests/form2.php +++ b/phpgwapi/inc/savant2/Savant2/tests/form2.php @@ -2,7 +2,7 @@ error_reporting(E_ALL); require_once 'Savant2.php'; -$Savant2 =& new Savant2(); +$Savant2 = new Savant2(); $Savant2->addPath('template', 'templates/'); $Savant2->addPath('resource', 'resources/'); diff --git a/phpgwapi/inc/savant2/Savant2/tests/templates/compile_bad.tpl.php b/phpgwapi/inc/savant2/Savant2/tests/templates/compile_bad.tpl.php index 29310f6e88..5c0529a20a 100755 --- a/phpgwapi/inc/savant2/Savant2/tests/templates/compile_bad.tpl.php +++ b/phpgwapi/inc/savant2/Savant2/tests/templates/compile_bad.tpl.php @@ -4,7 +4,7 @@

{$varivari; $this->$varivari}

{$this->variable1; global $_SERVER;}

-

{$this->variable2; $obj =& new StdClass;}

+

{$this->variable2; $obj = new StdClass;}

{$this->variable3; eval("echo 'bad guy!';")}

{$this->key0; print_r($this->_compiler);}

{$this->key1; File::read('/etc/passwd');}

diff --git a/phpgwapi/inc/xml_functions.inc.php b/phpgwapi/inc/xml_functions.inc.php index b400043074..76a37a75e1 100644 --- a/phpgwapi/inc/xml_functions.inc.php +++ b/phpgwapi/inc/xml_functions.inc.php @@ -219,7 +219,7 @@ { return $GLOBALS['xmlEntities'][strtolower($ent)]; } - if (ereg("^#([0-9]+)$", $ent, $regs)) + if (preg_match('/'."^#([0-9]+)$".'/', $ent, $regs)) { return chr($regs[1]); } @@ -465,7 +465,7 @@ error_log('XML-RPC: missing VALUE inside PARAM in received xml'); break; case 'METHODNAME': - $GLOBALS['_xh'][$parser]['method']=ereg_replace("^[\n\r\t ]+", '', $GLOBALS['_xh'][$parser]['ac']); + $GLOBALS['_xh'][$parser]['method']=preg_replace('/'."^[\n\r\t ]+".'/', '', $GLOBALS['_xh'][$parser]['ac']); break; case 'PARAMS': case 'FAULT': @@ -482,7 +482,7 @@ function xmlrpc_cd($parser, $data) { - //if(ereg("^[\n\r \t]+$", $data)) return; + //if(preg_match('/'."^[\n\r \t]+$".'/', $data)) return; // print "adding [${data}]\n"; // skip processing if xml fault already detected @@ -560,7 +560,7 @@ { // return a time in the localtime, or UTC $t = 0; - if (ereg("([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})",$idate, $regs)) + if (preg_match('/'."([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})".'/',$idate, $regs)) { if ($utc) { @@ -693,7 +693,7 @@ { $methName = $m->getParam(0); $methName = $methName->scalarval(); - if (ereg("^system\.", $methName)) + if (preg_match('/'."^system\.".'/', $methName)) { $dmap = $GLOBALS['_xmlrpcs_dmap']; $sysCall = 1; @@ -740,7 +740,7 @@ { $methName = $m->getParam(0); $methName = $methName->scalarval(); - if (ereg("^system\.", $methName)) + if (preg_match('/'."^system\.".'/', $methName)) { $dmap = $GLOBALS['_xmlrpcs_dmap']; $sysCall=1; diff --git a/phpgwapi/setup/tables_update_1_4.inc.php b/phpgwapi/setup/tables_update_1_4.inc.php index 5423cd1fad..70c3e2e07e 100644 --- a/phpgwapi/setup/tables_update_1_4.inc.php +++ b/phpgwapi/setup/tables_update_1_4.inc.php @@ -243,7 +243,7 @@ function phpgwapi_upgrade1_5_005() $files_dir = $GLOBALS['egw_setup']->db->select('egw_config','config_value',array( 'config_name' => 'files_dir', 'config_app' => 'phpgwapi', - ),__LINE__,__FILE__)->fetchSingle(); + ),__LINE__,__FILE__)->fetchColumn(); if ($files_dir && file_exists($files_dir) && file_exists($files_dir.'/infolog')) { @@ -281,7 +281,7 @@ function phpgwapi_upgrade1_5_006() ); $filescenter_app = $GLOBALS['egw_setup']->db->select('egw_applications','*',array( 'app_name' => 'filescenter', - ),__LINE__,__FILE__)->fetchSingle(); + ),__LINE__,__FILE__)->fetchColumn(); if (!$filescenter_app || !is_dir(EGW_INCLUDE_ROOT.'/filescenter')) { diff --git a/phpgwapi/templates/idots/class.idots_framework.inc.php b/phpgwapi/templates/idots/class.idots_framework.inc.php index 724a344879..45d0c31e25 100644 --- a/phpgwapi/templates/idots/class.idots_framework.inc.php +++ b/phpgwapi/templates/idots/class.idots_framework.inc.php @@ -71,7 +71,7 @@ class idots_framework extends egw_framework $GLOBALS['egw_info']['flags']['include_xajax'] = True; $this->egw_framework($template); // call the constructor of the extended class - $this->tplsav2 =& new tplsavant2(); + $this->tplsav2 = new tplsavant2(); $this->tplsav2->set_tpl_path(EGW_SERVER_ROOT.SEP.'phpgwapi'.SEP.'templates'.SEP.'idots'); } @@ -103,7 +103,7 @@ class idots_framework extends egw_framework // the instanciation of the template has to be here and not in the constructor, // as the old Template class has problems if restored from the session (php-restore) - $this->tpl =& new Template(EGW_TEMPLATE_DIR); + $this->tpl = new Template(EGW_TEMPLATE_DIR); $this->tpl->set_file(array('_head' => 'head.tpl')); $this->tpl->set_block('_head','head'); @@ -282,7 +282,7 @@ class idots_framework extends egw_framework */ function login_screen($extra_vars) { - $tmpl =& new Template($GLOBALS['egw_info']['server']['template_dir']); + $tmpl = new Template($GLOBALS['egw_info']['server']['template_dir']); $tmpl->set_file(array('login_form' => 'login.tpl')); @@ -433,7 +433,7 @@ class idots_framework extends egw_framework */ function denylogin_screen() { - $tmpl =& new Template($GLOBALS['egw_info']['server']['template_dir']); + $tmpl = new Template($GLOBALS['egw_info']['server']['template_dir']); $tmpl->set_file(array( 'login_form' => 'login_denylogin.tpl' diff --git a/preferences/inc/class.ajaxpreferences.inc.php b/preferences/inc/class.ajaxpreferences.inc.php index 33d5ca8869..56c66c1123 100644 --- a/preferences/inc/class.ajaxpreferences.inc.php +++ b/preferences/inc/class.ajaxpreferences.inc.php @@ -25,7 +25,7 @@ */ function storeEGWPref($repository,$key,$value) { - $response =& new xajaxResponse(); + $response = new xajaxResponse(); $GLOBALS['egw']->preferences->read_repository(); $GLOBALS['egw']->preferences->change($repository,$key,$value); $GLOBALS['egw']->preferences->save_repository(True); diff --git a/resources/inc/class.resources_select_widget.inc.php b/resources/inc/class.resources_select_widget.inc.php index fcf6865e8d..47a01424f1 100644 --- a/resources/inc/class.resources_select_widget.inc.php +++ b/resources/inc/class.resources_select_widget.inc.php @@ -70,7 +70,7 @@ class resources_select_widget $cell['label'] = 'no resources'; return false; } - $tpl =& new etemplate('resources.resource_selectbox'); + $tpl = new etemplate('resources.resource_selectbox'); // keep the editor away from the generated tmpls $tpl->no_onclick = true; diff --git a/setup/inc/class.setup_cmd_header.inc.php b/setup/inc/class.setup_cmd_header.inc.php index 91b7349088..0b52abb6f6 100644 --- a/setup/inc/class.setup_cmd_header.inc.php +++ b/setup/inc/class.setup_cmd_header.inc.php @@ -60,7 +60,7 @@ class setup_cmd_header extends setup_cmd $this->header_path = dirname(dirname(dirname(__FILE__))).'/'.$this->header_path; } } - $this->setup_header =& new setup_header(); + $this->setup_header = new setup_header(); } /** @@ -155,7 +155,7 @@ class setup_cmd_header extends setup_cmd * @param array $args=null * @return mixed */ - protected function __call($method,array $args=null) + function __call($method,array $args=null) { if (method_exists($this->setup_header,$method)) { diff --git a/setup/inc/class.setup_cmd_install.inc.php b/setup/inc/class.setup_cmd_install.inc.php index 88c301df54..2860787b90 100644 --- a/setup/inc/class.setup_cmd_install.inc.php +++ b/setup/inc/class.setup_cmd_install.inc.php @@ -75,7 +75,7 @@ class setup_cmd_install extends setup_cmd // use uploaded backup, instead installing from scratch if ($this->backup) { - $db_backup =& new db_backup(); + $db_backup = new db_backup(); if (!is_resource($f = $db_backup->fopen_backup($this->backup,true))) { diff --git a/setup/inc/class.setup_html.inc.php b/setup/inc/class.setup_html.inc.php index 00d50a9c51..4bfa346aa8 100644 --- a/setup/inc/class.setup_html.inc.php +++ b/setup/inc/class.setup_html.inc.php @@ -309,7 +309,7 @@ $dh = dir(EGW_SERVER_ROOT . '/phpgwapi/themes'); while ($file = $dh->read()) { - if (eregi("\.theme$", $file)) + if (preg_match('/'."\.theme$".'/i', $file)) { $list[] = substr($file,0,strpos($file,'.')); } diff --git a/setup/inc/functions.inc.php b/setup/inc/functions.inc.php index f044f91c69..a96608f91a 100644 --- a/setup/inc/functions.inc.php +++ b/setup/inc/functions.inc.php @@ -83,7 +83,7 @@ function get_langs() $f = fopen('./lang/languages','rb'); while($line = fgets($f,200)) { - list($x,$y) = split("\t",$line); + list($x,$y) = explode("\t",$line); $languages[$x]['lang'] = trim($x); $languages[$x]['descr'] = trim($y); $languages[$x]['available'] = False; diff --git a/setup/lang.php b/setup/lang.php index 4081f0d40d..832189b5d7 100644 --- a/setup/lang.php +++ b/setup/lang.php @@ -92,7 +92,7 @@ if($_POST['debug'] && count(translation::$line_rejected)) $str = ''; foreach(translation::$line_rejected as $badline) { - $_f_buffer = split("[/\\]", $badline['appfile']); + $_f_buffer = preg_split("/[\\/\\]/", $badline['appfile']); $str .= lang('Application: %1, File: %2, Line: "%3"',''.$_f_buffer[count($_f_buffer)-3].'', ''.$_f_buffer[count($_f_buffer)-1].'',$badline['line'])."
\n"; } diff --git a/setup/manageheader.php b/setup/manageheader.php index 19da70b432..561d614840 100644 --- a/setup/manageheader.php +++ b/setup/manageheader.php @@ -13,7 +13,7 @@ include('./inc/functions.inc.php'); require_once('./inc/class.setup_header.inc.php'); -$GLOBALS['egw_setup']->header =& new setup_header(); +$GLOBALS['egw_setup']->header = new setup_header(); $setup_tpl = CreateObject('phpgwapi.Template','./templates/default'); $setup_tpl->set_file(array( diff --git a/setup/setup-cli.php b/setup/setup-cli.php index d1171a6a2c..a9128e1337 100755 --- a/setup/setup-cli.php +++ b/setup/setup-cli.php @@ -433,7 +433,7 @@ function do_header($create,&$arguments) */ function get_lang(&$charset) { - @list($lang,$nation,$charset) = split("[_.]",strtolower($_SERVER['LANG'])); + @list($lang,$nation,$charset) = preg_split("/[_.]/",strtolower($_SERVER['LANG'])); foreach(file('lang/languages') as $line) { diff --git a/soap.php b/soap.php index a91e61fca2..6749866fff 100644 --- a/soap.php +++ b/soap.php @@ -44,7 +44,7 @@ settype($headers,'array'); foreach($_SERVER as $h => $v) { - if(ereg('HTTP_(.+)',$h,$hp)) + if(preg_match('/HTTP_(.+)/',$h,$hp)) { $headers[$hp[1]] = $v; } @@ -60,7 +60,7 @@ $tmp = str_replace(' ','',$tmp); $tmp = str_replace('Basic','',$tmp); $auth = base64_decode(trim($tmp)); - list($sessionid,$kp3) = split(':',$auth); + list($sessionid,$kp3) = explode(':',$auth); if($GLOBALS['egw']->session->verify($sessionid,$kp3)) { diff --git a/timesheet/fix_lost_links.php b/timesheet/fix_lost_links.php index f61e8f45e2..97bb17293f 100644 --- a/timesheet/fix_lost_links.php +++ b/timesheet/fix_lost_links.php @@ -18,8 +18,8 @@ include('../header.inc.php'); require_once(EGW_INCLUDE_ROOT.'/timesheet/inc/class.botimesheet.inc.php'); -$bots =& new botimesheet(); -$so_sql =& new so_sql('timesheet',$bots->table_name); +$bots = new botimesheet(); +$so_sql = new so_sql('timesheet',$bots->table_name); // search timesheet which have a project-field identical to an exiting PM project, but no link to it $rows = $so_sql->search(false,'ts_id,ts_project,ts_title','','pm_id,link_id','',false,'AND',false,array('link_id IS NULL'), diff --git a/timesheet/inc/class.timesheet_datasource.inc.php b/timesheet/inc/class.timesheet_datasource.inc.php index 8dd5c77370..211e4c9a6c 100644 --- a/timesheet/inc/class.timesheet_datasource.inc.php +++ b/timesheet/inc/class.timesheet_datasource.inc.php @@ -39,7 +39,7 @@ class timesheet_datasource extends datasource // we use $GLOBALS['timesheet_bo'] as an already running instance is availible there if (!is_object($GLOBALS['timesheet_bo'])) { - $GLOBALS['timesheet_bo'] =& new timesheet_bo(); + $GLOBALS['timesheet_bo'] = new timesheet_bo(); } if (!is_array($data_id)) { diff --git a/timesheet/inc/class.timesheet_ui.inc.php b/timesheet/inc/class.timesheet_ui.inc.php index 1ec97e34f7..1b92cde03f 100644 --- a/timesheet/inc/class.timesheet_ui.inc.php +++ b/timesheet/inc/class.timesheet_ui.inc.php @@ -59,7 +59,7 @@ class timesheet_ui extends timesheet_bo function edit($content = null,$view = false) { $tabs = 'general|notes|links|customfields'; - $etpl =& new etemplate('timesheet.edit'); + $etpl = new etemplate('timesheet.edit'); if (!is_array($content)) { @@ -641,7 +641,7 @@ class timesheet_ui extends timesheet_bo */ function index($content = null,$msg='') { - $etpl =& new etemplate('timesheet.index'); + $etpl = new etemplate('timesheet.index'); if ($_GET['msg']) $msg = $_GET['msg']; diff --git a/xajax.php b/xajax.php index 325eff7b4b..dd1f649926 100644 --- a/xajax.php +++ b/xajax.php @@ -25,7 +25,7 @@ function xajax_redirect(&$anon_account) $GLOBALS['xajax']->setCharEncoding($GLOBALS['egw']->translation->charset()); define('XAJAX_DEFAULT_CHAR_ENCODING',$GLOBALS['egw']->translation->charset()); - $response =& new xajaxResponse(); + $response = new xajaxResponse(); $response->addScript("location.href='".$GLOBALS['egw_info']['server']['webserver_url'].'/login.php?cd=10'."';"); header('Content-type: text/xml; charset='.$GLOBALS['egw']->translation->charset()); @@ -42,7 +42,7 @@ function xajax_redirect(&$anon_account) */ function ajax_exception_handler(Exception $e) { - $response =& new xajaxResponse(); + $response = new xajaxResponse(); $response->addAlert($e->getMessage()."\n\n".$e->getTraceAsString()); header('Content-type: text/xml; charset='.(is_object($GLOBALS['egw'])?$GLOBALS['egw']->translation->charset():'utf-8')); echo $response->getXML(); diff --git a/xmlrpc.php b/xmlrpc.php index 1a99e9271a..15456a3dca 100644 --- a/xmlrpc.php +++ b/xmlrpc.php @@ -49,7 +49,7 @@ settype($headers,'array'); foreach($_SERVER as $h => $v) { - if(ereg('HTTP_(.+)',$h,$hp)) + if(preg_match('/HTTP_(.+)/',$h,$hp)) { $headers[$hp[1]] = $v; } @@ -65,7 +65,7 @@ $server->setSimpleDate($isodate); $auth_header = $headers['Authorization'] ? $headers['Authorization'] : $headers['authorization']; - if(eregi('Basic *([^ ]*)',$auth_header,$auth)) + if(preg_match('/Basic *([^ ]*)/i',$auth_header,$auth)) { list($sessionid,$kp3) = explode(':',base64_decode($auth[1])); //echo "auth='$auth[1]', sessionid='$sessionid', kp3='$kp3'\n";