Menu

#1 Some minor fixes to offer

open
nobody
None
5
2008-02-28
2008-02-28
No

I offer a few bug-fixes for xmlrpc_lib.js. Most of these are simple spelling mistakes.

I offer also an improvement to function base64_decode(), so that it ignores white-space and other extraneous characters in base64-encoded strings. White-space is supposed to be allowed. I'm not sure why xml-rpc servers would be sending other extraneous characters, but this fix takes care of those also.

Line 330:
< // first the native xmlhtprequest and then an activeX dom object, we might get
---
> // first the native XMLHttpRequest and then an activeX dom object, we might get

Line 621:
< results = array();
---
> results = [];

Lin 905:
< this.me[this.me.lenght] = new xmlrpcval(val, type);
---
> this.me[this.me.length] = new xmlrpcval(val, type);

Line 1307:
< * @param {string} cahrset_encoding The charset to be used for serialization. If null, US-ASCII is assumed
---
> * @param {string} charset_encoding The charset to be used for serialization. If null, US-ASCII is assumed

Line 1356
< * Returns the responde body (string) minus http headers, or an xmlrpcresp obj on error
---
> * Returns the response body (string) minus http headers, or an xmlrpcresp obj on error

Line 1490:
< if (_xh['headers'][header_name] !== undef)
---
> if (_xh['headers'][header_name] !== undefined)

Line 1719:
< throw 'No ASV paseXML';
---
> throw 'No ASV parseXML';

Line 1788
< {//just in case parse xml didn't throw an Exception but returned nothing usefull.
---
> {//just in case parse xml didn't throw an Exception but returned nothing useful.

Line 2078:
< for(var key in xmlrpcval.me)
---
> for(var key in xmlrpc_val.me)

Line 2088:
< arr[arr.lenght] = xmlrpc_decode(xmlrpc_val.getParam(i));
---
> arr[arr.length] = xmlrpc_decode(xmlrpc_val.getParam(i));

Line 2220 (to ignore white-space in base64-encoded strings):
< function base64_decode (aString) {
---
> function base64_decode (xString) {
> var aString = xString.replace(/[^A-Za-z0-9\+\/\=]/g, "") //added by geoff: eliminate white-space (which is legal) and other extraneous characters.

Line 2718:
< * Debug helper. Should do the same as the PHP htmlentites function (well, htmlspecialchars rather...)
---
> * Debug helper. Should do the same as the PHP htmlentities function (well, htmlspecialchars rather...)

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.