From 55b2d4e37deeb31b9e227d923652a657fc80ee4c Mon Sep 17 00:00:00 2001 From: Tim Preston Date: Fri, 7 May 2010 11:18:41 +0800 Subject: fixed Parse::match() returning different types and cleaned call-by-ref warnings Auth/OpenID/Parse.php The match() function takes a reference parameter $match and, depending on execution flow, either returns that as an array or a string. This has been modified to now return an array in both cases. Auth/OpenID/Consumer.php Auth/Yadis/Manager.php Fixed two function calls with explicit call-by-reference parameters. --- Auth/OpenID/Consumer.php | 2 +- Auth/OpenID/Parse.php | 6 +++--- Auth/Yadis/Manager.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Auth/OpenID/Consumer.php b/Auth/OpenID/Consumer.php index 021c038..5e628d1 100644 --- a/Auth/OpenID/Consumer.php +++ b/Auth/OpenID/Consumer.php @@ -1181,7 +1181,7 @@ class Auth_OpenID_GenericConsumer { // oidutil.log('Performing discovery on %s' % (claimed_id,)) list($unused, $services) = call_user_func($this->discoverMethod, $claimed_id, - &$this->fetcher); + $this->fetcher); if (!$services) { return new Auth_OpenID_FailureResponse(null, diff --git a/Auth/OpenID/Parse.php b/Auth/OpenID/Parse.php index 6c2e721..c81cb01 100644 --- a/Auth/OpenID/Parse.php +++ b/Auth/OpenID/Parse.php @@ -227,7 +227,7 @@ class Auth_OpenID_Parse { if (!mb_ereg_search($regexp)) { return false; } - list($match) = mb_ereg_search_getregs(); + $match = mb_ereg_search_getregs(); return true; } @@ -269,7 +269,7 @@ class Auth_OpenID_Parse { // Try to find the tag. $head_re = $this->headFind(); - $head_match = ''; + $head_match = array(); if (!$this->match($head_re, $stripped, $head_match)) { ini_set( 'pcre.backtrack_limit', $old_btlimit ); return array(); @@ -278,7 +278,7 @@ class Auth_OpenID_Parse { $link_data = array(); $link_matches = array(); - if (!preg_match_all($this->_link_find, $head_match, + if (!preg_match_all($this->_link_find, $head_match[0], $link_matches)) { ini_set( 'pcre.backtrack_limit', $old_btlimit ); return array(); diff --git a/Auth/Yadis/Manager.php b/Auth/Yadis/Manager.php index ee6f68b..5829de6 100644 --- a/Auth/Yadis/Manager.php +++ b/Auth/Yadis/Manager.php @@ -413,7 +413,7 @@ class Auth_Yadis_Discovery { list($yadis_url, $services) = call_user_func($discover_cb, $this->url, - &$fetcher); + $fetcher); $manager = $this->createManager($services, $yadis_url); } -- cgit v1.1