From fa91bc71323057b20acc399d021361c63453455b Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Mon, 28 Oct 2013 19:03:09 +0100 Subject: [PATCH] Some getStaticProperty calls to PEAR globalized --- lib/imchannel.php | 4 +++- lib/util.php | 4 +++- plugins/OpenID/actions/openidtrust.php | 4 +++- plugins/OpenID/openid.php | 4 +++- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/lib/imchannel.php b/lib/imchannel.php index 61355a429c..2a4e51af92 100644 --- a/lib/imchannel.php +++ b/lib/imchannel.php @@ -68,6 +68,8 @@ class IMChannel extends Channel function setNotify($user, $notify) { + global $_PEAR; + $user_im_prefs = new User_im_prefs(); $user_im_prefs->transport = $this->imPlugin->transport; $user_im_prefs->user_id = $user->id; @@ -81,7 +83,7 @@ class IMChannel extends Channel $result = $user_im_prefs->update($original); if (!$result) { - $last_error = &PEAR::getStaticProperty('DB_DataObject','lastError'); + $last_error = &$_PEAR->getStaticProperty('DB_DataObject','lastError'); common_log(LOG_ERR, 'Could not set notify flag to ' . $notify . ' for user ' . common_log_objstring($user) . diff --git a/lib/util.php b/lib/util.php index 5f6f032958..d690d953c0 100644 --- a/lib/util.php +++ b/lib/util.php @@ -1678,8 +1678,10 @@ function common_debug($msg, $filename=null) function common_log_db_error(&$object, $verb, $filename=null) { + global $_PEAR; + $objstr = common_log_objstring($object); - $last_error = &PEAR::getStaticProperty('DB_DataObject','lastError'); + $last_error = &$_PEAR->getStaticProperty('DB_DataObject','lastError'); if (is_object($last_error)) { $msg = $last_error->message; } else { diff --git a/plugins/OpenID/actions/openidtrust.php b/plugins/OpenID/actions/openidtrust.php index 4ea1c86ef3..8f046429a0 100644 --- a/plugins/OpenID/actions/openidtrust.php +++ b/plugins/OpenID/actions/openidtrust.php @@ -85,6 +85,8 @@ class OpenidtrustAction extends Action function handleSubmit() { + global $_PEAR; + unset($_SESSION['openid_trust_root']); unset($_SESSION['openid_allow_url']); unset($_SESSION['openid_deny_url']); @@ -96,7 +98,7 @@ class OpenidtrustAction extends Action $user_openid_trustroot->trustroot = $this->trust_root; $user_openid_trustroot->created = common_sql_now(); if (!$user_openid_trustroot->insert()) { - $err = PEAR::getStaticProperty('DB_DataObject','lastError'); + $err = &$_PEAR->getStaticProperty('DB_DataObject','lastError'); } common_redirect($this->allowUrl, $code=302); }else{ diff --git a/plugins/OpenID/openid.php b/plugins/OpenID/openid.php index 12c0ae7f31..91a34bd6e3 100644 --- a/plugins/OpenID/openid.php +++ b/plugins/OpenID/openid.php @@ -85,6 +85,8 @@ function oid_get_last() function oid_link_user($id, $canonical, $display) { + global $_PEAR; + $oid = new User_openid(); $oid->user_id = $id; $oid->canonical = $canonical; @@ -92,7 +94,7 @@ function oid_link_user($id, $canonical, $display) $oid->created = common_sql_now(); if (!$oid->insert()) { - $err = PEAR::getStaticProperty('DB_DataObject','lastError'); + $err = &$_PEAR->getStaticProperty('DB_DataObject','lastError'); return false; } -- 2.39.5