Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: oldheating gps motorhome heating
Revision 140:8951a8b45289, committed 2020-06-03
- Comitter:
- andrewboyson
- Date:
- Wed Jun 03 10:47:51 2020 +0000
- Parent:
- 139:e189c6669983
- Child:
- 141:1dac268a197d
- Commit message:
- Changed home brewed query encode function to use encodeURIComponent instead.
Changed in this revision
| common/web-ajax-class.inc | Show annotated file Show diff for this revision Revisions of this file |
| common/web-ajax-class.js | Show annotated file Show diff for this revision Revisions of this file |
--- a/common/web-ajax-class.inc Tue Jun 02 16:45:29 2020 +0000
+++ b/common/web-ajax-class.inc Wed Jun 03 10:47:51 2020 +0000
@@ -91,12 +91,7 @@
" {\n"
" if (value)\n"
" {\n"
-" value = value.split('%').join('%25'); //Encode '%'s first\n"
-" value = value.split('+').join('%2B');\n"
-" value = value.split('=').join('%3D');\n"
-" value = value.split('?').join('%3F');\n"
-" value = value.split('#').join('%23');\n"
-" ajaxXhr_.open('GET', ajaxServer_ + '?' + name + '=' + value, true);\n"
+" ajaxXhr_.open('GET', ajaxServer_ + '?' + name + '=' + encodeURIComponent(value), true);\n"
" }\n"
" else\n"
" {\n"
--- a/common/web-ajax-class.js Tue Jun 02 16:45:29 2020 +0000
+++ b/common/web-ajax-class.js Wed Jun 03 10:47:51 2020 +0000
@@ -91,12 +91,7 @@
{
if (value)
{
- value = value.split('%').join('%25'); //Encode '%'s first
- value = value.split('+').join('%2B');
- value = value.split('=').join('%3D');
- value = value.split('?').join('%3F');
- value = value.split('#').join('%23');
- ajaxXhr_.open('GET', ajaxServer_ + '?' + name + '=' + value, true);
+ ajaxXhr_.open('GET', ajaxServer_ + '?' + name + '=' + encodeURIComponent(value), true);
}
else
{