summaryrefslogtreecommitdiffstats
path: root/globals.pl
diff options
context:
space:
mode:
Diffstat (limited to 'globals.pl')
-rw-r--r--globals.pl14
1 files changed, 14 insertions, 0 deletions
diff --git a/globals.pl b/globals.pl
index 31bed4f06..19be37b81 100644
--- a/globals.pl
+++ b/globals.pl
@@ -1561,6 +1561,20 @@ $::template ||= Template->new(
html => \&html_quote ,
+ # HTML collapses newlines in element attributes to a single space,
+ # so form elements which may have whitespace (ie comments) need
+ # to be encoded using 
+ # See bugs 4928, 22983 and 32000 for more details
+ html_linebreak => sub
+ {
+ my ($var) = @_;
+ $var =~ s/\r\n/\
/g;
+ $var =~ s/\n\r/\
/g;
+ $var =~ s/\r/\
/g;
+ $var =~ s/\n/\
/g;
+ return $var;
+ } ,
+
# This subroutine in CGI.pl escapes characters in a variable
# or value string for use in a query string. It escapes all
# characters NOT in the regex set: [a-zA-Z0-9_\-.]. The 'uri'