summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Util.pm
diff options
context:
space:
mode:
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/"/"/g;
# Obscure '@'.
$var =~ s/\@/\@/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;
}