Skip to content

Commit

Permalink
improved xml_escape performance significantly when no escaping is nec…
Browse files Browse the repository at this point in the history
…essary
  • Loading branch information
kraih committed Jan 30, 2014
1 parent 42a9b69 commit 9514fb5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Changes
@@ -1,5 +1,7 @@

4.73 2014-01-30
- Improved xml_escape performance significantly when no escaping is
necessary.

4.72 2014-01-29
- Added accepts, template_for and template_handler methods to
Expand Down
1 change: 1 addition & 0 deletions lib/Mojo/Util.pm
Expand Up @@ -326,6 +326,7 @@ sub url_unescape {
sub xml_escape {
my $str = shift;

return $str unless $str =~ /[&<>"']/;
$str =~ s/&/&amp;/g;
$str =~ s/</&lt;/g;
$str =~ s/>/&gt;/g;
Expand Down

0 comments on commit 9514fb5

Please sign in to comment.