Re: [SOAP] PATCH: Options Bug in Client.php (was Possible Bug in Transport.php?)
| From: | (Jonathan Schilling) | Date: | Mon, 23 Jun 2003 19:04:00 +0000 |
| Subject: | Re: [SOAP] PATCH: Options Bug in Client.php (was Possible Bug in Transport.php?) | ||
| Groups: | php.soap | ||
| Request: | Send a blank email to php-soap+get-725@lists.php.net to get a copy of this message | ||
> From shane@caraveo.com Sat May 24 14:33:24 2003
>
> David Busby wrote:
> > I'm glad my sloppy code has discovered (and led to the fix) of bugs.
> > If it's any help I patched by doing this:
> >
> > Client.php from this (starts on Line 309 for version .7.3):
>
> Are you sure this is from .7.3? What's the version on line 20 (should
> show 1.58) .7.2 had this code, but I changed it in .7.3 to:
>
> function setOpt($category, $option, $value=NULL)
> {
> if ($value) {
> if (!isset($this->__options[$category]))
> $this->__options[$category] = array();
> $this->__options[$category][$option] = $value;
> } else {
> $this->__options[$category] = $option;
> }
> }
Shane,
Your 0.7.3 code fails for the case where the value being passed
in is 0, such as
$soapclient->setOpt('curl', CURLOPT_VERBOSE, 0);
The "if ($value)" test fails and you go into the else clause that
is supposed to handle whole array arguments ... which doesn't
work in this case.
I think what you want is to change the test
if ($value) {
to
if (!is_null($value)) {
Then the value-is-0 case is handled correctly.
Jonathan Schilling