Skip to content

Instantly share code, notes, and snippets.

/xss.diff Secret

Created February 9, 2016 16:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/65b86b7461bc31113ea5 to your computer and use it in GitHub Desktop.
Save anonymous/65b86b7461bc31113ea5 to your computer and use it in GitHub Desktop.
diff --git a/lib/Mojo/Util.pm b/lib/Mojo/Util.pm
index 3519705..47ba19d 100644
--- a/lib/Mojo/Util.pm
+++ b/lib/Mojo/Util.pm
@@ -325,6 +325,7 @@ sub url_unescape {
sub xml_escape {
my $str = shift;
+ return $str if ref $_[0] && ref $_[0] eq 'Mojo::ByteStream';
$str =~ s/([&<>"'])/$XML{$1}/ge;
return $str;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment