Topic: 2 (possible) fixes

Hi,

I've found a line of code that gave me a php notice (or warning, I dont remember).
In xajax.inc.php at like ~910 you do the following

// Add the path and the query string
$sURL.= $aURL['path'].@$aURL['query'];

This is afaik not a good way to concat 2 values, the @ is incorrect afaik.

I would suggest changing this to

// Add the path and the query string
$sURL .= $aURL['path'];
if (isset($aURL['query'])) $sURL .= $aURL['query'];

Then there is something totally different. For a project i've worked on I needed to know if a request was from javascript (xajax/ajax) or from a normal form and I'm not going to first parse the post thru xajax and then come to the conclusion its not xajax, thats not nice.

prototype.js adds a nice header (X-Requested-With), but xajax does nothing of this sort.
When reading thru the code I got the impression there would be (or should be, setDefault etc) a function somewhere to add a custom header, but it seems I could not find it.

I suggest an addition to xajax_core.js if thats possible

The following code, xajax_core.js

xajax.config.setDefault('commonHeaders', {
    'If-Modified-Since': 'Sat, 1 Jan 2000 00:00:00 GMT'
    });

should be something like

xajax.config.setDefault('commonHeaders', {
    'If-Modified-Since': 'Sat, 1 Jan 2000 00:00:00 GMT',
    'X-Requested-With': 'XMLHttpRequest'
    });

prototype.js also adds a version number etc, but thats up to you. You could perhaps add some xajax signature in it wink


I hope you find this useful and change/add it to your next release smile