[MediaWiki-commits] [Gerrit] Work around Bugzilla XML RPC bug with special Unicode charac... - change (wikimedia...modifications)

2014-08-28 Thread Dzahn (Code Review)
Dzahn has submitted this change and it was merged.

Change subject: Work around Bugzilla XML RPC bug with special Unicode characters
..


Work around Bugzilla XML RPC bug with special Unicode characters

When exporting Bugzilla tickets via Chase's script we run into an API bug with
specific Unicode letters for
https://bugzilla.wikimedia.org/show_bug.cgi?id=9444#c0.
This is applying a hackish upstream workaround described in
https://bugzilla.mozilla.org/show_bug.cgi?id=839023#c10 which is slightly
overkill (applied to the entire output, not just the values provided back when
querying the API). However, that Unicode character range affected by this patch
should not be in use in any relevant way, plus this change affects only XML RPC
behavior (while e.g. Bingle uses JSON RPC, hence not affected).

This file is a copy of the upstream file which has not seen changes since
February 2014 (hence same as in the 4.4.5 tarball code which we have deployed),
with the custom hack being two lines added (search for "69747").

As expressed, not feeling very happy about its scope and cannot 100% judge
potential side effects (but I miss better Perl skills).

Bug: 69747
Change-Id: I960b2c80308213f324968eb44890782488abd4d5
---
M Bugzilla/WebService/Server/XMLRPC.pm
1 file changed, 5 insertions(+), 0 deletions(-)

Approvals:
  Dzahn: Verified; Looks good to me, approved



diff --git a/Bugzilla/WebService/Server/XMLRPC.pm 
b/Bugzilla/WebService/Server/XMLRPC.pm
index 03590bd..d1a4b25 100644
--- a/Bugzilla/WebService/Server/XMLRPC.pm
+++ b/Bugzilla/WebService/Server/XMLRPC.pm
@@ -273,6 +273,11 @@
 }
 }
 }
+# BEGIN workaround for https://bugzilla.wikimedia.org/show_bug.cgi?id=69747
+if (ref $initial eq '') {
+$initial =~ s/([\x01-\x08\x0b\x0c\x0f-\x1f])/sprintf "\\x%02x", 
ord($1)/ge;
+}
+# END workaround for https://bugzilla.wikimedia.org/show_bug.cgi?id=69747
 return $initial;
 }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/156100
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I960b2c80308213f324968eb44890782488abd4d5
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/bugzilla/modifications
Gerrit-Branch: master
Gerrit-Owner: Aklapper 
Gerrit-Reviewer: Aklapper 
Gerrit-Reviewer: BBlack 
Gerrit-Reviewer: Dzahn 
Gerrit-Reviewer: Jgreen 
Gerrit-Reviewer: Rush 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Work around Bugzilla XML RPC bug with special Unicode charac... - change (wikimedia...modifications)

2014-08-25 Thread Aklapper (Code Review)
Aklapper has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/156100

Change subject: Work around Bugzilla XML RPC bug with special Unicode characters
..

Work around Bugzilla XML RPC bug with special Unicode characters

When exporting Bugzilla tickets via Chase's script we run into an API bug with
specific Unicode letters for
https://bugzilla.wikimedia.org/show_bug.cgi?id=9444#c0.
This is applying a hackish upstream workaround described in
https://bugzilla.mozilla.org/show_bug.cgi?id=839023#c10 which is slightly
overkill (applied to the entire output, not just the values provided back when
querying the API). However, that Unicode character range affected by this patch
should not be in use in any relevant way, plus this change affects only XML RPC
behavior (while e.g. Bingle uses JSON RPC, hence not affected).

This file is a copy of the upstream file which has not seen changes since
February 2014 (hence same as in the 4.4.5 tarball code which we have deployed),
with the custom hack being two lines added (search for "69747").

As expressed, not feeling very happy about its scope and cannot 100% judge
potential side effects (but I miss better Perl skills).

Bug: 69747
Change-Id: I960b2c80308213f324968eb44890782488abd4d5
---
M Bugzilla/WebService/Server/XMLRPC.pm
1 file changed, 5 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/wikimedia/bugzilla/modifications 
refs/changes/00/156100/1

diff --git a/Bugzilla/WebService/Server/XMLRPC.pm 
b/Bugzilla/WebService/Server/XMLRPC.pm
index 03590bd..d1a4b25 100644
--- a/Bugzilla/WebService/Server/XMLRPC.pm
+++ b/Bugzilla/WebService/Server/XMLRPC.pm
@@ -273,6 +273,11 @@
 }
 }
 }
+# BEGIN workaround for https://bugzilla.wikimedia.org/show_bug.cgi?id=69747
+if (ref $initial eq '') {
+$initial =~ s/([\x01-\x08\x0b\x0c\x0f-\x1f])/sprintf "\\x%02x", 
ord($1)/ge;
+}
+# END workaround for https://bugzilla.wikimedia.org/show_bug.cgi?id=69747
 return $initial;
 }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/156100
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I960b2c80308213f324968eb44890782488abd4d5
Gerrit-PatchSet: 1
Gerrit-Project: wikimedia/bugzilla/modifications
Gerrit-Branch: master
Gerrit-Owner: Aklapper 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits