From 1a013db76335dc18f2b756bd5aca57401d384026 Mon Sep 17 00:00:00 2001 From: x2003bruneau Date: Wed, 11 Oct 2006 08:33:16 +0000 Subject: [PATCH] Fix many php warnings and notices git-svn-id: svn+ssh://murphy/home/svn/platal/trunk@964 839d8a87-29fc-0310-9880-83ba4fa771e5 --- include/globals.inc.php.in | 4 +++- include/profil/verif_adresses.inc.php | 2 +- include/search.inc.php | 2 +- include/synchro_ax.inc.php | 2 +- include/wiki.inc.php | 2 +- include/xorg/session.inc.php | 2 +- modules/admin.php | 2 -- modules/banana/banana.inc.php | 12 ++++++------ modules/events.php | 4 ++-- modules/payment/money.inc.php | 2 -- 10 files changed, 16 insertions(+), 18 deletions(-) diff --git a/include/globals.inc.php.in b/include/globals.inc.php.in index b3fc66f..8673f7e 100644 --- a/include/globals.inc.php.in +++ b/include/globals.inc.php.in @@ -38,6 +38,7 @@ class PlatalGlobals var $spoolroot; var $locale; + var $timezone; function PlatalGlobals($sess) { @@ -62,7 +63,7 @@ class PlatalGlobals foreach ($array as $cat => $conf) { $c = strtolower($cat); foreach ($conf as $k => $v) { - if ($c == 'core' && isset($this->$k)) { + if ($c == 'core' && property_exists($this, $k)) { $this->$k=$v; } else { if (!isset($this->$c)) { @@ -92,6 +93,7 @@ class PlatalGlobals setlocale(LC_MESSAGES, $this->locale); setlocale(LC_TIME, $this->locale); setlocale(LC_CTYPE, $this->locale); + date_default_timezone_set($this->timezone); } function asso($key=null) diff --git a/include/profil/verif_adresses.inc.php b/include/profil/verif_adresses.inc.php index 05d1208..ddb2494 100644 --- a/include/profil/verif_adresses.inc.php +++ b/include/profil/verif_adresses.inc.php @@ -76,7 +76,7 @@ function replace_ifset_tel($varname, $i, $t){ function get_adr_arg($varname, $i) { $tab = Env::v($varname, Array()); - return $tab[$i]; + return @$tab[$i]; } function set_flag_adr($varname,$i){ diff --git a/include/search.inc.php b/include/search.inc.php index 97bc11e..c3601a2 100644 --- a/include/search.inc.php +++ b/include/search.inc.php @@ -137,7 +137,7 @@ class XOrgSearch extends XOrgPlugin global $page; $offset = intval($this->get_value('offset')); - $tab = $this->orders[$this->get_value('order')]; + $tab = @$this->orders[$this->get_value('order')]; if (!$tab || !$tab[3]) { $tab = $this->orders[$this->order_defaut]; } diff --git a/include/synchro_ax.inc.php b/include/synchro_ax.inc.php index 0428dd8..d0be548 100644 --- a/include/synchro_ax.inc.php +++ b/include/synchro_ax.inc.php @@ -26,7 +26,7 @@ require_once('user.func.inc.php'); function is_ax_key_missing() { global $globals; - return !$globals->webservice->private_key_ax || !is_file($globals->webservice->private_key_ax); + return !isset($globals->webservice->private_key_ax) || !is_file($globals->webservice->private_key_ax); } function get_user_ax($matricule_ax, $raw=false) diff --git a/include/wiki.inc.php b/include/wiki.inc.php index 7e28f60..cd506e6 100644 --- a/include/wiki.inc.php +++ b/include/wiki.inc.php @@ -56,7 +56,7 @@ function wiki_get_perms($n) $file = wiki_work_dir().'/'.str_replace('/', '.', $n); $lines = explode("\n", @file_get_contents($file)); foreach ($lines as $line) { - list($k, $v) = explode('=', $line, 2); + @list($k, $v) = explode('=', $line, 2); if ($k == 'platal_perms') { return explode(':', $v); } diff --git a/include/xorg/session.inc.php b/include/xorg/session.inc.php index 45905b5..593b957 100644 --- a/include/xorg/session.inc.php +++ b/include/xorg/session.inc.php @@ -83,7 +83,7 @@ class XorgSession INNER JOIN aliases AS a ON ( a.id=u.user_id AND type!='homonyme' ) WHERE a.$field = {?} AND u.perms IN('admin','user')", $login); - $logger =& S::v('log'); + $logger = S::v('log'); if (list($uid, $password) = $res->fetchOneRow()) { require_once('secure_hash.inc.php'); $expected_response = hash_encrypt("$uname:$password:".S::v('challenge')); diff --git a/modules/admin.php b/modules/admin.php index f867d95..2850910 100644 --- a/modules/admin.php +++ b/modules/admin.php @@ -512,8 +512,6 @@ class AdminModule extends PLModule FROM aliases WHERE id = {?} AND type!='homonyme' ORDER BY type!= 'a_vie'", $mr["user_id"])); - $page->assign('xorgmails', $xorgmails); - $page->assign('email_panne', $email_panne); $page->assign('emails',$redirect->emails); $page->assign('mr',$mr); diff --git a/modules/banana/banana.inc.php b/modules/banana/banana.inc.php index af6a063..0ee449a 100644 --- a/modules/banana/banana.inc.php +++ b/modules/banana/banana.inc.php @@ -59,7 +59,7 @@ function hook_browsingAction() function hook_makeLink($params) { global $globals; $base = $globals->baseurl . '/banana'; - if ($params['subscribe'] == 1) { + if (@$params['subscribe'] == 1) { return $base . '/subscription'; } if (isset($params['xface'])) { @@ -75,9 +75,9 @@ function hook_makeLink($params) { return $base . '/from/' . $params['first']; } if (isset($params['artid'])) { - if ($params['action'] == 'new') { + if (@$params['action'] == 'new') { $base .= '/reply'; - } elseif ($params['action'] == 'cancel') { + } elseif (@$params['action'] == 'cancel') { $base .= '/cancel'; } else { $base .= '/read'; @@ -85,7 +85,7 @@ function hook_makeLink($params) { return $base . '/' . $params['artid']; } - if ($params['action'] == 'new') { + if (@$params['action'] == 'new') { return $base . '/new'; } return $base; @@ -171,7 +171,7 @@ class PlatalBanana extends Banana parent::Banana(); } - function run($params = null) + static function run($params = null) { global $banana; @@ -184,7 +184,7 @@ class PlatalBanana extends Banana $time, S::v('uid')); $_SESSION['banana_last'] = $time; } - return Banana::run('PlatalBanana', $params); + return Banana::run_banana('PlatalBanana', $params); } function action_saveSubs() diff --git a/modules/events.php b/modules/events.php index a070b57..e6fe25f 100644 --- a/modules/events.php +++ b/modules/events.php @@ -220,7 +220,7 @@ class EventsModule extends PLModule } $page->assign('nls', get_nl_state()); - $page->assign_by_ref('nl_list', get_nl_list()); + $page->assign('nl_list', get_nl_list()); } function handler_nl_show(&$page, $nid = 'last') @@ -359,7 +359,7 @@ class EventsModule extends PLModule pl_redirect("admin/newsletter"); } - $page->assign_by_ref('nl_list', get_nl_slist()); + $page->assign('nl_list', get_nl_slist()); } function handler_admin_nl_edit(&$page, $nid = 'last', $aid = null, $action = 'edit') { diff --git a/modules/payment/money.inc.php b/modules/payment/money.inc.php index 7e2db82..94e71ff 100644 --- a/modules/payment/money.inc.php +++ b/modules/payment/money.inc.php @@ -50,8 +50,6 @@ class Payment $this->montant_min = (float)$this->montant_min; $this->montant_max = (float)$this->montant_max; $this->flags = new Flagset($flags); - - return $link; } // }}} -- 2.1.4