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


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();
$gdclient = Zend_Gdata_AuthSub::getHttpClient('FakeToken', $client);


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


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.


Looks good to me.

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

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

Merged to release-1.11 in r24061