[phpxmlrpc] Re: BUGFIX: Something to do with $_xh[$parser]['ac']

Edd Dumbill edd at usefulinc.com
Mon Jan 20 12:44:23 GMT 2003


I understand this is fixed in CVS.  I've copied your mail to the
phpxmlrpc mailing list where I request you post further questions.

Thanks

Edd.

On Sat, 2003-01-18 at 19:39, Charlie Dyson wrote:
> I don't understand this bug (because I don't know the code), however
> there is a problem in xmlrpc.inc, v 1.1.1.1.2.3 2001/11/29 in which the
> following line does not work:
> $_xh[$parser]['ac'].=str_replace('$', '\$',
> -		str_replace('"', '\"', str_replace(chr(92),
> -			$xmlrpc_backslash, $data)));
> 
> This is because your code assumes that $_xh[$parser]['ac'] is set, which
> is not always the case. Your version of PHP may allow you to get away
> with it, but mine doesn't! Here's the patch:
> --- xmlrpc.inc	2002-12-27 17:48:08.000000000 +0000
> +++ xmlrpc.inc.NEW	2002-12-27 17:49:21.000000000 +0000
> @@ -330,9 +330,14 @@
>  		}
>  	// replace characters that eval would
>  	// do special things with
> -	$_xh[$parser]['ac'].=str_replace('$', '\$',
> -		str_replace('"', '\"', str_replace(chr(92),
> -			$xmlrpc_backslash, $data)));
> +		// EXPERIMENTAL FIX:
> +		if(array_key_exists('ac', $_xh[$parser])) {
> +			$_xh[$parser]['ac'].=str_replace('$', '\$',
> +				str_replace('"', '\"', str_replace(chr(92),
> +					$xmlrpc_backslash, $data)));
> +		} else {
> +			$_xh[$parser]['ac'] = '';
> +		}
>  	}
>  }
>  
> Sorry if you've fixed it already. I think this patch should apply
> correctly, but haven't had time to check.
> 
> By the way, is there anything you can tell me about authentication and
> sessions with PHP/xmlrpc? I'd like to use cookies or something like I do
> with normal web access to my project, but if I can't do that, should I
> just create a session with a random string which the client will send to
> every function call? Advice much appreciated.
> 
> Thanks,
> 
> Charlie Dyson <charlie at charliedyson.net>
> 
> __________________________________________________
> Do You Yahoo!?
> Everything you'll ever need on one web page
> from News and Sport to Email and Music Charts
> http://uk.my.yahoo.com

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : /pipermail/attachments/20030120/fb878fda/attachment.bin


More information about the phpxmlrpc mailing list