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

View File

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

View File

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

View File

@ -35,7 +35,7 @@ class addressbook_merge // extends bo_merge
*/
function __construct()
{
$this->contacts =& new addressbook_bo();
$this->contacts = new addressbook_bo();
}
/**
@ -131,7 +131,7 @@ class addressbook_merge // extends bo_merge
function calendar_replacements($id,$last_event_too=false)
{
require_once(EGW_INCLUDE_ROOT.'/calendar/inc/class.calendar_boupdate.inc.php');
$calendar =& new calendar_boupdate();
$calendar = new calendar_boupdate();
// next events
$events = $calendar->search(array(

View File

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

View File

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

View File

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

View File

@ -421,7 +421,7 @@ class addressbook_ui extends addressbook_bo
$query['filter2'] = (int)$list;
$this->action($email_type,array(),true,$success,$failed,$action_msg,$query,$msg);
$response =& new xajaxResponse();
$response = new xajaxResponse();
if ($success) $response->addScript($GLOBALS['egw']->js->body['onLoad']);
@ -1497,7 +1497,7 @@ class addressbook_ui extends addressbook_bo
'n_suffix' => $n_suffix,
'org_name' => $org_name,
);
$response =& new xajaxResponse();
$response = new xajaxResponse();
$response->addScript("setOptions('".addslashes(implode("\b",$this->fileas_options($names)))."');");
return $response->getXML();
@ -2003,7 +2003,7 @@ $readonlys['button[vcard]'] = true;
return lang("Document '%1' does not exist or is not readable for you!",$document);
}
require_once(EGW_INCLUDE_ROOT.'/addressbook/inc/class.addressbook_merge.inc.php');
$document_merge =& new addressbook_merge();
$document_merge = new addressbook_merge();
return $document_merge->download($document,$ids);
}

View File

@ -64,7 +64,7 @@ class addressbook_vcal extends addressbook_bo
{
require_once(EGW_SERVER_ROOT.'/phpgwapi/inc/horde/Horde/iCalendar/vcard.php');
$vCard =& new Horde_iCalendar_vcard;
$vCard = new Horde_iCalendar_vcard;
if(!is_array($this->supportedFields)) {
$this->setSupportedFields();

View File

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

View File

@ -487,7 +487,7 @@ abstract class admin_cmd
* @param mixed $value
* @return mixed
*/
protected function __set($property,$value)
function __set($property,$value)
{
$this->data[$property] = $value;
}
@ -497,7 +497,7 @@ abstract class admin_cmd
*
* @param string $property
*/
protected function __unset($property)
function __unset($property)
{
unset($this->data[$property]);
}
@ -795,7 +795,7 @@ abstract class admin_cmd
return admin_cmd::run_queued_jobs();
}
include_once(EGW_API_INC.'/class.asyncservice.inc.php');
$async =& new asyncservice();
$async = new asyncservice();
// we cant use this class as callback, as it's abstract and ExecMethod used by the async service instanciated the class!
list($app) = explode('_',$class=$next['type']);

View File

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

View File

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

View File

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

View File

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

View File

@ -108,7 +108,7 @@
}
}
/* don't erase passwords, since we also don't print them */
elseif(!ereg('passwd',$key) && !ereg('password',$key) && !ereg('root_pw',$key))
elseif(strpos($key,'passwd') === false && strpos($key,'password') === false && strpos($key,'root_pw') === false)
{
unset($c->config_data[$key]);
}
@ -181,7 +181,7 @@
case 'value':
$newval = str_replace(' ','_',$newval);
/* Don't show passwords in the form */
if(ereg('passwd',$value) || ereg('password',$value) || ereg('root_pw',$value))
if(strpos($value,'passwd') !== false || strpos($value,'password') !== false || strpos($value,'root_pw') !== false)
{
$t->set_var($value,'');
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -583,7 +583,7 @@ ORDER BY cal_user_type, cal_usre_id
if ($set_recurrences)
{
// delete all, but the lowest dates record
$min = (int) $this->db->select($this->dates_table,'MIN(cal_start)',array('cal_id'=>$cal_id),__LINE__,__FILE__,false,'','calendar')->fetchSingle();
$min = (int) $this->db->select($this->dates_table,'MIN(cal_start)',array('cal_id'=>$cal_id),__LINE__,__FILE__,false,'','calendar')->fetchColumn();
$this->db->delete($this->dates_table,array(
'cal_id' => $cal_id,
@ -657,7 +657,7 @@ ORDER BY cal_user_type, cal_usre_id
}
if (is_null($etag))
{
$etag = $this->db->select($this->cal_table,'cal_etag',array('cal_id' => $cal_id),__LINE__,__FILE__,false,'','calendar')->fetchSingle();
$etag = $this->db->select($this->cal_table,'cal_etag',array('cal_id' => $cal_id),__LINE__,__FILE__,false,'','calendar')->fetchColumn();
}
return $cal_id;
}

View File

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

View File

@ -192,7 +192,7 @@ class soholiday
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)
{

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -330,7 +330,7 @@ class db_tools
$new_version[$minor] = sprintf('%03d',1+$new_version[$minor]);
$content['new_version'] = implode('.',$new_version);
$tmpl =& new etemplate('etemplate.db-tools.ask_save');
$tmpl = new etemplate('etemplate.db-tools.ask_save');
if (!file_exists(EGW_SERVER_ROOT."/$posted_app/setup/tables_current.inc.php"))
{
@ -516,7 +516,7 @@ class db_tools
$opts = array();
foreach(explode(',',$col['options']) as $opt)
{
list($db,$opt) = split('[(:)]',$opt);
list($db,$opt) = preg_split('/[(:)]/',$opt);
$opts[$db] = is_numeric($opt) ? intval($opt) : $opt;
}
$table[$prop][] = array(

View File

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

View File

@ -309,7 +309,7 @@ class etemplate extends boetemplate
echo '<div id="popupMainDiv">'."\n";
if ($GLOBALS['egw_info']['user']['apps']['manual']) // adding a manual icon to every popup
{
$manual =& new etemplate('etemplate.popup.manual');
$manual = new etemplate('etemplate.popup.manual');
echo $manual->show(array());
unset($manual);
echo '<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';
if (is_array($cell['obj']))
{
$obj =& new etemplate();
$obj = new etemplate();
$obj->init($cell['obj']);
$cell['obj'] =& $obj;
unset($obj);
@ -1344,12 +1344,12 @@ class etemplate extends boetemplate
$obj_read = is_object($cell['obj']) ? 'obj from content' : 'obj read, obj-name from content';
if (!is_object($cell['obj']))
{
$cell['obj'] =& new etemplate($cell['obj'],$this->as_array());
$cell['obj'] = new etemplate($cell['obj'],$this->as_array());
}
}
else
{ $obj_read = 'obj read';
$cell['obj'] =& new etemplate($name,$this->as_array());
$cell['obj'] = new etemplate($name,$this->as_array());
}
}
if (is_int($this->debug) && $this->debug >= 3 || $this->debug == $cell['type'])

View File

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

View File

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

View File

@ -363,7 +363,7 @@ class nextmatch_widget
}
if (!is_object($value['template']))
{
$value['template'] =& new etemplate($value['template'],$tmpl->as_array());
$value['template'] = new etemplate($value['template'],$tmpl->as_array());
}
if (is_array($value['rows'][0])) // pad 0 based arrays with rows-1 false values
{
@ -386,7 +386,7 @@ class nextmatch_widget
{ // disable whole nextmatch line if no scrolling necessary
if ($value['header_left'] || $value['header_right'])
{
$nextmatch =& new etemplate('etemplate.nextmatch_widget.header_only');
$nextmatch = new etemplate('etemplate.nextmatch_widget.header_only');
$cell['size'] = $cell['name'];
$cell['obj'] = &$nextmatch;
$cell['name'] = $nextmatch->name;
@ -400,7 +400,7 @@ class nextmatch_widget
}
else
{
$nextmatch =& new etemplate('etemplate.nextmatch_widget');
$nextmatch = new etemplate('etemplate.nextmatch_widget');
$nextmatch->read('etemplate.nextmatch_widget');
// keep the editor away from the generated tmpls
$nextmatch->no_onclick = true;
@ -1129,7 +1129,7 @@ class nextmatch_widget
if ($app)
{
include_once(EGW_API_INC.'/class.config.inc.php');
$config =& new config($app);
$config = new config($app);
$config->read_repository();
$customfields = isset($config->config_data['customfields']) ? $config->config_data['customfields'] : $config->config_data['custom_fields'];

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

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

View File

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

View File

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

View File

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

View File

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

View File

@ -284,7 +284,7 @@ class infolog_so
preg_match('/(upcoming|today|overdue|date|enddate)([-\\/.0-9]*)/',$filter,$vars);
$filter = $vars[1];
if (isset($vars[2]) && !empty($vars[2]) && ($date = split('[-/.]',$vars[2])))
if (isset($vars[2]) && !empty($vars[2]) && ($date = preg_split('/[-\\/.]/',$vars[2])))
{
$today = mktime(-$this->tz_offset,0,0,intval($date[1]),intval($date[2]),intval($date[0]));
$tomorrow = mktime(-$this->tz_offset,0,0,intval($date[1]),intval($date[2])+1,intval($date[0]));

View File

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

View File

@ -60,7 +60,7 @@ class infolog_widget
function infolog_widget($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)
{
if(ereg('phpgw_',$name))
if(strpos($name,'phpgw_') !== false)
{
$extra_vars .= '&' . $name . '=' . urlencode($value);
}

View File

@ -390,7 +390,7 @@ class ADODB_DataDict {
if ($flds) {
list($lines,$pkey) = $this->_GenFields($flds);
list(,$first) = each($lines);
list(,$column_def) = split("[\t ]+",$first,2);
list(,$column_def) = preg_split("/[\t ]+/",$first,2);
}
return array(sprintf($this->renameColumn,$tabname,$this->NameQuote($oldcolumn),$this->NameQuote($newcolumn),$column_def));
}

View File

@ -113,7 +113,7 @@ class DB
{
include_once(ADODB_DIR."/drivers/adodb-$type.inc.php");
$obj = &NewADOConnection($type);
if (!is_object($obj)) $obj =& new PEAR_Error('Unknown Database Driver: '.$dsninfo['phptype'],-1);
if (!is_object($obj)) $obj = new PEAR_Error('Unknown Database Driver: '.$dsninfo['phptype'],-1);
return $obj;
}
@ -159,7 +159,7 @@ class DB
@$obj =& NewADOConnection($type);
if (!is_object($obj)) {
$obj =& new PEAR_Error('Unknown Database Driver: '.$dsninfo['phptype'],-1);
$obj = new PEAR_Error('Unknown Database Driver: '.$dsninfo['phptype'],-1);
return $obj;
}
if (is_array($options)) {

View File

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

View File

@ -656,7 +656,7 @@ function adodb_get_gmt_diff()
static $TZ;
if (isset($TZ)) return $TZ;
$TZ = mktime(0,0,0,1,2,1970,0) - gmmktime(0,0,0,1,2,1970,0);
$TZ = mktime(0,0,0,1,2,1970) - gmmktime(0,0,0,1,2,1970);
return $TZ;
}
@ -1284,4 +1284,4 @@ global $ADODB_DATE_LOCALE;
}
?>
?>

View File

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

View File

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

View File

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

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;
$rs =& new ADORecordSet_odbc($qid);
$rs = new ADORecordSet_odbc($qid);
$ADODB_FETCH_MODE = $savem;
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';
$db = adodb_addslashes($db);
if ($str) {
$host = split(":", $str);
$host = explode(":", $str);
if ($host[0]) $str = "host=".adodb_addslashes($host[0]);
else $str = 'host=localhost';
if (isset($host[1])) $str .= " port=$host[1]";

View File

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

View File

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

View File

@ -481,7 +481,7 @@ class accounts_sql
*/
function update_lastlogin($account_id, $ip)
{
$previous_login = $this->db->select($this->table,'account_lastlogin',array('account_id'=>abs($account_id)),__LINE__,__FILE__)->fetchSingle();
$previous_login = $this->db->select($this->table,'account_lastlogin',array('account_id'=>abs($account_id)),__LINE__,__FILE__)->fetchColumn();
$this->db->update($this->table,array(
'account_lastloginfrom' => $ip,

View File

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

View File

@ -604,7 +604,7 @@ class asyncservice
while ($line = fgets($crontab,256))
{
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'))
{

View File

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

View File

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

View File

@ -39,30 +39,30 @@
/*
Determine browser and version
*/
if(ereg('MSIE ([0-9].[0-9]{1,2})',$HTTP_USER_AGENT,$log_version))
if(preg_match('/MSIE ([0-9].[0-9]{1,2})/',$HTTP_USER_AGENT,$log_version))
{
$this->BROWSER_VER = $log_version[1];
$this->BROWSER_AGENT = 'IE';
}
elseif(ereg('Opera ([0-9].[0-9]{1,2})',$HTTP_USER_AGENT,$log_version) ||
ereg('Opera/([0-9].[0-9]{1,2})',$HTTP_USER_AGENT,$log_version))
elseif(preg_match('/Opera ([0-9].[0-9]{1,2})/',$HTTP_USER_AGENT,$log_version) ||
preg_match('/Opera\\/([0-9].[0-9]{1,2})/',$HTTP_USER_AGENT,$log_version))
{
$this->BROWSER_VER = $log_version[1];
$this->BROWSER_AGENT = 'OPERA';
}
elseif(eregi('iCab ([0-9].[0-9a-zA-Z]{1,4})',$HTTP_USER_AGENT,$log_version) ||
eregi('iCab/([0-9].[0-9a-zA-Z]{1,4})',$HTTP_USER_AGENT,$log_version))
elseif(preg_match('/iCab ([0-9].[0-9a-zA-Z]{1,4})/i',$HTTP_USER_AGENT,$log_version) ||
preg_match('/iCab\\/([0-9].[0-9a-zA-Z]{1,4})/i',$HTTP_USER_AGENT,$log_version))
{
$this->BROWSER_VER = $log_version[1];
$this->BROWSER_AGENT = 'iCab';
}
elseif(ereg('Gecko',$HTTP_USER_AGENT,$log_version))
elseif(strpos($HTTP_USER_AGENT,'Gecko') !== false)
{
$this->BROWSER_VER = $log_version[1];
$this->BROWSER_AGENT = 'MOZILLA';
}
elseif(ereg('Konqueror/([0-9].[0-9].[0-9]{1,2})',$HTTP_USER_AGENT,$log_version) ||
ereg('Konqueror/([0-9].[0-9]{1,2})',$HTTP_USER_AGENT,$log_version))
elseif(preg_match('/Konqueror\\/([0-9].[0-9].[0-9]{1,2})/',$HTTP_USER_AGENT,$log_version) ||
preg_match('/Konqueror\\/([0-9].[0-9]{1,2})/',$HTTP_USER_AGENT,$log_version))
{
$this->BROWSER_VER=$log_version[1];
$this->BROWSER_AGENT='Konqueror';

View File

@ -581,7 +581,7 @@ class common
{
while ($file = readdir($dh))
{
if (eregi("\.css$", $file) && $file != 'phpgw.css')
if (preg_match('/'."\.css$".'/i', $file) && $file != 'phpgw.css')
{
$list[] = substr($file,0,strpos($file,'.'));
}
@ -593,7 +593,7 @@ class common
$dh = opendir(EGW_SERVER_ROOT . '/phpgwapi/themes');
while ($file = readdir($dh))
{
if (eregi("\.theme$", $file))
if (preg_match('/'."\.theme$".'/i', $file))
{
$list[] = substr($file,0,strpos($file,'.'));
}
@ -1563,7 +1563,7 @@ class common
return -1;
}
$id = (int) $GLOBALS['egw']->db->select(self::NEXTID_TABLE,'id',array('appname' => $appname),__LINE__,__FILE__)->fetchSingle();
$id = (int) $GLOBALS['egw']->db->select(self::NEXTID_TABLE,'id',array('appname' => $appname),__LINE__,__FILE__)->fetchColumn();
if ($max && $id >= $max)
{
@ -1593,7 +1593,7 @@ class common
return -1;
}
$id = (int)$GLOBALS['egw']->db->select(self::NEXTID_TABLE,'id',array('appname' => $appname),__LINE__,__FILE__)->fetchSingle();
$id = (int)$GLOBALS['egw']->db->select(self::NEXTID_TABLE,'id',array('appname' => $appname),__LINE__,__FILE__)->fetchColumn();
if (!$id || $id < $min)
{

View File

@ -116,7 +116,7 @@ class contenthistory
'sync_contentid' => $_id,
);
if (($ts = $this->db->select(self::TABLE,$col,$where,__LINE__,__FILE__)->fetchSingle()))
if (($ts = $this->db->select(self::TABLE,$col,$where,__LINE__,__FILE__)->fetchColumn()))
{
$ts = $this->db->from_timestamp($ts);
}
@ -155,7 +155,7 @@ class contenthistory
'sync_contentid' => $_id,
);
if (!$this->db->select(self::TABLE,'sync_contentid',$where,__LINE__,__FILE__)->fetchSingle())
if (!$this->db->select(self::TABLE,'sync_contentid',$where,__LINE__,__FILE__)->fetchColumn())
{
$this->db->insert(self::TABLE,$newData,array(),__LINE__,__FILE__);
}

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.:
* try {
* $this->db->connect();
* $num_config = $this->db->select(config::TABLE,'COUNT(config_name)',false,__LINE__,__FILE__)->fetchSingle();
* $num_config = $this->db->select(config::TABLE,'COUNT(config_name)',false,__LINE__,__FILE__)->fetchColumn();
* }
* catch(Exception $e) {
* echo "Connection to DB failed (".$e->getMessage().")!\n";

View File

@ -651,7 +651,7 @@ abstract class egw_framework
{
require_once(EGW_SERVER_ROOT.'/phpgwapi/inc/xajax.inc.php');
$xajax =& new xajax($GLOBALS['egw']->link('/xajax.php'), 'xajax_', $GLOBALS['egw']->translation->charset());
$xajax = new xajax($GLOBALS['egw']->link('/xajax.php'), 'xajax_', $GLOBALS['egw']->translation->charset());
$xajax->waitCursorOff();
$xajax->registerFunction("doXMLHTTP");

View File

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

View File

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

View File

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

View File

@ -459,7 +459,7 @@
}
break;
case 'expires':
if(ereg("^((Mon|Monday|Tue|Tuesday|Wed|Wednesday|Thu|Thursday|Fri|Friday|Sat|Saturday|Sun|Sunday), )?([0-9]{2})\\-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\-([0-9]{2,4}) ([0-9]{2})\\:([0-9]{2})\\:([0-9]{2}) GMT$",$value,$matches))
if(preg_match('/'."^((Mon|Monday|Tue|Tuesday|Wed|Wednesday|Thu|Thursday|Fri|Friday|Sat|Saturday|Sun|Sunday), )?([0-9]{2})\\-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\\-([0-9]{2,4}) ([0-9]{2})\\:([0-9]{2})\\:([0-9]{2}) GMT$".'/',$value,$matches))
{
$year = (int)$matches[5];
if($year<1900)

View File

@ -81,7 +81,7 @@
function interserver($serverid='')
{
$url = eregi_replace('https*://[^/]*/','',$GLOBALS['egw_info']['server']['webserver_url']);
$url = preg_replace('/https*:\\/\\/[^\\/]*\\//i','',$GLOBALS['egw_info']['server']['webserver_url']);
$this->urlparts = array(
'xmlrpc' => $url.'/xmlrpc.php',
'soap' => $url.'/soap.php'

View File

@ -309,7 +309,7 @@
$thyapi_comp = 'thyapi_comp_gecko.js';
}
$GLOBALS['egw_info']['flags']['java_script_globals']['jsapi']['imgDir'] = $GLOBALS['egw_info']['server']['webserver_url'].'/'.'phpgwapi/images';
$GLOBALS['egw_info']['flags']['java_script_globals']['jsapi']['imgDir'] = $GLOBALS['egw_info']['server']['webserver_url'].'/phpgwapi/images';
if (EGW_UNCOMPRESSED_THYAPI)
{
$jsCode = "<!-- JS Global Variables and ThyAPI Insertion -->\n" .

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -94,7 +94,7 @@
}
// get type prefix
if(ereg(":",$type))
if(preg_match('/'.":".'/',$type))
{
$this->type = substr(strrchr($type,':'),1,strlen(strrchr($type,':')));
$this->type_prefix = substr($type,0,strpos($type,':'));
@ -198,7 +198,7 @@
$type = 'array';
}
}
elseif(!ereg("^[0-9]*$",$k) && in_array($k,array_keys($this->soapTypes)))
elseif(!preg_match('/'."^[0-9]*$".'/',$k) && in_array($k,array_keys($this->soapTypes)))
{
$type = $k;
}

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -52,12 +52,12 @@
{
$arr = array();
if (ereg('^([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})$',$isodate,$arr))
if (preg_match('/^([0-9]{4})([0-9]{2})([0-9]{2})T([0-9]{2}):([0-9]{2}):([0-9]{2})$/',$isodate,$arr))
{
// $isodate is simple ISO8601, remove the difference between split and ereg
array_shift($arr);
}
elseif (($arr = split('[-:T]',$isodate)) && count($arr) == 6)
elseif (($arr = preg_split('/[-:T]/',$isodate)) && count($arr) == 6)
{
// $isodate is extended ISO8601, do nothing
}

View File

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

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