Issues

ZF-11351: Zend_Gdata_AuthSub falsely allows setting vanilla instance of Zend_Http_Client

Issue Type: Bug Created: 2011-05-08T02:33:37.000+0000 Last Updated: 2011-05-28T17:25:28.000+0000 Status: Resolved Fix version(s): - 1.11.7 (02/Jun/11)

Reporter: Adam Lundrigan (adamlundrigan) Assignee: Adam Lundrigan (adamlundrigan) Tags: - Zend_Gdata

Related issues: Attachments: - ZF-11351.patch

Description

Zend_Gdata_AuthSub::getHttpClient allows passing of vanilla Zend_Http_Client instance, but then attempts to call setAuthSubToken() method on it, resulting in unhandled fatal error.

Reproduce (Zend_Gdata_AuthSubTest.php):

<pre class="highlight">
$client = new Zend_Http_Client();
$client->setUri('<a href="http://example.com/AuthSub">http://example.com/AuthSub</a>');
$gdclient = Zend_Gdata_AuthSub::getHttpClient('FakeToken', $client);

Result:

<pre class="highlight">
PHP Fatal error:  Call to undefined method Zend_Http_Client::setAuthSubToken() in /usr/local/apache2/htdocs/lib/zfdev/trunk/library/Zend/Gdata/AuthSub.php on line 242

Comments

Posted by Adam Lundrigan (adamlundrigan) on 2011-05-08T02:45:24.000+0000

Attached patch with possible fix. This avenue does technically break backwards-compatibility as you can no longer pass vanilla Zend_Http_Client instances into Zend_Gdata_AuthSub, however doing so before raised a fatal error in PHP, so IMHO I don't think that BC break is an issue.

Comments?

Posted by Trevor Johns (tjohns) on 2011-05-11T02:04:31.000+0000

Looks good to me.

You have a commit bit, correct? Let me know if you need any further assistance with this.

Posted by Adam Lundrigan (adamlundrigan) on 2011-05-11T02:31:46.000+0000

Excellent. I've commited it to the trunk (r24033)

Posted by Adam Lundrigan (adamlundrigan) on 2011-05-28T17:25:13.000+0000

Merged to release-1.11 in r24061

Have you found an issue?

See the Overview section for more details.

Copyright

© 2006-2016 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.

Contacts