ZF-11351: Zend_Gdata_AuthSub falsely allows setting vanilla instance of Zend_Http_Client
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):
$client = new Zend_Http_Client();
$client->setUri('http://example.com/AuthSub');
$gdclient = Zend_Gdata_AuthSub::getHttpClient('FakeToken', $client);
Result:
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