Commit 415a5d12 authored by jake%acutex.net's avatar jake%acutex.net

Fix for bug 42810 - Bugzilla would choke if your product name contained a ' mark.

Patch by Christian Reis <kiko@async.com.br> r= justdave@syndicomm.com, caillon@returnzero.com
parent 21c2f341
...@@ -409,7 +409,7 @@ sub GenerateCode { ...@@ -409,7 +409,7 @@ sub GenerateCode {
$result = ""; $result = "";
foreach my $k (sort { uc($a) cmp uc($b)} eval("keys $name")) { foreach my $k (sort { uc($a) cmp uc($b)} eval("keys $name")) {
$result .= GenerateCode("\$" . substr($name, 1) . $result .= GenerateCode("\$" . substr($name, 1) .
"{'" . $k . "'}"); "{" . PerlQuote($k) . "}");
} }
return $result; return $result;
} else { } else {
......
...@@ -347,7 +347,7 @@ sub make_js_array { ...@@ -347,7 +347,7 @@ sub make_js_array {
foreach my $p ( @prods ) { foreach my $p ( @prods ) {
# join each element with a "," case-insensitively alpha sorted # join each element with a "," case-insensitively alpha sorted
if ( $data{$p} ) { if ( $data{$p} ) {
$ret .= $arr."['$p'] = ["; $ret .= $arr."[".SqlQuote($p)."] = [";
# the SqlQuote() protects our 's. # the SqlQuote() protects our 's.
my @tmp = map( SqlQuote( $_ ), @{ $data{$p} } ); my @tmp = map( SqlQuote( $_ ), @{ $data{$p} } );
# do the join on a sorted, quoted list # do the join on a sorted, quoted list
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment