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 ...
This commit is contained in:
Ralf Becker 2009-06-08 16:21:14 +00:00
parent c28be373a6
commit 232252475f
168 changed files with 441 additions and 439 deletions

View File

@ -92,7 +92,7 @@ function cat_id($cats)
return ''; return '';
} }
$ids = array(); $ids = array();
foreach(split(' *[,;] *',$cats) as $cat) foreach(preg_split('/ *[,;] */',$cats) as $cat)
{ {
if (is_numeric($cat) && $GLOBALS['egw']->categories->id2name($cat) != '--') if (is_numeric($cat) && $GLOBALS['egw']->categories->id2name($cat) != '--')
{ {
@ -330,8 +330,8 @@ switch($_POST['action'])
{ {
if(ereg((string) $pattern,$val)) if(ereg((string) $pattern,$val))
{ {
// echo "<p>csv_idx='$csv_idx',info='$addr',trans_csv=".print_r($trans_csv).",ereg_replace('$pattern','$replace','$val') = "; // echo "<p>csv_idx='$csv_idx',info='$addr',trans_csv=".print_r($trans_csv).",preg_replace('/$pattern/','$replace','$val') = ";
$val = ereg_replace((string) $pattern,str_replace($VPre,'\\',$replace),(string) $val); $val = preg_replace('/'.(string) $pattern.'/',str_replace($VPre,'\\',$replace),(string) $val);
// echo "'$val'</p>"; // echo "'$val'</p>";
$reg = $CPreReg.'([a-zA-Z_0-9]+)'.$CPosReg; $reg = $CPreReg.'([a-zA-Z_0-9]+)'.$CPosReg;
@ -377,7 +377,7 @@ switch($_POST['action'])
if (isset($values[$date]) && !is_numeric($date)) if (isset($values[$date]) && !is_numeric($date))
{ {
// convert german DD.MM.YYYY format into ISO YYYY-MM-DD format // 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 // remove fractures of seconds if present at the end of the string
if (ereg('(.*)\.[0-9]+',$values[$date],$parts)) $values[$date] = $parts[1]; if (ereg('(.*)\.[0-9]+',$values[$date],$parts)) $values[$date] = $parts[1];
$values[$date] = strtotime($values[$date]); $values[$date] = strtotime($values[$date]);

View File

@ -57,7 +57,7 @@ class addressbook_groupdav extends groupdav_handler
{ {
parent::__construct($app,$debug,$base_uri); parent::__construct($app,$debug,$base_uri);
$this->bo =& new addressbook_bo(); $this->bo = new addressbook_bo();
//$this->starttime = microtime(true); //$this->starttime = microtime(true);
} }
@ -310,7 +310,7 @@ class addressbook_groupdav extends groupdav_handler
*/ */
private function _get_handler() private function _get_handler()
{ {
$handler =& new addressbook_vcal(); $handler = new addressbook_vcal();
$handler->setSupportedFields('GroupDAV',$this->agent); $handler->setSupportedFields('GroupDAV',$this->agent);
return $handler; return $handler;

View File

@ -936,7 +936,7 @@ class addressbook_ldap
return $this->_error(__LINE__); // baseDN does NOT exist and we cant/wont create it return $this->_error(__LINE__); // baseDN does NOT exist and we cant/wont create it
} }
// create a admin connection to add the needed DN // create a admin connection to add the needed DN
$adminLDAP =& new ldap; $adminLDAP = new ldap;
$adminDS = $adminLDAP->ldapConnect(); $adminDS = $adminLDAP->ldapConnect();
list(,$ou) = explode(',',$baseDN); list(,$ou) = explode(',',$baseDN);

View File

@ -35,7 +35,7 @@ class addressbook_merge // extends bo_merge
*/ */
function __construct() 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) function calendar_replacements($id,$last_event_too=false)
{ {
require_once(EGW_INCLUDE_ROOT.'/calendar/inc/class.calendar_boupdate.inc.php'); require_once(EGW_INCLUDE_ROOT.'/calendar/inc/class.calendar_boupdate.inc.php');
$calendar =& new calendar_boupdate(); $calendar = new calendar_boupdate();
// next events // next events
$events = $calendar->search(array( $events = $calendar->search(array(

View File

@ -217,7 +217,7 @@ class addressbook_so
if($GLOBALS['egw_info']['server']['contact_repository'] == 'ldap' && $this->account_repository == 'ldap') if($GLOBALS['egw_info']['server']['contact_repository'] == 'ldap' && $this->account_repository == 'ldap')
{ {
$this->contact_repository = 'ldap'; $this->contact_repository = 'ldap';
$this->somain =& new addressbook_ldap(); $this->somain = new addressbook_ldap();
if ($this->user) // not set eg. in setup if ($this->user) // not set eg. in setup
{ {
@ -236,7 +236,7 @@ class addressbook_so
{ {
$this->contact_repository = 'sql-ldap'; $this->contact_repository = 'sql-ldap';
} }
$this->somain =& new addressbook_sql(); $this->somain = new addressbook_sql();
if ($this->user) // not set eg. in setup if ($this->user) // not set eg. in setup
{ {

View File

@ -516,7 +516,7 @@ class addressbook_sql extends so_sql
if ($this->db->select($this->lists_table,'list_id',array( if ($this->db->select($this->lists_table,'list_id',array(
'list_name' => $name, 'list_name' => $name,
'list_owner' => $owner, 'list_owner' => $owner,
),__LINE__,__FILE__)->fetchSingle()) ),__LINE__,__FILE__)->fetchColumn())
{ {
return true; // return existing list-id 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( if ($this->db->select($this->ab2list_table,'list_id',array(
'contact_id' => $contact, 'contact_id' => $contact,
'list_id' => $list, 'list_id' => $list,
),__LINE__,__FILE__)->fetchSingle()) ),__LINE__,__FILE__)->fetchColumn())
{ {
return true; // no need to insert it, would give sql error return true; // no need to insert it, would give sql error
} }

View File

@ -92,7 +92,7 @@ class addressbook_tracking extends bo_tracking
case 'copy': case 'copy':
if ($data['is_contactform']) if ($data['is_contactform'])
{ {
return split(', ?',$data['email_contactform']); return preg_split('/, ?/',$data['email_contactform']);
} }
break; break;

View File

@ -421,7 +421,7 @@ class addressbook_ui extends addressbook_bo
$query['filter2'] = (int)$list; $query['filter2'] = (int)$list;
$this->action($email_type,array(),true,$success,$failed,$action_msg,$query,$msg); $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']); if ($success) $response->addScript($GLOBALS['egw']->js->body['onLoad']);
@ -1497,7 +1497,7 @@ class addressbook_ui extends addressbook_bo
'n_suffix' => $n_suffix, 'n_suffix' => $n_suffix,
'org_name' => $org_name, 'org_name' => $org_name,
); );
$response =& new xajaxResponse(); $response = new xajaxResponse();
$response->addScript("setOptions('".addslashes(implode("\b",$this->fileas_options($names)))."');"); $response->addScript("setOptions('".addslashes(implode("\b",$this->fileas_options($names)))."');");
return $response->getXML(); 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); 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'); 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); return $document_merge->download($document,$ids);
} }

View File

@ -64,7 +64,7 @@ class addressbook_vcal extends addressbook_bo
{ {
require_once(EGW_SERVER_ROOT.'/phpgwapi/inc/horde/Horde/iCalendar/vcard.php'); 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)) { if(!is_array($this->supportedFields)) {
$this->setSupportedFields(); $this->setSupportedFields();

View File

@ -15,7 +15,7 @@ if ($GLOBALS['egw_info']['user']['apps']['addressbook'] &&
if (!(int) $days) $days = 1; // old pref if (!(int) $days) $days = 1; // old pref
$contacts =& new addressbook_bo(); $contacts = new addressbook_bo();
$month_start = date('*-m-*',$contacts->now_su); $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'); $bdays =& $contacts->search(array('bday' => $month_start),array('id','n_family','n_given','bday'),'n_given,n_family');

View File

@ -487,7 +487,7 @@ abstract class admin_cmd
* @param mixed $value * @param mixed $value
* @return mixed * @return mixed
*/ */
protected function __set($property,$value) function __set($property,$value)
{ {
$this->data[$property] = $value; $this->data[$property] = $value;
} }
@ -497,7 +497,7 @@ abstract class admin_cmd
* *
* @param string $property * @param string $property
*/ */
protected function __unset($property) function __unset($property)
{ {
unset($this->data[$property]); unset($this->data[$property]);
} }
@ -795,7 +795,7 @@ abstract class admin_cmd
return admin_cmd::run_queued_jobs(); return admin_cmd::run_queued_jobs();
} }
include_once(EGW_API_INC.'/class.asyncservice.inc.php'); 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! // 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']); list($app) = explode('_',$class=$next['type']);

View File

@ -50,7 +50,7 @@ class admin_cmd_change_pw extends admin_cmd
if ($check_only) return true; if ($check_only) return true;
$auth =& new auth; $auth = new auth;
if (!$auth->change_password(null, $this->password, $account_id)) if (!$auth->change_password(null, $this->password, $account_id))
{ {

View File

@ -33,7 +33,7 @@
{ {
if (ereg('@',$value['session_lid'])) if (ereg('@',$value['session_lid']))
{ {
$t = split('@',$value['session_lid']); $t = explode('@',$value['session_lid']);
$session_lid = $t[0]; $session_lid = $t[0];
} }
else else

View File

@ -230,7 +230,7 @@ class customfields
{ {
foreach(explode("\n",$field['values']) as $line) foreach(explode("\n",$field['values']) as $line)
{ {
list($var,$value) = split('=',trim($line),2); list($var,$value) = explode('=',trim($line),2);
$var = trim($var); $var = trim($var);
$values[$var] = empty($value) ? $var : $value; $values[$var] = empty($value) ? $var : $value;
} }

View File

@ -1583,7 +1583,7 @@
function ajax_check_account_email($first,$last,$account_lid,$account_id,$email,$id) function ajax_check_account_email($first,$last,$account_lid,$account_id,$email,$id)
{ {
$response =& new xajaxResponse(); $response = new xajaxResponse();
if (!$email) if (!$email)
{ {
$response->addAssign('email','value',$GLOBALS['egw']->common->email_address($first,$last,$account_lid)); $response->addAssign('email','value',$GLOBALS['egw']->common->email_address($first,$last,$account_lid));

View File

@ -108,7 +108,7 @@
} }
} }
/* don't erase passwords, since we also don't print them */ /* 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]); unset($c->config_data[$key]);
} }
@ -181,7 +181,7 @@
case 'value': case 'value':
$newval = str_replace(' ','_',$newval); $newval = str_replace(' ','_',$newval);
/* Don't show passwords in the form */ /* 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,''); $t->set_var($value,'');
} }

View File

@ -104,7 +104,7 @@ function cat_id($cats)
return ''; return '';
} }
foreach(split('[,;]',$cats) as $cat) foreach(preg_split('/[,;]/',$cats) as $cat)
{ {
if (isset($cat2id[$cat])) if (isset($cat2id[$cat]))
{ {
@ -374,8 +374,8 @@ case 'import':
{ {
if (ereg((string) $pattern,$val)) if (ereg((string) $pattern,$val))
{ {
//echo "<p>csv_idx='$csv_idx',info='$info',trans_csv=".print_r($trans_csv).",ereg_replace('$pattern','$replace','$val') = "; //echo "<p>csv_idx='$csv_idx',info='$info',trans_csv=".print_r($trans_csv).",preg_replace('/$pattern/','$replace','$val') = ";
$val = ereg_replace((string) $pattern,str_replace($VPre,'\\',$replace),(string) $val); $val = preg_replace('/'.(string) $pattern.'/',str_replace($VPre,'\\',$replace),(string) $val);
//echo "'$val'"; //echo "'$val'";
$reg = $CPreReg.'([a-zA-Z_0-9 ]+)'.$CPosReg; $reg = $CPreReg.'([a-zA-Z_0-9 ]+)'.$CPosReg;
@ -440,14 +440,14 @@ case 'import':
if (isset($values[$date]) && !is_numeric($date)) if (isset($values[$date]) && !is_numeric($date))
{ {
// convert german DD.MM.YYYY format into ISO YYYY-MM-DD format // 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 // remove fractures of seconds if present at the end of the string
if (ereg('(.*)\.[0-9]+',$values[$date],$parts)) $values[$date] = $parts[1]; if (ereg('(.*)\.[0-9]+',$values[$date],$parts)) $values[$date] = $parts[1];
$values[$date] = strtotime($values[$date]); $values[$date] = strtotime($values[$date]);
} }
} }
// convert participants-names to user-id's // 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(); $values['participants'] = array();
foreach($parts as $part_status) foreach($parts as $part_status)
{ {

View File

@ -35,7 +35,7 @@ class bocalendar
function __construct() function __construct()
{ {
$this->cal =& new calendar_boupdate(); $this->cal = new calendar_boupdate();
if (is_object($GLOBALS['server']) && $GLOBALS['server']->simpledate) if (is_object($GLOBALS['server']) && $GLOBALS['server']->simpledate)
{ {

View File

@ -301,7 +301,7 @@
// reading the holidayfile from egroupware.org via network::gethttpsocketfile contains all the headers! // reading the holidayfile from egroupware.org via network::gethttpsocketfile contains all the headers!
foreach($lines as $n => $line) foreach($lines as $n => $line)
{ {
$fields = split("[\t\n ]+",$line); $fields = preg_split("/[\t\n ]+/",$line);
if ($fields[0] == 'charset' && $fields[1]) if ($fields[0] == 'charset' && $fields[1])
{ {

View File

@ -52,7 +52,7 @@ class calendar_ajax {
$conflicts=$this->calendar->update($event); $conflicts=$this->calendar->update($event);
$response =& new xajaxResponse(); $response = new xajaxResponse();
if(!is_array($conflicts)) if(!is_array($conflicts))
{ {
$response->addRedirect(''); $response->addRedirect('');

View File

@ -47,7 +47,7 @@ class calendar_groupdav extends groupdav_handler
{ {
parent::__construct($app,$debug,$base_uri); parent::__construct($app,$debug,$base_uri);
$this->bo =& new calendar_boupdate(); $this->bo = new calendar_boupdate();
} }
const PATH_ATTRIBUTE = 'id'; const PATH_ATTRIBUTE = 'id';
@ -425,7 +425,7 @@ class calendar_groupdav extends groupdav_handler
*/ */
private function _get_handler() private function _get_handler()
{ {
$handler =& new calendar_ical(); $handler = new calendar_ical();
$handler->setSupportedFields('GroupDAV',$this->agent); $handler->setSupportedFields('GroupDAV',$this->agent);
if ($this->debug > 1) error_log("ical Handler called:" . $this->agent); if ($this->debug > 1) error_log("ical Handler called:" . $this->agent);
return $handler; return $handler;

View File

@ -145,7 +145,7 @@ class calendar_ical extends calendar_boupdate
$palm_enddate_workaround=True; $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'].'//'. $vcal->setAttribute('PRODID','-//eGroupWare//NONSGML eGroupWare Calendar '.$GLOBALS['egw_info']['apps']['calendar']['version'].'//'.
strtoupper($GLOBALS['egw_info']['user']['preferences']['common']['lang'])); strtoupper($GLOBALS['egw_info']['user']['preferences']['common']['lang']));
$vcal->setAttribute('VERSION',$version); $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 // our (patched) horde classes, do NOT unfold folded lines, which causes a lot trouble in the import
$_vcalData = preg_replace("/[\r\n]+ /",'',$_vcalData); $_vcalData = preg_replace("/[\r\n]+ /",'',$_vcalData);
$vcal = &new Horde_iCalendar; $vcal = new Horde_iCalendar;
if(!$vcal->parsevCalendar($_vcalData)) if(!$vcal->parsevCalendar($_vcalData))
{ {
return FALSE; 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 // our (patched) horde classes, do NOT unfold folded lines, which causes a lot trouble in the import
$_vcalData = preg_replace("/[\r\n]+ /",'',$_vcalData); $_vcalData = preg_replace("/[\r\n]+ /",'',$_vcalData);
$vcal = &new Horde_iCalendar; $vcal = new Horde_iCalendar;
if(!$vcal->parsevCalendar($_vcalData)) if(!$vcal->parsevCalendar($_vcalData))
{ {
return FALSE; 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 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'].'//'. $vcal->setAttribute('PRODID','-//eGroupWare//NONSGML eGroupWare Calendar '.$GLOBALS['egw_info']['apps']['calendar']['version'].'//'.
strtoupper($GLOBALS['egw_info']['user']['preferences']['common']['lang'])); strtoupper($GLOBALS['egw_info']['user']['preferences']['common']['lang']));
$vcal->setAttribute('VERSION','2.0'); $vcal->setAttribute('VERSION','2.0');

View File

@ -84,7 +84,7 @@ class calendar_sif extends calendar_boupdate
} }
function siftoegw($_sifdata) { function siftoegw($_sifdata) {
$vcal = &new Horde_iCalendar; $vcal = new Horde_iCalendar;
$finalEvent = array(); $finalEvent = array();
$sysCharSet = $GLOBALS['egw']->translation->charset(); $sysCharSet = $GLOBALS['egw']->translation->charset();
$sifData = base64_decode($_sifdata); $sifData = base64_decode($_sifdata);
@ -324,7 +324,7 @@ class calendar_sif extends calendar_boupdate
if($event = $this->read($_id,null,false,'server')) { if($event = $this->read($_id,null,false,'server')) {
$sysCharSet = $GLOBALS['egw']->translation->charset(); $sysCharSet = $GLOBALS['egw']->translation->charset();
$vcal = &new Horde_iCalendar; $vcal = new Horde_iCalendar;
$sifEvent = '<appointment>'; $sifEvent = '<appointment>';

View File

@ -583,7 +583,7 @@ ORDER BY cal_user_type, cal_usre_id
if ($set_recurrences) if ($set_recurrences)
{ {
// delete all, but the lowest dates record // 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( $this->db->delete($this->dates_table,array(
'cal_id' => $cal_id, 'cal_id' => $cal_id,
@ -657,7 +657,7 @@ ORDER BY cal_user_type, cal_usre_id
} }
if (is_null($etag)) 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; return $cal_id;
} }

View File

@ -265,7 +265,7 @@
"group" => "Group public" "group" => "Group public"
); );
if (ereg(",", $selected)) if (strpos($selected,",") !== false)
{ {
$selected = "group"; $selected = "group";
} }

View File

@ -192,7 +192,7 @@ class soholiday
echo 'HOLIDAY_TOTAL : '.$where.'<br>'."\n"; echo 'HOLIDAY_TOTAL : '.$where.'<br>'."\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) if($this->debug)
{ {

View File

@ -71,7 +71,7 @@ while(($arg = array_shift($argv)))
} }
else else
{ {
$config[$name] = array_unique(split('[ ,]+',$value)); $config[$name] = array_unique(preg_split('/[ ,]+/',$value));
} }
break; break;

View File

@ -46,7 +46,7 @@ $config = array(
// read language from LANG enviroment variable // read language from LANG enviroment variable
if (($lang = isset($_ENV['LANG']) ? $_ENV['LANG'] : $_SERVER['LANG'])) 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'))) if (in_array($lang.'-'.strtolower($nat),array('es-es','pt-br','zh-tw')))
{ {
$lang .= '-'.strtolower($nat); $lang .= '-'.strtolower($nat);

View File

@ -76,7 +76,7 @@
(is_array($GLOBALS['egw']->session->appsession('advanced_search_query',$GLOBALS['egw_info']['flags']['currentapp'])) ? (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); $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 $tpl->init('*** generated advanced search widget','','',0,'',0,0); // make an empty template
if($extension_data['message']) if($extension_data['message'])
@ -96,7 +96,7 @@
// 'width' => '800px', // '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); $result_rows_tpl->init('*** generated rows template for advanced search results','','',0,'',0,0);
$grid =& $result_rows_tpl->children[0]; $grid =& $result_rows_tpl->children[0];
foreach((array)$extension_data['colums_to_present'] as $field => $label) foreach((array)$extension_data['colums_to_present'] as $field => $label)

View File

@ -146,7 +146,7 @@ class ajax_select_widget
$cell['type'] = 'template'; $cell['type'] = 'template';
$cell['size'] = $cell['name']; $cell['size'] = $cell['name'];
$value = array('value' => $current_value, 'search' => $title); $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; $widget->no_onclick = True;
// Link if readonly & link is set // Link if readonly & link is set

View File

@ -113,9 +113,9 @@ class date_widget
} }
elseif ($data_format != '') elseif ($data_format != '')
{ {
$date = split('[- /.:,]',$value); $date = preg_split('/[- \\/.:,]/',$value);
//echo "date=<pre>"; print_r($date); echo "</pre>"; //echo "date=<pre>"; print_r($date); echo "</pre>";
$mdy = split('[- /.:,]',$data_format); $mdy = preg_split('/[- \\/.:,]/',$data_format);
if (count($mdy) == 1) // no seperators, eg. YmdHi 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 $value['H'] = $value['H'] % 12 ? $value['H'] % 12 : 12; // no leading 0 and 0h => 12am
$timeformat += array(5 => 'a'); $timeformat += array(5 => 'a');
} }
$format = split('[/.-]',$this->dateformat); $format = preg_split('/[\\/.-]/',$this->dateformat);
// no time also if $options&8 and readonly and time=0h0 // no time also if $options&8 and readonly and time=0h0
if ($type != 'date' && !($readonly && ($options & 8) && $time_0h0)) if ($type != 'date' && !($readonly && ($options & 8) && $time_0h0))
@ -235,7 +235,7 @@ class date_widget
'needed' => $cell['needed'], 'needed' => $cell['needed'],
)); ));
} }
$tpl =& new etemplate; $tpl = new etemplate;
$tpl->init('*** generated fields for date','','',0,'',0,0); // make an empty template $tpl->init('*** generated fields for date','','',0,'',0,0); // make an empty template
// keep the editor away from the generated tmpls // keep the editor away from the generated tmpls
$tpl->no_onclick = true; $tpl->no_onclick = true;
@ -410,7 +410,7 @@ class date_widget
'value' => $value, 'value' => $value,
'unit' => $unit, 'unit' => $unit,
); );
$tpl =& new etemplate; $tpl = new etemplate;
$tpl->init('*** generated fields for duration','','',0,'',0,0); // make an empty template $tpl->init('*** generated fields for duration','','',0,'',0,0); // make an empty template
// keep the editor away from the generated tmpls // keep the editor away from the generated tmpls
$tpl->no_onclick = true; $tpl->no_onclick = true;

View File

@ -330,7 +330,7 @@ class db_tools
$new_version[$minor] = sprintf('%03d',1+$new_version[$minor]); $new_version[$minor] = sprintf('%03d',1+$new_version[$minor]);
$content['new_version'] = implode('.',$new_version); $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")) if (!file_exists(EGW_SERVER_ROOT."/$posted_app/setup/tables_current.inc.php"))
{ {
@ -516,7 +516,7 @@ class db_tools
$opts = array(); $opts = array();
foreach(explode(',',$col['options']) as $opt) 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; $opts[$db] = is_numeric($opt) ? intval($opt) : $opt;
} }
$table[$prop][] = array( $table[$prop][] = array(

View File

@ -276,7 +276,7 @@ class editor
{ {
$content[$row] = $param; $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'); $GLOBALS['egw_info']['flags']['app_header'] = lang('Editable Templates - Search');
$list_result->exec('etemplate.editor.list_result',$content,'','',array( $list_result->exec('etemplate.editor.list_result',$content,'','',array(
'result' => $result, 'result' => $result,
@ -465,7 +465,7 @@ class editor
'xml' => $xml ? '<pre>'.html::htmlspecialchars($xml)."</pre>\n" : '', 'xml' => $xml ? '<pre>'.html::htmlspecialchars($xml)."</pre>\n" : '',
); );
$editor =& new etemplate('etemplate.editor.new'); $editor = new etemplate('etemplate.editor.new');
if (!$msg && isset($content['values']) && !isset($content['vals'])) if (!$msg && isset($content['values']) && !isset($content['vals']))
{ {
$r = 1; $r = 1;
@ -1337,8 +1337,8 @@ class editor
$content['cell']['options'] = explode(',',$content['cell']['size']); $content['cell']['options'] = explode(',',$content['cell']['size']);
$editor =& new etemplate('etemplate.editor.widget'); $editor = new etemplate('etemplate.editor.widget');
$type_tmpl =& new etemplate; $type_tmpl = new etemplate;
list($ext_type) = explode('-',$widget['type']); list($ext_type) = explode('-',$widget['type']);
// allow to read template of app-specific widgets from their app: eg. "infolog-value" --> "infolog.widget.infolog-value" // 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 ? '<script>'.$js.'</script>' : '', 'java_script' => $js ? '<script>'.$js.'</script>' : '',
'msg' => $msg 'msg' => $msg
); );
$tmpl =& new etemplate('etemplate.editor.styles'); $tmpl = new etemplate('etemplate.editor.styles');
if ($content['from']) if ($content['from'])
{ {
@ -1542,7 +1542,7 @@ class editor
$dir = @opendir(EGW_SERVER_ROOT.'/'.$app.'/inc'); $dir = @opendir(EGW_SERVER_ROOT.'/'.$app.'/inc');
while ($dir && ($file = readdir($dir))) 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) && ($regs[1] != 'xslt' || $this->etemplate->xslt) &&
($ext = $this->etemplate->loadExtension($regs[1].'.'.$app,$this->etemplate))) ($ext = $this->etemplate->loadExtension($regs[1].'.'.$app,$this->etemplate)))
{ {

View File

@ -309,7 +309,7 @@ class etemplate extends boetemplate
echo '<div id="popupMainDiv">'."\n"; echo '<div id="popupMainDiv">'."\n";
if ($GLOBALS['egw_info']['user']['apps']['manual']) // adding a manual icon to every popup 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()); echo $manual->show(array());
unset($manual); unset($manual);
echo '<style type="text/css">.ajax-loader { position: absolute; right: 27px; top: 24px; display: none; }</style>'."\n"; echo '<style type="text/css">.ajax-loader { position: absolute; right: 27px; top: 24px; display: none; }</style>'."\n";
@ -1331,7 +1331,7 @@ class etemplate extends boetemplate
$obj_read = 'already loaded'; $obj_read = 'already loaded';
if (is_array($cell['obj'])) if (is_array($cell['obj']))
{ {
$obj =& new etemplate(); $obj = new etemplate();
$obj->init($cell['obj']); $obj->init($cell['obj']);
$cell['obj'] =& $obj; $cell['obj'] =& $obj;
unset($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'; $obj_read = is_object($cell['obj']) ? 'obj from content' : 'obj read, obj-name from content';
if (!is_object($cell['obj'])) if (!is_object($cell['obj']))
{ {
$cell['obj'] =& new etemplate($cell['obj'],$this->as_array()); $cell['obj'] = new etemplate($cell['obj'],$this->as_array());
} }
} }
else else
{ $obj_read = 'obj read'; { $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']) if (is_int($this->debug) && $this->debug >= 3 || $this->debug == $cell['type'])

View File

@ -61,14 +61,14 @@ class historylog_widget
$status_widgets = is_array($value) && isset($value['status-widgets']) ? $value['status-widgets'] : null; $status_widgets = is_array($value) && isset($value['status-widgets']) ? $value['status-widgets'] : null;
$id = is_array($value) ? $value['id'] : $value; $id = is_array($value) ? $value['id'] : $value;
$historylog =& new historylog($app); $historylog = new historylog($app);
if (!$id || method_exists($historylog,'search')) if (!$id || method_exists($historylog,'search'))
{ {
$value = $id ? $historylog->search($id) : false; $value = $id ? $historylog->search($id) : false;
} }
unset($historylog); unset($historylog);
$tpl =& new etemplate; $tpl = new etemplate;
$tpl->init('*** generated fields for historylog','','',0,'',0,0); // make an empty template $tpl->init('*** generated fields for historylog','','',0,'',0,0); // make an empty template
// keep the editor away from the generated tmpls // keep the editor away from the generated tmpls
$tpl->no_onclick = true; $tpl->no_onclick = true;

View File

@ -254,7 +254,7 @@ class link_widget
// modify add_app default to the action used as value // modify add_app default to the action used as value
if (isset($value['add_app']) && $app == $value['add_app']) $value['add_app'] = $action; 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; break;
case 'link-to': case 'link-to':
@ -288,7 +288,7 @@ class link_widget
return True; return True;
} }
$value['link_list_format'] = $GLOBALS['egw_info']['user']['preferences']['common']['link_list_format']; $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) for($row=$tpl->rows-1; list(,$link) = each($links); ++$row)
{ {
$value[$row] = $link; $value[$row] = $link;
@ -324,7 +324,7 @@ class link_widget
case 'link-entry': case 'link-entry':
$GLOBALS['egw_info']['flags']['include_xajax'] = true; $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(); $options = $cell['size'] ? explode(',',$cell['size']) : array();
$app = $extension_data['app'] = $options[0]; $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]= // handle extra args for onclick like: values2url(this.form,'start,end,duration,participants,recur_type,whole_day')+'&exec[event_id]=

View File

@ -363,7 +363,7 @@ class nextmatch_widget
} }
if (!is_object($value['template'])) 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 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 { // disable whole nextmatch line if no scrolling necessary
if ($value['header_left'] || $value['header_right']) 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['size'] = $cell['name'];
$cell['obj'] = &$nextmatch; $cell['obj'] = &$nextmatch;
$cell['name'] = $nextmatch->name; $cell['name'] = $nextmatch->name;
@ -400,7 +400,7 @@ class nextmatch_widget
} }
else else
{ {
$nextmatch =& new etemplate('etemplate.nextmatch_widget'); $nextmatch = new etemplate('etemplate.nextmatch_widget');
$nextmatch->read('etemplate.nextmatch_widget'); $nextmatch->read('etemplate.nextmatch_widget');
// keep the editor away from the generated tmpls // keep the editor away from the generated tmpls
$nextmatch->no_onclick = true; $nextmatch->no_onclick = true;
@ -1129,7 +1129,7 @@ class nextmatch_widget
if ($app) if ($app)
{ {
include_once(EGW_API_INC.'/class.config.inc.php'); include_once(EGW_API_INC.'/class.config.inc.php');
$config =& new config($app); $config = new config($app);
$config->read_repository(); $config->read_repository();
$customfields = isset($config->config_data['customfields']) ? $config->config_data['customfields'] : $config->config_data['custom_fields']; $customfields = isset($config->config_data['customfields']) ? $config->config_data['customfields'] : $config->config_data['custom_fields'];

View File

@ -841,7 +841,7 @@ class so_sql
} }
elseif (!$need_full_no_count && (!$join || stripos($join,'LEFT JOIN')!==false)) 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 else // cant do a count, have to run the query without limit
{ {
@ -857,7 +857,7 @@ class so_sql
if ($mysql_calc_rows) if ($mysql_calc_rows)
{ {
$this->total = $this->db->query('SELECT FOUND_ROWS()')->fetchSingle(); $this->total = $this->db->query('SELECT FOUND_ROWS()')->fetchColumn();
} }
$arr = array(); $arr = array();
if ($rs) foreach($rs as $row) if ($rs) foreach($rs as $row)

View File

@ -953,7 +953,7 @@ class soetemplate
$tpls = $this->search($app); $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)) while (list(,$keys) = each($tpls))
{ {
@ -1062,7 +1062,7 @@ class soetemplate
$templ_version=0; $templ_version=0;
include($path = EGW_SERVER_ROOT."/$app/setup/etemplates.inc.php"); include($path = EGW_SERVER_ROOT."/$app/setup/etemplates.inc.php");
$templ =& new etemplate($app); $templ = new etemplate($app);
foreach($templ_data as $data) foreach($templ_data as $data)
{ {
@ -1106,7 +1106,7 @@ class soetemplate
if ($time = @filemtime($path)) if ($time = @filemtime($path))
{ {
$templ =& new soetemplate(".$app",'','##'); $templ = new soetemplate(".$app",'','##');
if ($templ->lang != '##' || $templ->modified < $time) // need to import if ($templ->lang != '##' || $templ->modified < $time) // need to import
{ {
$ret = self::import_dump($app); $ret = self::import_dump($app);
@ -1288,7 +1288,7 @@ class soetemplate
case 'template': case 'template':
if (!isset($widget['obj']) && $widget['name'][0] != '@') 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 (!$widget['obj']->read($widget['name'])) $widget['obj'] = false;
} }
if (!is_object($widget['obj'])) break; // cant descent into template if (!is_object($widget['obj'])) break; // cant descent into template

View File

@ -74,7 +74,7 @@ class solangfile
} }
foreach($lines as $n => $line) foreach($lines as $n => $line)
{ {
while (ereg('\{lang_([^}]+)\}(.*)',$line,$found)) while (preg_match('/\{lang_([^}]+)\}(.*)/',$line,$found))
{ {
$lang = str_replace('_',' ',$found[1]); $lang = str_replace('_',' ',$found[1]);
$this->plist[$lang] = $app; $this->plist[$lang] = $app;
@ -256,7 +256,7 @@ class solangfile
} }
$rest = substr($rest,$next+1); $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 break; // nothing found
} }

View File

@ -86,7 +86,7 @@
} }
$all_names = implode('|',$names); $all_names = implode('|',$names);
$tab_widget =& new etemplate('etemplate.tab_widget'); $tab_widget = new etemplate('etemplate.tab_widget');
$tab_widget->no_onclick = true; $tab_widget->no_onclick = true;
if ($value && strpos($value,'.') === false) if ($value && strpos($value,'.') === false)
@ -150,7 +150,7 @@
foreach($names as $n => $name) foreach($names as $n => $name)
{ {
$bcell = $tab_widget->empty_cell('template',$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',$n+1,$bcell);
} }
$tab_widget->set_cell_attribute('body','type','deck'); $tab_widget->set_cell_attribute('body','type','deck');
@ -160,7 +160,7 @@
} }
else 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','type','template');
$tab_widget->set_cell_attribute('body','size',''); // the deck has a '1' there $tab_widget->set_cell_attribute('body','size',''); // the deck has a '1' there
$tab_widget->set_cell_attribute('body','obj',$stab); $tab_widget->set_cell_attribute('body','obj',$stab);

View File

@ -81,7 +81,7 @@ class tree_widget
} }
else // we need to instanciate a new cat object for the correct application else // we need to instanciate a new cat object for the correct application
{ {
$categories =& new categories('',$type3); $categories = new categories('',$type3);
} }
$cat2path=array(); $cat2path=array();
foreach((array)$categories->return_sorted_array(0,False,'','','',!$type) as $cat) foreach((array)$categories->return_sorted_array(0,False,'','','',!$type) as $cat)

View File

@ -108,7 +108,7 @@
*/ */
if (!$GLOBALS['egw_info']['etemplate']['window']) if (!$GLOBALS['egw_info']['etemplate']['window'])
{ {
$window = &new GtkWindow(); $window = new GtkWindow();
$window->connect('destroy',array('etemplate','destroy')); $window->connect('destroy',array('etemplate','destroy'));
$window->connect('delete-event',array('etemplate','delete_event')); $window->connect('delete-event',array('etemplate','delete_event'));
$window->set_title('eGroupWareGTK: '.$GLOBALS['egw_info']['server']['site_title']); $window->set_title('eGroupWareGTK: '.$GLOBALS['egw_info']['server']['site_title']);
@ -125,7 +125,7 @@
$table->set_border_width(10); $table->set_border_width(10);
$table->show(); $table->show();
$swindow = &new GtkScrolledWindow(null,null); $swindow = new GtkScrolledWindow(null,null);
$swindow->set_policy(GTK_POLICY_AUTOMATIC,GTK_POLICY_AUTOMATIC); $swindow->set_policy(GTK_POLICY_AUTOMATIC,GTK_POLICY_AUTOMATIC);
$swindow->add_with_viewport($table); $swindow->add_with_viewport($table);
$swindow->show(); $swindow->show();
@ -287,7 +287,7 @@
'.row' => $show_row '.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_row_spacings(2);
$table->set_col_spacings(5); $table->set_col_spacings(5);
$table->show(); $table->show();
@ -369,7 +369,7 @@
default: default:
$align = 0.0; $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); $align->add($widget);
} }
$table->attach($align ? $align : $widget, $c, $c+$colspan, $r, $r+1,GTK_FILL,GTK_FILL,0,0); $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); $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 // 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]; $form_name = $cname == '' ? $name : $cname.'['.$regs[1].']'.$regs[2];
eval(str_replace(']',"']",str_replace('[',"['",'$value = $content['.$regs[1].']'.$regs[2].';'))); eval(str_replace(']',"']",str_replace('[',"['",'$value = $content['.$regs[1].']'.$regs[2].';')));
@ -492,7 +492,7 @@
if ($value) if ($value)
{ {
$widget = &new GtkLabel($value); $widget = new GtkLabel($value);
if ($cell['align'] != 'center') if ($cell['align'] != 'center')
{ {
$widget->set_justify($cell['align'] == 'right' ? GTK_JUSTIFY_RIGHT : GTK_JUSTIFY_LEFT); $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')); //$html .= $this->html->input($form_name,$value,'',$options.$this->html->formatOptions($cell['size'],'SIZE,MAXLENGTH'));
} }
list($len,$max) = explode(',',$cell['size']); list($len,$max) = explode(',',$cell['size']);
$widget = &new GtkEntry(); $widget = new GtkEntry();
$widget->set_text($value); $widget->set_text($value);
if ($max) if ($max)
{ {
@ -534,15 +534,15 @@
break; break;
case 'textarea': // Multiline Text Input, size: [rows][,cols] case 'textarea': // Multiline Text Input, size: [rows][,cols]
//$html .= $this->html->textarea($form_name,$value,$options.$this->html->formatOptions($cell['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->insert_text($value,strlen($value));
$widget->set_editable(!$readonly); $widget->set_editable(!$readonly);
break; break;
/* case 'date': /* case 'date':
if ($cell['size'] != '') if ($cell['size'] != '')
{ {
$date = split('[/.-]',$value); $date = preg_split('/[\\/.-]/',$value);
$mdy = split('[/.-]',$cell['size']); $mdy = preg_split('/[\\/.-]/',$cell['size']);
for ($value=array(),$n = 0; $n < 3; ++$n) for ($value=array(),$n = 0; $n < 3; ++$n)
{ {
switch($mdy[$n]) switch($mdy[$n])
@ -572,7 +572,7 @@
$options .= ' CHECKED'; $options .= ' CHECKED';
} }
//$html .= $this->html->input($form_name,'1','CHECKBOX',$options); //$html .= $this->html->input($form_name,'1','CHECKBOX',$options);
$widget = &new GtkCheckButton($right_label); $widget = new GtkCheckButton($right_label);
$right_label = ''; $right_label = '';
$widget->set_active($value); $widget->set_active($value);
break; break;
@ -584,23 +584,23 @@
//$html .= $this->html->input($form_name,$cell['size'],'RADIO',$options); //$html .= $this->html->input($form_name,$cell['size'],'RADIO',$options);
if (isset($this->buttongroup[$form_name])) 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 else
{ {
$this->buttongroup[$form_name] = $widget = &new GtkRadioButton(null,$right_label); $this->buttongroup[$form_name] = $widget = new GtkRadioButton(null,$right_label);
} }
$right_label = ''; $right_label = '';
$widget->set_active($value == $cell['size']); $widget->set_active($value == $cell['size']);
break; break;
case 'button': case 'button':
//$html .= $this->html->submit_button($form_name,$cell['label'],'',strlen($cell['label']) <= 1 || $cell['no_lang'],$options); //$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); $widget->connect_object('clicked', array('etemplate', 'button_clicked'),&$var,$form_name);
break; break;
case 'hrule': case 'hrule':
//$html .= $this->html->hr($cell['size']); //$html .= $this->html->hr($cell['size']);
$widget = &new GtkHSeparator(); $widget = new GtkHSeparator();
break; break;
case 'template': // size: index in content-array (if not full content is past further on) 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'] != '') if ($this->autorepeat_idx($cell,$show_c,$show_row,$idx,$idx_cname) || $cell['size'] != '')
@ -661,7 +661,7 @@
$maxlen = $len; $maxlen = $len;
} }
} }
$widget = &new GtkCombo(); $widget = new GtkCombo();
$widget->set_popdown_strings($sel_options); $widget->set_popdown_strings($sel_options);
$entry = $widget->entry; $entry = $widget->entry;
$entry->set_text($sel_options[$value]); $entry->set_text($sel_options[$value]);
@ -709,7 +709,7 @@
$pixbuf = &$GLOBALS['egw_info']['etemplate']['pixbufs'][$path]; $pixbuf = &$GLOBALS['egw_info']['etemplate']['pixbufs'][$path];
if ($pixbuf) if ($pixbuf)
{ {
$widget = &new GtkDrawingArea(); $widget = new GtkDrawingArea();
$widget->size($pixbuf->get_width(),$pixbuf->get_height()); $widget->size($pixbuf->get_width(),$pixbuf->get_height());
$widget->connect('expose_event',array('etemplate','draw_image'),$pixbuf); $widget->connect('expose_event',array('etemplate','draw_image'),$pixbuf);
} }
@ -720,7 +720,7 @@
break; break;
default: default:
//$html .= '<i>unknown type</i>'; //$html .= '<i>unknown type</i>';
$widget = &new GtkLabel('unknown type: '.$cell['type']); $widget = new GtkLabel('unknown type: '.$cell['type']);
$widget->set_justify(GTK_JUSTIFY_LEFT); $widget->set_justify(GTK_JUSTIFY_LEFT);
break; break;
} }
@ -738,14 +738,14 @@
{ {
if (!$widget && !$right_label) if (!$widget && !$right_label)
{ {
$widget = &new GtkLabel($left_label); $widget = new GtkLabel($left_label);
} }
else else
{ {
$hbox = &new GtkHBox(False,5); $hbox = new GtkHBox(False,5);
if ($left_label) if ($left_label)
{ {
$left = &new GtkLabel($left_label); $left = new GtkLabel($left_label);
$left->show(); $left->show();
$hbox->add($left); $hbox->add($left);
} }
@ -756,7 +756,7 @@
} }
if ($right_label) if ($right_label)
{ {
$right = &new GtkLabel($right_label); $right = new GtkLabel($right_label);
$right->show(); $right->show();
$hbox->add($right); $hbox->add($right);
} }
@ -766,7 +766,7 @@
{ {
if (!$this->tooltips) if (!$this->tooltips)
{ {
$this->tooltips = &new GtkTooltips(); $this->tooltips = new GtkTooltips();
} }
$this->tooltips->set_tip($widget,lang($cell['help']),$this->name.'/'.$form_name); $this->tooltips->set_tip($widget,lang($cell['help']),$this->name.'/'.$form_name);
} }

View File

@ -12,7 +12,7 @@
function var2xml($name, $data) function var2xml($name, $data)
{ {
$doc =& new xmltool('root','',''); $doc = new xmltool('root','','');
return $doc->import_var($name,$data,True,True); return $doc->import_var($name,$data,True,True);
} }
@ -167,7 +167,7 @@
function import_var($name, $value,$is_root=False,$export_xml=False) function import_var($name, $value,$is_root=False,$export_xml=False)
{ {
//echo "<p>import_var: this->indentstring='$this->indentstring'</p>\n"; //echo "<p>import_var: this->indentstring='$this->indentstring'</p>\n";
$node =& new xmltool('node',$name,$this->indentstring); $node = new xmltool('node',$name,$this->indentstring);
switch (gettype($value)) switch (gettype($value))
{ {
case 'string': case 'string':
@ -220,12 +220,12 @@
case 'integer': case 'integer':
case 'double': case 'double':
case 'NULL': case 'NULL':
$subnode =& new xmltool('node', $nextkey,$this->indentstring); $subnode = new xmltool('node', $nextkey,$this->indentstring);
$subnode->set_value($val); $subnode->set_value($val);
$node->add_node($subnode); $node->add_node($subnode);
break; break;
case 'boolean': case 'boolean':
$subnode =& new xmltool('node', $nextkey,$this->indentstring); $subnode = new xmltool('node', $nextkey,$this->indentstring);
if($val == True) if($val == True)
{ {
$subnode->set_value('1'); $subnode->set_value('1');
@ -251,7 +251,7 @@
} }
break; break;
case 'object': case 'object':
$subnode =& new xmltool('node', $nextkey,$this->indentstring); $subnode = new xmltool('node', $nextkey,$this->indentstring);
$subnode->set_value('PHP_SERIALIZED_OBJECT&:'.serialize($val)); $subnode->set_value('PHP_SERIALIZED_OBJECT&:'.serialize($val));
$node->add_node($subnode); $node->add_node($subnode);
break; break;
@ -390,7 +390,7 @@
{ {
case 'cdata': case 'cdata':
case 'complete': 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) if(is_array($data[$i]['attributes']) && count($data[$i]['attributes']) > 0)
{ {
while(list($k,$v)=each($data[$i]['attributes'])) while(list($k,$v)=each($data[$i]['attributes']))
@ -402,7 +402,7 @@
$parent_node->add_node($node); $parent_node->add_node($node);
break; break;
case 'open': 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) if(is_array($data[$i]['attributes']) && count($data[$i]['attributes']) > 0)
{ {
while(list($k,$v)=each($data[$i]['attributes'])) while(list($k,$v)=each($data[$i]['attributes']))
@ -428,7 +428,7 @@
xml_parse_into_struct($parser, $xmldata, $vals, $index); xml_parse_into_struct($parser, $xmldata, $vals, $index);
xml_parser_free($parser); xml_parser_free($parser);
unset($index); 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'])) if(isset($vals[0]['attributes']))
{ {
while(list($key,$value) = each($vals[0]['attributes'])) while(list($key,$value) = each($vals[0]['attributes']))

View File

@ -165,16 +165,16 @@
$widgetattr2xul = isset($this->widget2xul[$type]) ? $this->widget2xul[$type] : array(); $widgetattr2xul = isset($this->widget2xul[$type]) ? $this->widget2xul[$type] : array();
$type = isset($widgetattr2xul['.name']) ? $widgetattr2xul['.name'] : $type; $type = isset($widgetattr2xul['.name']) ? $widgetattr2xul['.name'] : $type;
list($type,$child,$child2) = explode(',',$type); list($type,$child,$child2) = explode(',',$type);
$widget =& new xmlnode($type); $widget = new xmlnode($type);
$attr_widget = &$widget; $attr_widget = &$widget;
if ($child) if ($child)
{ {
$child =& new xmlnode($child); $child = new xmlnode($child);
if ($type != 'tabbox') $attr_widget = &$child; if ($type != 'tabbox') $attr_widget = &$child;
} }
if ($child2) if ($child2)
{ {
$child2 =& new xmlnode($child2); $child2 = new xmlnode($child2);
} }
if (isset($widgetattr2xul['.set'])) // set default-attr for type if (isset($widgetattr2xul['.set'])) // set default-attr for type
{ {
@ -189,7 +189,7 @@
{ {
case 'nextmatch': case 'nextmatch':
list($tpl) = explode(',',$cell['size']); list($tpl) = explode(',',$cell['size']);
$embeded =& new etemplate($tpl,$this->load_via); $embeded = new etemplate($tpl,$this->load_via);
if ($embeded_too) if ($embeded_too)
{ {
$this->add_etempl($embeded,$embeded_too); $this->add_etempl($embeded,$embeded_too);
@ -207,17 +207,17 @@
$names = explode('|',$tab_names); $names = explode('|',$tab_names);
for ($n = 0; $n < count($labels); ++$n) for ($n = 0; $n < count($labels); ++$n)
{ {
$tab =& new xmlnode('tab'); $tab = new xmlnode('tab');
$tab->set_attribute('label',$labels[$n]); $tab->set_attribute('label',$labels[$n]);
$tab->set_attribute('statustext',$helps[$n]); $tab->set_attribute('statustext',$helps[$n]);
$child->add_node($tab); $child->add_node($tab);
$embeded =& new etemplate($names[$n],$this->load_via); $embeded = new etemplate($names[$n],$this->load_via);
if ($embeded_too) if ($embeded_too)
{ {
$this->add_etempl($embeded,$embeded_too); $this->add_etempl($embeded,$embeded_too);
} }
$template =& new xmlnode('template'); $template = new xmlnode('template');
$template->set_attribute('id',$embeded->name); $template->set_attribute('id',$embeded->name);
$child2->add_node($template); $child2->add_node($template);
unset($embeded); unset($embeded);
@ -240,7 +240,7 @@
case 'groupbox': case 'groupbox':
if ($cell['label']) if ($cell['label'])
{ {
$caption =& new xmlnode('caption'); $caption = new xmlnode('caption');
$caption->set_attribute('label',$cell['label']); $caption->set_attribute('label',$cell['label']);
$widget->add_node($caption); $widget->add_node($caption);
unset($cell['label']); unset($cell['label']);
@ -250,7 +250,7 @@
case 'hbox': case 'hbox':
case 'box': case 'box':
case 'deck': case 'deck':
list($anz,$orient,$options) = split(',',$cell['size'],3); list($anz,$orient,$options) = explode(',',$cell['size'],3);
for ($n = 1; $n <= $anz; ++$n) for ($n = 1; $n <= $anz; ++$n)
{ {
$this->add_widget($widget,$cell[$n],$embeded_too); $this->add_widget($widget,$cell[$n],$embeded_too);
@ -265,7 +265,7 @@
case 'template': case 'template':
if ($cell['name'][0] != '@' && $embeded_too) 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)) if ($templ->read(boetemplate::expand_name($cell['name'],0,0),'default','default',0,'',$this->load_via))
{ {
$this->add_etempl($templ,$embeded_too); $this->add_etempl($templ,$embeded_too);
@ -314,18 +314,18 @@
*/ */
function add_grid(&$parent,$grid,&$embeded_too) 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,'width,height,border,class,spacing,padding,overflow',$grid['size']);
$this->set_attributes($xul_grid,'id',$grid['name']); $this->set_attributes($xul_grid,'id',$grid['name']);
$xul_columns =& new xmlnode('columns'); $xul_columns = new xmlnode('columns');
$xul_rows =& new xmlnode('rows'); $xul_rows = new xmlnode('rows');
reset($grid['data']); reset($grid['data']);
list(,$opts) = each ($grid['data']); // read over options-row list(,$opts) = each ($grid['data']); // read over options-row
while (list($r,$row) = each ($grid['data'])) 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,'class,valign',$opts["c$r"]);
$this->set_attributes($xul_row,'height,disabled,part',$opts["h$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 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]); $this->set_attributes($xul_column,'width,disabled',$opts[$c]);
$xul_columns->add_node($xul_column); $xul_columns->add_node($xul_column);
} }
@ -375,7 +375,7 @@
} }
$embeded_too[$etempl->name] = True; $embeded_too[$etempl->name] = True;
$template =& new xmlnode('template'); $template = new xmlnode('template');
$template->set_attribute('id',$etempl->name); $template->set_attribute('id',$etempl->name);
$template->set_attribute('template',$etempl->template); $template->set_attribute('template',$etempl->template);
$template->set_attribute('lang',$etempl->lang); $template->set_attribute('lang',$etempl->lang);
@ -388,7 +388,7 @@
} }
if ($etempl->style != '') if ($etempl->style != '')
{ {
$styles =& new xmlnode('styles'); $styles = new xmlnode('styles');
$styles->set_value(str_replace("\r",'',$etempl->style)); $styles->set_value(str_replace("\r",'',$etempl->style));
$template->add_node($styles); $template->add_node($styles);
} }
@ -407,10 +407,10 @@
{ {
echo "<p>etempl->data = "; _debug_array($etempl->data); echo "<p>etempl->data = "; _debug_array($etempl->data);
} }
$doc =& new xmldoc(); $doc = new xmldoc();
$doc->add_comment('$'.'Id$'); $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(); $this->load_via = $etempl->as_array();
$embeded_too = True; $embeded_too = True;
@ -572,7 +572,7 @@
{ {
break; 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]['c'.$parent['rows']] = $attr['class'] . ($attr['valign'] ? ','.$attr['valign'] : '');
$parent['data'][0]['h'.$parent['rows']] = $attr['height'] . $parent['data'][0]['h'.$parent['rows']] = $attr['height'] .
($attr['disabled']||$attr['part'] ? ','.$attr['disabled'] : ''). ($attr['disabled']||$attr['part'] ? ','.$attr['disabled'] : '').
@ -696,7 +696,7 @@
unset($attr['src']); unset($attr['src']);
break; break;
case 'listbox': case 'listbox':
$attr['size'] = ereg_replace(',*$','',$attr['rows'].','.$attr['size']); $attr['size'] = preg_replace('/,*$/','',$attr['rows'].','.$attr['size']);
unset($attr['rows']); unset($attr['rows']);
break; break;
case 'button': case 'button':

View File

@ -59,7 +59,7 @@ class uidefinitions
$GLOBALS['egw_info']['flags']['currentapp'] = self::_appname; $GLOBALS['egw_info']['flags']['currentapp'] = self::_appname;
$GLOBALS['egw_info']['flags']['include_xajax'] = true; $GLOBALS['egw_info']['flags']['include_xajax'] = true;
$this->etpl =& new etemplate(); $this->etpl = new etemplate();
$this->clock = html::image(self::_appname,'clock'); $this->clock = html::image(self::_appname,'clock');
$this->steps = array( $this->steps = array(
'wizzard_step10' => lang('Choose an application'), '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 ... // we need an offset because of autocontinued rows in etemplate ...
$definitions = array('row0'); $definitions = array('row0');
@ -213,7 +213,7 @@ class uidefinitions
if(class_exists('xajaxResponse')) if(class_exists('xajaxResponse'))
{ {
$this->response =& new xajaxResponse(); $this->response = new xajaxResponse();
if ($content['closewindow']) if ($content['closewindow'])
{ {
@ -245,7 +245,7 @@ class uidefinitions
// adding a manual icon to every popup // adding a manual icon to every popup
if ($GLOBALS['egw_info']['user']['apps']['manual']) 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); echo $manual->exec(self::_appname.'.uidefinitions.wizzard',$content,$sel_options,$readonlys,$preserv,1);
unset($manual); unset($manual);
} }
@ -271,7 +271,7 @@ class uidefinitions
/*if($content['plugin'] && $content['application']&& !is_object($this->plugin)) /*if($content['plugin'] && $content['application']&& !is_object($this->plugin))
{ {
$plugin_definition = $this->plugins[$content['application']][$content['plugin']]['definition']; $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)) if(is_object($this->plugin))
{ {
@ -446,7 +446,7 @@ class uidefinitions
} }
else 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); return $etpl->exec(self::_appname.'.uidefinitions.import_definition',$content,array(),$readonlys,$preserv);
} }
} }

View File

@ -167,7 +167,7 @@ class uiexport {
elseif(class_exists('xajaxResponse')) elseif(class_exists('xajaxResponse'))
{ {
//error_log(__LINE__.__FILE__.'$_content: '.print_r($_content,true)); //error_log(__LINE__.__FILE__.'$_content: '.print_r($_content,true));
$response =& new xajaxResponse(); $response = new xajaxResponse();
if ($_content['defintion'] == 'expert') { if ($_content['defintion'] == 'expert') {
$definition = new definition(); $definition = new definition();

View File

@ -429,8 +429,8 @@ case 'import':
{ {
if (ereg((string) $pattern,$val)) if (ereg((string) $pattern,$val))
{ {
// echo "<p>csv_idx='$csv_idx',info='$info',trans_csv=".print_r($trans_csv).",ereg_replace('$pattern','$replace','$val') = "; // echo "<p>csv_idx='$csv_idx',info='$info',trans_csv=".print_r($trans_csv).",preg_replace('/$pattern/','$replace','$val') = ";
$val = ereg_replace((string) $pattern,str_replace($VPre,'\\',$replace),(string) $val); $val = preg_replace('/'.(string) $pattern.'/',str_replace($VPre,'\\',$replace),(string) $val);
// echo "'$val'</p>"; // echo "'$val'</p>";
$reg = $CPreReg.'([a-zA-Z_0-9]+)'.$CPosReg; $reg = $CPreReg.'([a-zA-Z_0-9]+)'.$CPosReg;
@ -485,7 +485,7 @@ case 'import':
{ {
$responsible = $values['responsible']; $responsible = $values['responsible'];
$values['responsible'] = array(); $values['responsible'] = array();
foreach(split('[,;]',$responsible) as $user) foreach(preg_split('/[,;]/',$responsible) as $user)
{ {
if (preg_match('/\[([^\]]+)\]/',$user,$matches)) $user = $matches[1]; if (preg_match('/\[([^\]]+)\]/',$user,$matches)) $user = $matches[1];
if ($user && !is_numeric($user)) $user = $GLOBALS['egw']->accounts->name2id($user); if ($user && !is_numeric($user)) $user = $GLOBALS['egw']->accounts->name2id($user);

View File

@ -236,7 +236,7 @@ class infolog_bo
$this->user_time_now = time() + $this->tz_offset_s; $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->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) if ($info_id)
{ {
@ -516,7 +516,7 @@ class infolog_bo
require_once(EGW_INCLUDE_ROOT.'/infolog/inc/class.infolog_tracking.inc.php'); require_once(EGW_INCLUDE_ROOT.'/infolog/inc/class.infolog_tracking.inc.php');
if (!is_object($this->tracking)) 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); $this->tracking->track($deleted,$info,$this->user,true);
} }
@ -720,7 +720,7 @@ class infolog_bo
// send email notifications and do the history logging // send email notifications and do the history logging
if (!is_object($this->tracking)) 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'); $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->acl($user);
$GLOBALS['egw']->acl->read_repository(); $GLOBALS['egw']->acl->read_repository();
$this->grants = $GLOBALS['egw']->acl->get_grants('infolog',$this->group_owners ? $this->group_owners : true); $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(); $notified_info_ids = array();
foreach(array( foreach(array(

View File

@ -209,7 +209,7 @@ class infolog_customfields
{ {
foreach(explode("\n",$field['values']) as $line) foreach(explode("\n",$field['values']) as $line)
{ {
list($var,$value) = split('=',trim($line),2); list($var,$value) = explode('=',trim($line),2);
$var = trim($var); $var = trim($var);
$values[$var] = empty($value) ? $var : $value; $values[$var] = empty($value) ? $var : $value;
} }

View File

@ -44,7 +44,7 @@ class infolog_datasource extends datasource
// we use $GLOBALS['infolog_bo'] as an already running instance might be availible there // we use $GLOBALS['infolog_bo'] as an already running instance might be availible there
if (!is_object($GLOBALS['infolog_bo'])) if (!is_object($GLOBALS['infolog_bo']))
{ {
$GLOBALS['infolog_bo'] =& new infolog_bo(); $GLOBALS['infolog_bo'] = new infolog_bo();
} }
$this->infolog_bo =& $GLOBALS['infolog_bo']; $this->infolog_bo =& $GLOBALS['infolog_bo'];
} }
@ -150,7 +150,7 @@ class infolog_datasource extends datasource
if (!is_object($GLOBALS['infolog_bo'])) if (!is_object($GLOBALS['infolog_bo']))
{ {
include_once(EGW_INCLUDE_ROOT.'/infolog/inc/class.infolog_bo.inc.php'); 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 // dont delete infolog, which are linked to other elements, but their project
if (count(egw_link::get_links('infolog',$id)) > 1) if (count(egw_link::get_links('infolog',$id)) > 1)

View File

@ -36,7 +36,7 @@ class infolog_groupdav extends groupdav_handler
if (self::$debugInfo) error_log(__METHOD__." called "); if (self::$debugInfo) error_log(__METHOD__." called ");
parent::__construct($app,$debug,$base_uri); parent::__construct($app,$debug,$base_uri);
if (self::$debugInfo) error_log(__METHOD__." parent constructed with $app,$debug,$base_uri; initializing infolog_bo "); 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'; const PATH_ATTRIBUTE = 'info_id';
@ -231,7 +231,7 @@ class infolog_groupdav extends groupdav_handler
private function _get_handler() private function _get_handler()
{ {
if (self::$debugInfo) error_log(__METHOD__." called "); if (self::$debugInfo) error_log(__METHOD__." called ");
$handler =& new infolog_ical(); $handler = new infolog_ical();
$handler->setSupportedFields('GroupDAV',$this->agent); $handler->setSupportedFields('GroupDAV',$this->agent);
return $handler; return $handler;

View File

@ -357,7 +357,7 @@ class infolog_hooks
if ($data['prefs']['notify_due_delegated'] || $data['prefs']['notify_due_responsible'] || if ($data['prefs']['notify_due_delegated'] || $data['prefs']['notify_due_responsible'] ||
$data['prefs']['notify_start_delegated'] || $data['prefs']['notify_start_responsible']) $data['prefs']['notify_start_delegated'] || $data['prefs']['notify_start_responsible'])
{ {
$async =& new asyncservice(); $async = new asyncservice();
if (!$async->read('infolog-async-notification')) if (!$async->read('infolog-async-notification'))
{ {

View File

@ -57,7 +57,7 @@ class infolog_ical extends infolog_bo
$taskGUID = $GLOBALS['egw']->common->generate_uid('infolog_task',$_taskID); $taskGUID = $GLOBALS['egw']->common->generate_uid('infolog_task',$_taskID);
$vcal = &new Horde_iCalendar; $vcal = new Horde_iCalendar;
$vcal->setAttribute('VERSION',$_version); $vcal->setAttribute('VERSION',$_version);
$vcal->setAttribute('METHOD',$_method); $vcal->setAttribute('METHOD',$_method);
@ -164,7 +164,7 @@ class infolog_ical extends infolog_bo
function vtodotoegw($_vcalData,$_taskID=-1) function vtodotoegw($_vcalData,$_taskID=-1)
{ {
$vcal = &new Horde_iCalendar; $vcal = new Horde_iCalendar;
if(!$vcal->parsevCalendar($_vcalData)) if(!$vcal->parsevCalendar($_vcalData))
{ {
return FALSE; return FALSE;
@ -274,7 +274,7 @@ class infolog_ical extends infolog_bo
case 'text/x-vnote': case 'text/x-vnote':
$noteGUID = $GLOBALS['egw']->common->generate_uid('infolog_note',$_noteID); $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('VERSION', '1.1');
$vnote->setAttribute('SUMMARY',$note['info_subject']); $vnote->setAttribute('SUMMARY',$note['info_subject']);
$vnote->setAttribute('BODY',$note['info_des']); $vnote->setAttribute('BODY',$note['info_des']);
@ -368,7 +368,7 @@ class infolog_ical extends infolog_bo
break; break;
case 'text/x-vnote': case 'text/x-vnote':
$vnote = &new Horde_iCalendar; $vnote = new Horde_iCalendar;
if (!$vcal->parsevCalendar($_data)) if (!$vcal->parsevCalendar($_data))
{ {
return FALSE; return FALSE;

View File

@ -129,7 +129,7 @@ class infolog_sif extends infolog_bo
switch($_sifType) { switch($_sifType) {
case 'task': case 'task':
$taskData = array(); $taskData = array();
$vcal = &new Horde_iCalendar; $vcal = new Horde_iCalendar;
$taskData['info_type'] = 'task'; $taskData['info_type'] = 'task';
@ -201,7 +201,7 @@ class infolog_sif extends infolog_bo
case 'note': case 'note':
$noteData = array(); $noteData = array();
$noteData['info_type'] = 'note'; $noteData['info_type'] = 'note';
$vcal = &new Horde_iCalendar; $vcal = new Horde_iCalendar;
foreach($this->_extractedSIFData as $key => $value) foreach($this->_extractedSIFData as $key => $value)
{ {
@ -280,7 +280,7 @@ class infolog_sif extends infolog_bo
case 'task': case 'task':
if($taskData = $this->read($_id)) { if($taskData = $this->read($_id)) {
$sysCharSet = $GLOBALS['egw']->translation->charset(); $sysCharSet = $GLOBALS['egw']->translation->charset();
$vcal = &new Horde_iCalendar; $vcal = new Horde_iCalendar;
$sifTask = '<task>'; $sifTask = '<task>';
@ -388,7 +388,7 @@ class infolog_sif extends infolog_bo
case 'note': case 'note':
if($taskData = $this->read($_id)) { if($taskData = $this->read($_id)) {
$sysCharSet = $GLOBALS['egw']->translation->charset(); $sysCharSet = $GLOBALS['egw']->translation->charset();
$vcal = &new Horde_iCalendar; $vcal = new Horde_iCalendar;
$sifNote = '<note>'; $sifNote = '<note>';
@ -448,7 +448,7 @@ class infolog_sif extends infolog_bo
$taskGUID = $GLOBALS['phpgw']->common->generate_uid('infolog_task',$_taskID); $taskGUID = $GLOBALS['phpgw']->common->generate_uid('infolog_task',$_taskID);
$vcal = &new Horde_iCalendar; $vcal = new Horde_iCalendar;
$vcal->setAttribute('VERSION',$_version); $vcal->setAttribute('VERSION',$_version);
$vcal->setAttribute('METHOD','PUBLISH'); $vcal->setAttribute('METHOD','PUBLISH');
@ -492,7 +492,7 @@ class infolog_sif extends infolog_bo
{ {
$botranslation = CreateObject('phpgwapi.translation'); $botranslation = CreateObject('phpgwapi.translation');
$vcal = &new Horde_iCalendar; $vcal = new Horde_iCalendar;
if(!$vcal->parsevCalendar($_vcalData)) if(!$vcal->parsevCalendar($_vcalData))
{ {
return FALSE; return FALSE;

View File

@ -284,7 +284,7 @@ class infolog_so
preg_match('/(upcoming|today|overdue|date|enddate)([-\\/.0-9]*)/',$filter,$vars); preg_match('/(upcoming|today|overdue|date|enddate)([-\\/.0-9]*)/',$filter,$vars);
$filter = $vars[1]; $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])); $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])); $tomorrow = mktime(-$this->tz_offset,0,0,intval($date[1]),intval($date[2])+1,intval($date[0]));

View File

@ -91,7 +91,7 @@ class infolog_ui
*/ */
function __construct() function __construct()
{ {
$this->bo =& new infolog_bo(); $this->bo = new infolog_bo();
$this->tmpl = new etemplate(); $this->tmpl = new etemplate();
@ -302,7 +302,7 @@ class infolog_ui
unset($query['custom_fields']); unset($query['custom_fields']);
if ($query['col_filter']['info_type']) if ($query['col_filter']['info_type'])
{ {
$tpl =& new etemplate; $tpl = new etemplate;
if ($tpl->read('infolog.index.rows.'.$query['col_filter']['info_type'])) if ($tpl->read('infolog.index.rows.'.$query['col_filter']['info_type']))
{ {
$query['template'] =& $tpl; $query['template'] =& $tpl;

View File

@ -60,7 +60,7 @@ class infolog_widget
function infolog_widget($ui) function infolog_widget($ui)
{ {
$this->ui = $ui; $this->ui = $ui;
$this->infolog =& new infolog_bo(); $this->infolog = new infolog_bo();
} }
/** /**

View File

@ -385,7 +385,7 @@ else
foreach($_GET as $name => $value) foreach($_GET as $name => $value)
{ {
if(ereg('phpgw_',$name)) if(strpos($name,'phpgw_') !== false)
{ {
$extra_vars .= '&' . $name . '=' . urlencode($value); $extra_vars .= '&' . $name . '=' . urlencode($value);
} }

View File

@ -390,7 +390,7 @@ class ADODB_DataDict {
if ($flds) { if ($flds) {
list($lines,$pkey) = $this->_GenFields($flds); list($lines,$pkey) = $this->_GenFields($flds);
list(,$first) = each($lines); 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)); return array(sprintf($this->renameColumn,$tabname,$this->NameQuote($oldcolumn),$this->NameQuote($newcolumn),$column_def));
} }

View File

@ -113,7 +113,7 @@ class DB
{ {
include_once(ADODB_DIR."/drivers/adodb-$type.inc.php"); include_once(ADODB_DIR."/drivers/adodb-$type.inc.php");
$obj = &NewADOConnection($type); $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; return $obj;
} }
@ -159,7 +159,7 @@ class DB
@$obj =& NewADOConnection($type); @$obj =& NewADOConnection($type);
if (!is_object($obj)) { 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; return $obj;
} }
if (is_array($options)) { if (is_array($options)) {

View File

@ -75,10 +75,10 @@ function& adodb_log_sql(&$conn,$sql,$inputarr)
$conn->_logsql = false; // disable logsql error simulation $conn->_logsql = false; // disable logsql error simulation
$dbT = $conn->databaseType; $dbT = $conn->databaseType;
$a0 = split(' ',$t0); $a0 = explode(' ',$t0);
$a0 = (float)$a0[1]+(float)$a0[0]; $a0 = (float)$a0[1]+(float)$a0[0];
$a1 = split(' ',$t1); $a1 = explode(' ',$t1);
$a1 = (float)$a1[1]+(float)$a1[0]; $a1 = (float)$a1[1]+(float)$a1[0];
$time = $a1 - $a0; $time = $a1 - $a0;

View File

@ -656,7 +656,7 @@ function adodb_get_gmt_diff()
static $TZ; static $TZ;
if (isset($TZ)) return $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; return $TZ;
} }
@ -1284,4 +1284,4 @@ global $ADODB_DATE_LOCALE;
} }
?> ?>

View File

@ -350,7 +350,7 @@ class dbTable extends dbObject {
*/ */
function &addIndex( $attributes ) { function &addIndex( $attributes ) {
$name = strtoupper( $attributes['NAME'] ); $name = strtoupper( $attributes['NAME'] );
$this->indexes[$name] =& new dbIndex( $this, $attributes ); $this->indexes[$name] = new dbIndex( $this, $attributes );
return $this->indexes[$name]; return $this->indexes[$name];
} }
@ -362,7 +362,7 @@ class dbTable extends dbObject {
*/ */
function &addData( $attributes ) { function &addData( $attributes ) {
if( !isset( $this->data ) ) { if( !isset( $this->data ) ) {
$this->data =& new dbData( $this, $attributes ); $this->data = new dbData( $this, $attributes );
} }
return $this->data; return $this->data;
} }

View File

@ -885,7 +885,7 @@
} }
if ($this->_queryID === true) { // return simplified recordset for inserts/updates/deletes with lower overhead if ($this->_queryID === true) { // return simplified recordset for inserts/updates/deletes with lower overhead
$rs =& new ADORecordSet_empty(); $rs = new ADORecordSet_empty();
return $rs; return $rs;
} }
@ -1853,7 +1853,7 @@
if (empty($this->_metars)) { if (empty($this->_metars)) {
$rsclass = $this->rsPrefix.$this->databaseType; $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); return $this->_metars->MetaType($t,$len,$fieldobj);

View File

@ -369,7 +369,7 @@ class ADORecordset_informix72 extends ADORecordSet {
foreach($fp as $k => $v) { foreach($fp as $k => $v) {
$o = new ADOFieldObject; $o = new ADOFieldObject;
$o->name = $k; $o->name = $k;
$arr = split(';',$v); //"SQLTYPE;length;precision;scale;ISNULLABLE" $arr = explode(';',$v); //"SQLTYPE;length;precision;scale;ISNULLABLE"
$o->type = $arr[0]; $o->type = $arr[0];
$o->max_length = $arr[1]; $o->max_length = $arr[1];
$this->_fieldprops[] = $o; $this->_fieldprops[] = $o;

View File

@ -422,7 +422,7 @@ See http://msdn.microsoft.com/library/default.asp?url=/library/en-us/odbc/htm/od
} }
if (empty($qid)) return $false; if (empty($qid)) return $false;
$rs =& new ADORecordSet_odbc($qid); $rs = new ADORecordSet_odbc($qid);
$ADODB_FETCH_MODE = $savem; $ADODB_FETCH_MODE = $savem;
if (!$rs) return $false; if (!$rs) return $false;

View File

@ -647,7 +647,7 @@ WHERE c2.relname=\'%s\' or c2.relname=lower(\'%s\')';
if (strlen($db) == 0) $db = 'template1'; if (strlen($db) == 0) $db = 'template1';
$db = adodb_addslashes($db); $db = adodb_addslashes($db);
if ($str) { if ($str) {
$host = split(":", $str); $host = explode(":", $str);
if ($host[0]) $str = "host=".adodb_addslashes($host[0]); if ($host[0]) $str = "host=".adodb_addslashes($host[0]);
else $str = 'host=localhost'; else $str = 'host=localhost';
if (isset($host[1])) $str .= " port=$host[1]"; if (isset($host[1])) $str .= " port=$host[1]";

View File

@ -77,7 +77,7 @@ class ADODB_sybase_ase extends ADODB_sybase {
$retarr = array(); $retarr = array();
while (!$rs->EOF) { while (!$rs->EOF) {
$fld =& new ADOFieldObject(); $fld = new ADOFieldObject();
$fld->name = $rs->Fields('field_name'); $fld->name = $rs->Fields('field_name');
$fld->type = $rs->Fields('type'); $fld->type = $rs->Fields('type');
$fld->max_length = $rs->Fields('width'); $fld->max_length = $rs->Fields('width');

View File

@ -21,14 +21,14 @@ class ADODB_Encrypt_MD5 {
/** /**
*/ */
function write($data, $key) { function write($data, $key) {
$md5crypt =& new MD5Crypt(); $md5crypt = new MD5Crypt();
return $md5crypt->encrypt($data, $key); return $md5crypt->encrypt($data, $key);
} }
/** /**
*/ */
function read($data, $key) { function read($data, $key) {
$md5crypt =& new MD5Crypt(); $md5crypt = new MD5Crypt();
return $md5crypt->decrypt($data, $key); return $md5crypt->decrypt($data, $key);
} }

View File

@ -481,7 +481,7 @@ class accounts_sql
*/ */
function update_lastlogin($account_id, $ip) 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( $this->db->update($this->table,array(
'account_lastloginfrom' => $ip, 'account_lastloginfrom' => $ip,

View File

@ -436,7 +436,7 @@ class acl
'acl_location' => $location, 'acl_location' => $location,
'acl_account' => $account_id, 'acl_account' => $account_id,
'acl_appname' => $appname, 'acl_appname' => $appname,
),__LINE__,__FILE__)->fetchSingle(); ),__LINE__,__FILE__)->fetchColumn();
} }
/** /**

View File

@ -604,7 +604,7 @@ class asyncservice
while ($line = fgets($crontab,256)) while ($line = fgets($crontab,256))
{ {
if ($this->debug) echo 'line '.++$n.": $line<br>\n"; if ($this->debug) echo 'line '.++$n.": $line<br>\n";
$parts = split(' ',$line,6); $parts = explode(' ',$line,6);
if ($line{0} == '#' || count($parts) < 6 || ($parts[5]{0} != '/' && substr($parts[5],0,3) != 'php')) if ($line{0} == '#' || count($parts) < 6 || ($parts[5]{0} != '/' && substr($parts[5],0,3) != 'php'))
{ {

View File

@ -31,7 +31,7 @@
function authenticate($username, $passwd) function authenticate($username, $passwd)
{ {
if (ereg('[()|&=*,<>!~]',$username)) if (preg_match('/[()|&=*,<>!~]/',$username))
{ {
return False; return False;
} }

View File

@ -130,7 +130,7 @@ class auth_
'account_id' => $account_id, 'account_id' => $account_id,
'account_type' => 'u', 'account_type' => 'u',
'account_status' => 'A', 'account_status' => 'A',
),__LINE__,__FILE__)->fetchSingle()) === false) ),__LINE__,__FILE__)->fetchColumn()) === false)
{ {
return false; // account not found return false; // account not found
} }

View File

@ -39,30 +39,30 @@
/* /*
Determine browser and version 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_VER = $log_version[1];
$this->BROWSER_AGENT = 'IE'; $this->BROWSER_AGENT = 'IE';
} }
elseif(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) ||
ereg('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_VER = $log_version[1];
$this->BROWSER_AGENT = 'OPERA'; $this->BROWSER_AGENT = 'OPERA';
} }
elseif(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) ||
eregi('iCab/([0-9].[0-9a-zA-Z]{1,4})',$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_VER = $log_version[1];
$this->BROWSER_AGENT = 'iCab'; $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_VER = $log_version[1];
$this->BROWSER_AGENT = 'MOZILLA'; $this->BROWSER_AGENT = 'MOZILLA';
} }
elseif(ereg('Konqueror/([0-9].[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) ||
ereg('Konqueror/([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_VER=$log_version[1];
$this->BROWSER_AGENT='Konqueror'; $this->BROWSER_AGENT='Konqueror';

View File

@ -581,7 +581,7 @@ class common
{ {
while ($file = readdir($dh)) 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,'.')); $list[] = substr($file,0,strpos($file,'.'));
} }
@ -593,7 +593,7 @@ class common
$dh = opendir(EGW_SERVER_ROOT . '/phpgwapi/themes'); $dh = opendir(EGW_SERVER_ROOT . '/phpgwapi/themes');
while ($file = readdir($dh)) while ($file = readdir($dh))
{ {
if (eregi("\.theme$", $file)) if (preg_match('/'."\.theme$".'/i', $file))
{ {
$list[] = substr($file,0,strpos($file,'.')); $list[] = substr($file,0,strpos($file,'.'));
} }
@ -1563,7 +1563,7 @@ class common
return -1; 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) if ($max && $id >= $max)
{ {
@ -1593,7 +1593,7 @@ class common
return -1; 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) if (!$id || $id < $min)
{ {

View File

@ -116,7 +116,7 @@ class contenthistory
'sync_contentid' => $_id, '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); $ts = $this->db->from_timestamp($ts);
} }
@ -155,7 +155,7 @@ class contenthistory
'sync_contentid' => $_id, '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__); $this->db->insert(self::TABLE,$newData,array(),__LINE__,__FILE__);
} }

View File

@ -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.: * egw_db allows to use exceptions to catch sql-erros, not existing tables or failure to connect to the database, eg.:
* try { * try {
* $this->db->connect(); * $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) { * catch(Exception $e) {
* echo "Connection to DB failed (".$e->getMessage().")!\n"; * echo "Connection to DB failed (".$e->getMessage().")!\n";

View File

@ -651,7 +651,7 @@ abstract class egw_framework
{ {
require_once(EGW_SERVER_ROOT.'/phpgwapi/inc/xajax.inc.php'); 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->waitCursorOff();
$xajax->registerFunction("doXMLHTTP"); $xajax->registerFunction("doXMLHTTP");

View File

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

View File

@ -61,7 +61,7 @@
} }
$fname = $parms['file']; $fname = $parms['file'];
$line = $parms['line']; $line = $parms['line'];
if (eregi('([DIWEF])-([[:alnum:]]*)\, (.*)',$etext,$match)) if (preg_match('/([DIWEF])-([[:alnum:]]*)\, (.*)/i',$etext,$match))
{ {
$this->severity = strtoupper($match[1]); $this->severity = strtoupper($match[1]);
$this->code = $match[2]; $this->code = $match[2];

View File

@ -886,14 +886,14 @@ class html
*/ */
static function image( $app,$name,$title='',$options='' ) 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 if (is_array($name)) // menuaction and other get-vars
{ {
$name = $GLOBALS['egw']->link('/index.php',$name); $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://' || stripos($name,'etemplate/thumbnail.php') )
{ {
if (!($name[0] == '/' || substr($name,0,7) == 'http://' || substr($name,0,8) == 'https://')) $name = '/'.$name; if (!($name[0] == '/' || substr($name,0,7) == 'http://' || substr($name,0,8) == 'https://')) $name = '/'.$name;

View File

@ -459,7 +459,7 @@
} }
break; break;
case 'expires': 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]; $year = (int)$matches[5];
if($year<1900) if($year<1900)

View File

@ -81,7 +81,7 @@
function interserver($serverid='') 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( $this->urlparts = array(
'xmlrpc' => $url.'/xmlrpc.php', 'xmlrpc' => $url.'/xmlrpc.php',
'soap' => $url.'/soap.php' 'soap' => $url.'/soap.php'

View File

@ -309,7 +309,7 @@
$thyapi_comp = 'thyapi_comp_gecko.js'; $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) if (EGW_UNCOMPRESSED_THYAPI)
{ {
$jsCode = "<!-- JS Global Variables and ThyAPI Insertion -->\n" . $jsCode = "<!-- JS Global Variables and ThyAPI Insertion -->\n" .

View File

@ -204,8 +204,8 @@ function monthClicked(calendar,monthstart) {
{ {
return False; return False;
} }
$fields = split('[./-]',$datestr); $fields = preg_split('/[.\\/-]/',$datestr);
foreach(split('[./-]',$this->dateformat) as $n => $field) foreach(preg_split('/[.\\/-]/',$this->dateformat) as $n => $field)
{ {
if ($field == 'M') if ($field == 'M')
{ {

View File

@ -496,7 +496,7 @@ class PHPMailer {
$to .= $this->AddrFormat($this->to[$i]); $to .= $this->AddrFormat($this->to[$i]);
} }
$toArr = split(',', $to); $toArr = explode(',', $to);
$params = sprintf("-oi -f %s", $this->Sender); $params = sprintf("-oi -f %s", $this->Sender);
if ($this->Sender != '' && strlen(ini_get('safe_mode'))< 1) { if ($this->Sender != '' && strlen(ini_get('safe_mode'))< 1) {
@ -1779,7 +1779,7 @@ class PHPMailer {
$directory = dirname($url); $directory = dirname($url);
($directory == '.')?$directory='':''; ($directory == '.')?$directory='':'';
$cid = 'cid:' . md5($filename); $cid = 'cid:' . md5($filename);
$fileParts = split("\.", $filename); $fileParts = explode("\.", $filename);
$ext = $fileParts[1]; $ext = $fileParts[1];
$mimeType = $this->_mime_types($ext); $mimeType = $this->_mime_types($ext);
if ( strlen($basedir) > 1 && substr($basedir,-1) != '/') { $basedir .= '/'; } if ( strlen($basedir) > 1 && substr($basedir,-1) != '/') { $basedir .= '/'; }

View File

@ -53,12 +53,12 @@
$this->action = ''; $this->action = '';
// endpoint mangling // endpoint mangling
if(ereg("^http://",$path)) if(preg_match('/'."^http:\\/\\/".'/',$path))
{ {
$path = str_replace('http://','',$path); $path = str_replace('http://','',$path);
$this->path = strstr($path,'/'); $this->path = strstr($path,'/');
$this->debug("path = $this->path"); $this->debug("path = $this->path");
if(ereg(':',$path)) if(preg_match('/:/',$path))
{ {
$this->server = substr($path,0,strpos($path,':')); $this->server = substr($path,0,strpos($path,':'));
$this->port = substr(strstr($path,':'),1); $this->port = substr(strstr($path,':'),1);

View File

@ -134,15 +134,15 @@
$this->parent = $pos; $this->parent = $pos;
// set status // set status
if(ereg(":Envelope$",$name)) if(preg_match('/'.":Envelope$".'/',$name))
{ {
$this->status = 'envelope'; $this->status = 'envelope';
} }
elseif(ereg(":Header$",$name)) elseif(preg_match('/'.":Header$".'/',$name))
{ {
$this->status = 'header'; $this->status = 'header';
} }
elseif(ereg(":Body$",$name)) elseif(preg_match('/'.":Body$".'/',$name))
{ {
$this->status = 'body'; $this->status = 'body';
// set method // set method
@ -150,7 +150,7 @@
elseif($this->status == 'body') elseif($this->status == 'body')
{ {
$this->status = 'method'; $this->status = 'method';
if(ereg(':',$name)) if(preg_match('/:/',$name))
{ {
$this->root_struct_name = substr(strrchr($name,':'),1); $this->root_struct_name = substr(strrchr($name,':'),1);
} }
@ -169,7 +169,7 @@
// set attrs // set attrs
$this->message[$pos]['attrs'] = $attrs; $this->message[$pos]['attrs'] = $attrs;
// get namespace // get namespace
if(ereg(":",$name)) if(preg_match('/'.":".'/',$name))
{ {
$namespace = substr($name,0,strpos($name,':')); $namespace = substr($name,0,strpos($name,':'));
$this->message[$pos]['namespace'] = $namespace; $this->message[$pos]['namespace'] = $namespace;
@ -185,7 +185,7 @@
/* foreach($attrs as $key => $value) */ /* foreach($attrs as $key => $value) */
{ {
// if ns declarations, add to class level array of valid namespaces // 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; $namespaces[substr(strrchr($key,':'),1)] = $value;
if($name == $this->root_struct_name) if($name == $this->root_struct_name)
@ -280,11 +280,11 @@
{ {
$this->status = 'body'; $this->status = 'body';
} }
elseif(ereg(':Body',$name)) elseif(preg_match('/:Body/',$name))
{ {
$this->status = 'header'; $this->status = 'header';
} }
elseif(ereg(':Header',$name)) elseif(preg_match('/:Header/',$name))
{ {
$this->status = 'envelope'; $this->status = 'envelope';
} }

View File

@ -81,13 +81,13 @@
if($headers_array["SOAPAction"]) if($headers_array["SOAPAction"])
{ {
$action = str_replace('"','',$headers_array["SOAPAction"]); $action = str_replace('"','',$headers_array["SOAPAction"]);
if(ereg("^urn:",$action)) if(preg_match('/'."^urn:".'/',$action))
{ {
$this->service = substr($action,4); $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"); $this->debug("got service: $this->service");
} }
@ -105,7 +105,7 @@
$this->debug("method name: $this->methodname"); $this->debug("method name: $this->methodname");
// does method exist? // does method exist?
$test = ereg_replace("\.",'_',$this->methodname); $test = preg_replace('/'."\.".'/','_',$this->methodname);
if(function_exists($test)) if(function_exists($test))
{ {
$method = $this->methodname = $test; $method = $this->methodname = $test;
@ -115,7 +115,7 @@
{ {
/* egroupware customization - createobject based on methodname */ /* egroupware customization - createobject based on methodname */
list($app,$class,$method) = explode('.',$this->methodname); list($app,$class,$method) = explode('.',$this->methodname);
if(ereg("^service",$app)) if(preg_match('/'."^service".'/',$app))
{ {
$args = $class; $args = $class;
$class = 'service'; $class = 'service';

View File

@ -111,12 +111,12 @@
$this->debug("Entering parseResponse()"); $this->debug("Entering parseResponse()");
//$this->debug(" w/ data $data"); //$this->debug(" w/ data $data");
// strip headers here // strip headers here
//$clean_data = ereg_replace("\r\n","\n", $data); //$clean_data = preg_replace('/'."\r\n".'/',"\n", $data);
if(ereg("^.*\r\n\r\n<",$data)) if(preg_match('/'."^.*\r\n\r\n<".'/',$data))
{ {
$this->debug("found proper seperation of headers and document"); $this->debug("found proper seperation of headers and document");
$this->debug("getting rid of headers, stringlen: ".strlen($data)); $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)); $this->debug("cleaned data, stringlen: ".strlen($clean_data));
} }
else else
@ -134,7 +134,7 @@
} }
/* /*
// if response is a proper http response, and is not a 200 // 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 // get error data
$errstr = substr($clean_data, 0, strpos($clean_data, "\n")-1); $errstr = substr($clean_data, 0, strpos($clean_data, "\n")-1);

View File

@ -94,7 +94,7 @@
} }
// get type prefix // get type prefix
if(ereg(":",$type)) if(preg_match('/'.":".'/',$type))
{ {
$this->type = substr(strrchr($type,':'),1,strlen(strrchr($type,':'))); $this->type = substr(strrchr($type,':'),1,strlen(strrchr($type,':')));
$this->type_prefix = substr($type,0,strpos($type,':')); $this->type_prefix = substr($type,0,strpos($type,':'));
@ -198,7 +198,7 @@
$type = 'array'; $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; $type = $k;
} }

View File

@ -50,7 +50,7 @@
/* strips all whitespace from a string */ /* strips all whitespace from a string */
function strip_space($text) function strip_space($text)
{ {
return ereg_replace("( |\n|\t|\r)+", '', $text); return preg_replace('/'."( |\n|\t|\r)+".'/', '', $text);
} }
function is_allnumbers($text) function is_allnumbers($text)
@ -196,7 +196,7 @@
foreach($segs as $seg) foreach($segs as $seg)
{ {
//echo "Checking $seg<br>"; //echo "Checking $seg<br>";
if(eregi("[a-z0-9\-]{0,62}",$seg)) if(preg_match('/'."[a-z0-9\-]{0,62}".'/i',$seg))
{ {
$return = True; $return = True;
} }

View File

@ -123,7 +123,7 @@
$fp = fopen($filename,'r'); $fp = fopen($filename,'r');
while($data = fgets($fp,8000)) while($data = fgets($fp,8000))
{ {
list($name,$value,$extra) = split(':', $data); list($name,$value,$extra) = explode(':', $data);
if(substr($value,0,5) == 'http') if(substr($value,0,5) == 'http')
{ {
$value = $value . ':'.$extra; $value = $value . ':'.$extra;
@ -216,12 +216,12 @@
settype($buffer,'array'); settype($buffer,'array');
foreach($buffer as $name => $value) foreach($buffer as $name => $value)
{ {
$field = split(';',$name); $field = explode(';',$name);
$field[0] = ereg_replace("A\.",'',$field[0]); $field[0] = preg_replace('/'."A\.".'/','',$field[0]);
$field[0] = ereg_replace("B\.",'',$field[0]); $field[0] = preg_replace('/'."B\.".'/','',$field[0]);
$field[0] = ereg_replace("C\.",'',$field[0]); $field[0] = preg_replace('/'."C\.".'/','',$field[0]);
$field[0] = ereg_replace("D\.",'',$field[0]); $field[0] = preg_replace('/'."D\.".'/','',$field[0]);
$values = split(';',$value); $values = explode(';',$value);
if($field[1]) if($field[1])
{ {
//echo $field[0]; //echo $field[0];
@ -594,7 +594,7 @@
} }
else else
{ {
$tmp = split('-',$values[0]); $tmp = explode('-',$values[0]);
if($tmp[0]) if($tmp[0])
{ {
$entry['bday'] = $tmp[1] . '/' . $tmp[2] . '/' . $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_one_type'] = substr($buffer['adr_one_type'],0,-1);
$entry['adr_two_type'] = substr($buffer['adr_two_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['adr_one_street'] = $street[0]; // RB 2001/05/08 added for Lotus Organizer to split multiline adresses
$entry['address2'] = $street[1]; $entry['address2'] = $street[1];
@ -650,7 +650,7 @@
} }
elseif($value == 'BDAY') 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($tmp[0])
{ {
if(strlen($tmp[0]) == 1) { $tmp[0] = '0'.$tmp[0]; } if(strlen($tmp[0]) == 1) { $tmp[0] = '0'.$tmp[0]; }

View File

@ -205,7 +205,7 @@
break; break;
} }
// get element prefix // get element prefix
if(ereg(":",$name)) if(preg_match('/'.":".'/',$name))
{ {
$prefix = substr($name,0,strpos($name,':')); $prefix = substr($name,0,strpos($name,':'));
} }

View File

@ -494,7 +494,7 @@ class XML
function remove_node ( $node ) function remove_node ( $node )
{ {
// Check whether the node is an attribute 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. // Get the path to the attribute node's parent.
$parent = $this->prestr($node, "/attribute::"); $parent = $this->prestr($node, "/attribute::");
@ -612,7 +612,7 @@ class XML
function add_content ( $path, $value ) function add_content ( $path, $value )
{ {
// Check whether it's an attribute node. // 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. // Get the path to the attribute node's parent.
$parent = $this->prestr($path, "/attribute::"); $parent = $this->prestr($path, "/attribute::");
@ -649,7 +649,7 @@ class XML
function set_content ( $path, $value ) function set_content ( $path, $value )
{ {
// Check whether it's an attribute node. // 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. // Get the path to the attribute node's parent.
$parent = $this->prestr($path, "/attribute::"); $parent = $this->prestr($path, "/attribute::");
@ -688,7 +688,7 @@ class XML
function get_content ( $path ) function get_content ( $path )
{ {
// Check whether it's an attribute node. // 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. // Get the path to the attribute node's parent.
$parent = $this->prestr($path, "/attribute::"); $parent = $this->prestr($path, "/attribute::");
@ -1053,7 +1053,7 @@ class XML
); );
// Check whether there are predicates. // Check whether there are predicates.
if ( ereg("\[", $step) ) if ( preg_match('/'."\[".'/', $step) )
{ {
// Get the predicates. // Get the predicates.
$predicates = substr($step, strpos($step, "[")); $predicates = substr($step, strpos($step, "["));
@ -1099,7 +1099,7 @@ class XML
$axis["axis"] = "child"; $axis["axis"] = "child";
$axis["node-test"] = "*"; $axis["node-test"] = "*";
} }
elseif ( ereg("\(", $step) ) elseif ( preg_match('/'."\(".'/', $step) )
{ {
// Check whether it's a function. // Check whether it's a function.
if ( $this->is_function($this->prestr($step, "(")) ) if ( $this->is_function($this->prestr($step, "(")) )
@ -1130,13 +1130,13 @@ class XML
$axis["node-test"] = $step; $axis["node-test"] = $step;
} }
} }
elseif ( eregi("^@", $step) ) elseif ( preg_match('/'."^@".'/i', $step) )
{ {
// Use the attribute axis and select the attribute. // Use the attribute axis and select the attribute.
$axis["axis"] = "attribute"; $axis["axis"] = "attribute";
$axis["node-test"] = substr($step, 1); $axis["node-test"] = substr($step, 1);
} }
elseif ( eregi("\]$", $step) ) elseif ( preg_match('/'."\]$".'/i', $step) )
{ {
// Use the child axis and select a position. // Use the child axis and select a position.
$axis["axis"] = "child"; $axis["axis"] = "child";
@ -1154,7 +1154,7 @@ class XML
$axis["axis"] = "parent"; $axis["axis"] = "parent";
$axis["node-test"] = "*"; $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. // Select the child axis and the child.
$axis["axis"] = "child"; $axis["axis"] = "child";
@ -1496,7 +1496,7 @@ class XML
foreach ( $this->functions as $function ) foreach ( $this->functions as $function )
{ {
// Check whether there's a - sign in the function name. // 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. // Get the position of the - in the function name.
$sign = strpos($function, "-"); $sign = strpos($function, "-");
@ -1615,7 +1615,7 @@ class XML
} }
// Check whether the predicate is a function. // Check whether the predicate is a function.
if ( ereg("\(", $predicate) ) if ( preg_match('/'."\(".'/', $predicate) )
{ {
// Get the position of the first bracket. // Get the position of the first bracket.
$start = strpos($predicate, "("); $start = strpos($predicate, "(");
@ -1664,8 +1664,8 @@ class XML
} }
// Check whether the predicate is just a digit. // Check whether the predicate is just a digit.
if ( ereg("^[0-9]+(\.[0-9]+)?$", $predicate) || if ( preg_match('/'."^[0-9]+(\.[0-9]+)?$".'/', $predicate) ||
ereg("^\.[0-9]+$", $predicate) ) preg_match('/'."^\.[0-9]+$".'/', $predicate) )
{ {
// Return the value of the digit. // Return the value of the digit.
return doubleval($predicate); return doubleval($predicate);
@ -1718,7 +1718,7 @@ class XML
foreach ( $predicates as $predicate ) foreach ( $predicates as $predicate )
{ {
// Check whether the predicate is just an number. // Check whether the predicate is just an number.
if ( ereg("^[0-9]+$", $predicate) ) if ( preg_match('/'."^[0-9]+$".'/', $predicate) )
{ {
// Enhance the predicate. // Enhance the predicate.
$predicate .= "=position()"; $predicate .= "=position()";
@ -1786,7 +1786,7 @@ class XML
function check_node_test ( $context, $node_test ) function check_node_test ( $context, $node_test )
{ {
// Check whether it's a function. // Check whether it's a function.
if ( ereg("\(", $node_test) ) if ( preg_match('/'."\(".'/', $node_test) )
{ {
// Get the type of function to use. // Get the type of function to use.
$function = $this->prestr($node_test, "("); $function = $this->prestr($node_test, "(");
@ -1862,7 +1862,7 @@ class XML
// Add this node to the node-set. // Add this node to the node-set.
return true; 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. // Check whether the node-test can be fulfilled.
if ( $this->nodes[$context]["name"] == $node_test ) if ( $this->nodes[$context]["name"] == $node_test )
@ -2592,8 +2592,8 @@ class XML
function handle_function_string ( $node, $arguments ) function handle_function_string ( $node, $arguments )
{ {
// Check what type of parameter is given // Check what type of parameter is given
if ( ereg("^[0-9]+(\.[0-9]+)?$", $arguments) || if ( preg_match('/'."^[0-9]+(\.[0-9]+)?$".'/', $arguments) ||
ereg("^\.[0-9]+$", $arguments) ) preg_match('/'."^\.[0-9]+$".'/', $arguments) )
{ {
// Convert the digits to a number. // Convert the digits to a number.
$number = doubleval($arguments); $number = doubleval($arguments);
@ -2701,7 +2701,7 @@ class XML
$second = $this->evaluate_predicate($node, $second); $second = $this->evaluate_predicate($node, $second);
// Check whether the first string starts with the second one. // Check whether the first string starts with the second one.
if ( ereg("^".$second, $first) ) if ( preg_match('/'."^".$second.'/', $first) )
{ {
// Return true. // Return true.
return true; return true;
@ -2935,8 +2935,8 @@ class XML
$arguments = trim($arguments); $arguments = trim($arguments);
// Check what type of parameter is given // Check what type of parameter is given
if ( ereg("^[0-9]+(\.[0-9]+)?$", $arguments) || if ( preg_match('/'."^[0-9]+(\.[0-9]+)?$".'/', $arguments) ||
ereg("^\.[0-9]+$", $arguments) ) preg_match('/'."^\.[0-9]+$".'/', $arguments) )
{ {
// Convert the digits to a number. // Convert the digits to a number.
$number = doubleval($arguments); $number = doubleval($arguments);
@ -3128,8 +3128,8 @@ class XML
function handle_function_number ( $node, $arguments ) function handle_function_number ( $node, $arguments )
{ {
// Check the type of argument. // Check the type of argument.
if ( ereg("^[0-9]+(\.[0-9]+)?$", $arguments) || if ( preg_match('/'."^[0-9]+(\.[0-9]+)?$".'/', $arguments) ||
ereg("^\.[0-9]+$", $arguments) ) preg_match('/'."^\.[0-9]+$".'/', $arguments) )
{ {
// Return the argument as a number. // Return the argument as a number.
return doubleval($arguments); return doubleval($arguments);
@ -3367,7 +3367,7 @@ class XML
} }
// Replace the last separator. // Replace the last separator.
$command = eregi_replace(", $", ");", $command); $command = preg_replace('/'.", $".'/i', ");", $command);
// Execute the command. // Execute the command.
eval($command); eval($command);

View File

@ -211,7 +211,7 @@
} }
elseif(is_string($msg)) elseif(is_string($msg))
{ {
$n =& new xmlrpcmsg(''); $n = new xmlrpcmsg('');
$n->payload = $msg; $n->payload = $msg;
$msg = $n; $msg = $n;
} }
@ -668,17 +668,17 @@
$calls = array(); $calls = array();
foreach($msgs as $msg) foreach($msgs as $msg)
{ {
$call['methodName'] =& new xmlrpcval($msg->method(),'string'); $call['methodName'] = new xmlrpcval($msg->method(),'string');
$numParams = $msg->getNumParams(); $numParams = $msg->getNumParams();
$params = array(); $params = array();
for($i = 0; $i < $numParams; $i++) for($i = 0; $i < $numParams; $i++)
{ {
$params[$i] = $msg->getParam($i); $params[$i] = $msg->getParam($i);
} }
$call['params'] =& new xmlrpcval($params, 'array'); $call['params'] = new xmlrpcval($params, 'array');
$calls[] =& new xmlrpcval($call, 'struct'); $calls[] = new xmlrpcval($call, 'struct');
} }
$multicall =& new xmlrpcmsg('system.multicall'); $multicall = new xmlrpcmsg('system.multicall');
$multicall->addParam(new xmlrpcval($calls, 'array')); $multicall->addParam(new xmlrpcval($calls, 'array'));
// Attempt RPC call // Attempt RPC call
@ -717,7 +717,7 @@
return false; // Bad value return false; // Bad value
} }
// Normal return value // Normal return value
$response[$i] =& new xmlrpcresp($val->arraymem(0)); $response[$i] = new xmlrpcresp($val->arraymem(0));
break; break;
case 'struct': case 'struct':
$code = $val->structmem('faultCode'); $code = $val->structmem('faultCode');
@ -730,7 +730,7 @@
{ {
return false; return false;
} }
$response[$i] =& new xmlrpcresp(0, $code->scalarval(), $str->scalarval()); $response[$i] = new xmlrpcresp(0, $code->scalarval(), $str->scalarval());
break; break;
default: default:
return false; return false;

View File

@ -52,12 +52,12 @@
{ {
$arr = array(); $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 // $isodate is simple ISO8601, remove the difference between split and ereg
array_shift($arr); 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 // $isodate is extended ISO8601, do nothing
} }

View File

@ -161,7 +161,7 @@
$syscall = 0; $syscall = 0;
/* Setup dispatch map based on the function, if this is a system call */ /* 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) foreach($GLOBALS['_xmlrpcs_dmap'] as $meth => $dat)
{ {
@ -170,8 +170,8 @@
$sysCall = 1; $sysCall = 1;
$dmap = $this->dmap; $dmap = $this->dmap;
} }
elseif(ereg('^examples\.',$methName) || elseif(preg_match('/^examples\./',$methName) ||
ereg('^validator1\.',$methName) || preg_match('/^validator1\./',$methName) ||
ereg('^interopEchoTests\.', $methName) ereg('^interopEchoTests\.', $methName)
) )
{ {

Some files were not shown because too many files have changed in this diff Show More