encoded xml like & are not decoded. The attached patch fixes this:
-Lance
Logged In: YES user_id=907773
Lance,
Did you attach the patch? I could use it if you have it.
Greg gheberle@pilabs.com
Logged In: YES user_id=955980
Try this.
==== XmlRpcUtil.cpp#2 (ktext) - XmlRpcUtil.cpp#3 (ktext) ==== content @@ -205,9 +205,49 @@ iAmp += xmlEntLen[iEntity]+1; break; } - - if (xmlEntity[iEntity] == 0) // unrecognized sequence - decoded += encoded[iAmp++]; + + // unrecognized sequence + if (xmlEntity[iEntity] == 0) { + if (encoded[iAmp+1] == '#') { + int offset = 2; + int value = 0; + bool valid = true; + bool got_semi = false; + while ((iAmp + offset < iSize) && + (valid) && (!got_semi)) { + int c = encoded [iAmp+offset]; + + if (isdigit(c)) { + value = (value * 10) + + c - '0'; + if (value > 0x110000) { + valid = false; + break; + } + } else if (c == ';') { + got_semi = true; + } else { + valid = false; + break; + } + + offset++; + } + if (!valid) { + decoded += encoded [iAmp++]; + } else { + if (got_semi) { + decoded += value; + iAmp += offset; + } else { + decoded += + encoded[iAmp++]; + } + } + } else { + decoded += encoded[iAmp++]; + } + } } else { decoded += encoded[iAmp++]; }
patch file
Eww. That was oddly formatted. I'm trying an attachmrnt again.
Log in to post a comment.
Logged In: YES
user_id=907773
Lance,
Did you attach the patch? I could use it if you have it.
Greg
gheberle@pilabs.com
Logged In: YES
user_id=955980
Try this.
-Lance
==== XmlRpcUtil.cpp#2 (ktext) - XmlRpcUtil.cpp#3 (ktext)
==== content
@@ -205,9 +205,49 @@
iAmp += xmlEntLen[iEntity]+1;
break;
}
-
- if (xmlEntity[iEntity] == 0) // unrecognized
sequence
- decoded += encoded[iAmp++];
+
+ // unrecognized sequence
+ if (xmlEntity[iEntity] == 0) {
+ if (encoded[iAmp+1] == '#') {
+ int offset = 2;
+ int value = 0;
+ bool valid = true;
+ bool got_semi = false;
+ while ((iAmp + offset < iSize) &&
+ (valid) && (!got_semi)) {
+ int c = encoded
[iAmp+offset];
+
+ if (isdigit(c)) {
+ value = (value * 10) +
+ c - '0';
+ if (value > 0x110000)
{
+ valid = false;
+ break;
+ }
+ } else if (c == ';') {
+ got_semi = true;
+ } else {
+ valid = false;
+ break;
+ }
+
+ offset++;
+ }
+ if (!valid) {
+ decoded += encoded
[iAmp++];
+ } else {
+ if (got_semi) {
+ decoded += value;
+ iAmp += offset;
+ } else {
+ decoded +=
+ encoded[iAmp++];
+ }
+ }
+ } else {
+ decoded += encoded[iAmp++];
+ }
+ }
} else {
decoded += encoded[iAmp++];
}
patch file
Logged In: YES
user_id=955980
Eww. That was oddly formatted. I'm trying an attachmrnt
again.