This allows using newlines and quotes in error messages. Signed-off-by: Francois Gouget <fgouget(a)codeweavers.com> --- testbot/lib/WineTestBot/CGI/PageBase.pm | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/testbot/lib/WineTestBot/CGI/PageBase.pm b/testbot/lib/WineTestBot/CGI/PageBase.pm index 121e09aabd..5f61466908 100644 --- a/testbot/lib/WineTestBot/CGI/PageBase.pm +++ b/testbot/lib/WineTestBot/CGI/PageBase.pm @@ -360,8 +360,10 @@ sub GenerateErrorPopup($$) { print "<script type='text/javascript'>\n"; print "<!--\n"; - $ErrMessage =~ s/'/\\'/g; - print "function ShowError() { alert('", $ErrMessage, "'); }\n"; + $ErrMessage =~ s~\\~\\\\~g; + $ErrMessage =~ s~"~\\\"~g; + $ErrMessage =~ s~\n~\\n~g; + print "function ShowError() { alert(\"$ErrMessage\"); }\n"; my $ErrField = $Page->GetErrField(); if ($ErrField) { -- 2.30.2