- Posts: 6598
- Karma: 162
- Thank you received: 322
InvalidArgumentException
- ABPro Support
- Topic Author
- Offline
- Moderator
-
Less
More
7 years 10 months ago - 7 years 7 months ago #14898
by ABPro Support
InvalidArgumentException was created by ABPro Support
## Fix below has been updated as of June 14/13
The June 30 releases of ABPro have the fix included ##
In Joomla 2.5.10 and 3.1.1 a new URI check was added that throws the exception 'InvalidArgumentException' and 'Invalid URI detected', if a URI has certain characters in it.
The main problem with their new 'fix' is that it throws an exception if it sees an apostrophe in the data passed with a URL.
If, for example, your customer enters a name with an apostrophe like O'Reilly, the validation call will trigger an exception in Joomla and die.
An apostrophe in a URL is not illegal. The JavaScript functions to encode a URI (encodeURIComponent and encodeURI) do not touch apostrophes so the only way to make the data acceptable to Joomla is to manually replace apostrophes.
The symptom can be an error reported or simply a block of the booking screen submit. Also Chrome and IE browsers are effected more that FF.
My initial examination of the issue seems to be that only the validation call prior to doing a submit is a problem.
A work around for that is to edit file:
\components\com_rsappt_pro2\script.js (for ABPro 2.x under Joomla 2.5.1x)
or
\components\com_rsappt_pro3\script.js (for ABPro 3.x under Joomla 3.1.x)
Around line 766 (ABPro 2) or 762 (ABPro 3)
Look for:
Add red code:
if(document.getElementById("recaptcha_challenge_field")!=null){
data = data + "&recap_chal=" + document.getElementById("recaptcha_challenge_field").value;
data = data + "&recap_resp=" + document.getElementById("recaptcha_response_field").value;
}
data = data + "&browser=" + BrowserDetect.browser;
data = data.replace(/'/g, "’"); // <-- updated June 14
As this is a change to the client side JavaScript code, after you have uploaded the fix, you will need to refresh your browser to bring the new code in.
Current release if ABPro now contains the above fix.
## UPDATE ##
The Joomla 2.5.11/3.1.1 change causes problems for the mobile app as it sends lots of data as JSON objects which are delimited with ' so Joomla is blocking all the legitimate calls.
Updated versions of the mobile apps are now available to work under the new Joomla changes.
## UPDATE 2 May 30/13 ##
One customer found that having <strong> </strong> in a UDF to make it bold also caused the 'Invalid URI detected' error.
I have been unable to reproduce this but if you put the above fix in and still encounter 'Invalid URI detected', try un-publishing all UDFS then add them back one at a time until you find the one causing the error.
The June 30 releases of ABPro have the fix included ##
In Joomla 2.5.10 and 3.1.1 a new URI check was added that throws the exception 'InvalidArgumentException' and 'Invalid URI detected', if a URI has certain characters in it.
The main problem with their new 'fix' is that it throws an exception if it sees an apostrophe in the data passed with a URL.
If, for example, your customer enters a name with an apostrophe like O'Reilly, the validation call will trigger an exception in Joomla and die.
An apostrophe in a URL is not illegal. The JavaScript functions to encode a URI (encodeURIComponent and encodeURI) do not touch apostrophes so the only way to make the data acceptable to Joomla is to manually replace apostrophes.
The symptom can be an error reported or simply a block of the booking screen submit. Also Chrome and IE browsers are effected more that FF.
My initial examination of the issue seems to be that only the validation call prior to doing a submit is a problem.
A work around for that is to edit file:
\components\com_rsappt_pro2\script.js (for ABPro 2.x under Joomla 2.5.1x)
or
\components\com_rsappt_pro3\script.js (for ABPro 3.x under Joomla 3.1.x)
Around line 766 (ABPro 2) or 762 (ABPro 3)
Look for:
if(document.getElementById("recaptcha_challenge_field")!=null){
data = data + "&recap_chal=" + document.getElementById("recaptcha_challenge_field").value;
data = data + "&recap_resp=" + document.getElementById("recaptcha_response_field").value;
}
data = data + "&browser=" + BrowserDetect.browser;
Add red code:
if(document.getElementById("recaptcha_challenge_field")!=null){
data = data + "&recap_chal=" + document.getElementById("recaptcha_challenge_field").value;
data = data + "&recap_resp=" + document.getElementById("recaptcha_response_field").value;
}
data = data + "&browser=" + BrowserDetect.browser;
data = data.replace(/'/g, "’"); // <-- updated June 14
As this is a change to the client side JavaScript code, after you have uploaded the fix, you will need to refresh your browser to bring the new code in.
Current release if ABPro now contains the above fix.
## UPDATE ##
The Joomla 2.5.11/3.1.1 change causes problems for the mobile app as it sends lots of data as JSON objects which are delimited with ' so Joomla is blocking all the legitimate calls.
Updated versions of the mobile apps are now available to work under the new Joomla changes.
## UPDATE 2 May 30/13 ##
One customer found that having <strong> </strong> in a UDF to make it bold also caused the 'Invalid URI detected' error.
I have been unable to reproduce this but if you put the above fix in and still encounter 'Invalid URI detected', try un-publishing all UDFS then add them back one at a time until you find the one causing the error.
Last edit: 7 years 7 months ago by ABPro Support.
The following user(s) said Thank You: Frank Westerhout
Please Log in to join the conversation.
Time to create page: 0.075 seconds