summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Util.pm
diff options
context:
space:
mode:
authorDave Lawrence <dlawrence@mozilla.com>2013-08-29 23:30:51 +0200
committerDave Lawrence <dlawrence@mozilla.com>2013-08-29 23:30:51 +0200
commit81a7d9fc6edf3bc8ffd4a0333fa1774aa36c4e0e (patch)
treeda525a060c0d33c6e7cf0837d9976b4ce547baee /Bugzilla/Util.pm
parent99589d82d943bedcd9a8ade3d91f84d770fcd5c5 (diff)
downloadbugzilla-81a7d9fc6edf3bc8ffd4a0333fa1774aa36c4e0e.tar.gz
bugzilla-81a7d9fc6edf3bc8ffd4a0333fa1774aa36c4e0e.tar.xz
Bug 909360 - backport upstream bug 898830 to bmo/4.2 for performance improvement in show_bug.cgi
Diffstat (limited to 'Bugzilla/Util.pm')
-rw-r--r--Bugzilla/Util.pm8
1 files changed, 6 insertions, 2 deletions
diff --git a/Bugzilla/Util.pm b/Bugzilla/Util.pm
index e12882215..96dad8327 100644
--- a/Bugzilla/Util.pm
+++ b/Bugzilla/Util.pm
@@ -28,6 +28,7 @@
package Bugzilla::Util;
+use 5.10.1;
use strict;
use base qw(Exporter);
@@ -93,7 +94,10 @@ sub html_quote {
$var =~ s/"/&quot;/g;
# Obscure '@'.
$var =~ s/\@/\&#64;/g;
- if (Bugzilla->params->{'utf8'}) {
+
+ state $use_utf8 = Bugzilla->params->{'utf8'};
+
+ if ($use_utf8) {
# Remove the following characters because they're
# influencing BiDi:
# --------------------------------------------------------
@@ -115,7 +119,7 @@ sub html_quote {
# |U+200e|Left-To-Right Mark |0xe2 0x80 0x8e |
# |U+200f|Right-To-Left Mark |0xe2 0x80 0x8f |
# --------------------------------------------------------
- $var =~ s/[\x{202a}-\x{202e}]//g;
+ $var =~ tr/\x{202a}-\x{202e}//d;
}
return $var;
}