Skip to content

Commit

Permalink
replaced expression with block
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed May 8, 2012
1 parent 02034bc commit fd0d86f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Changes
Expand Up @@ -7,11 +7,11 @@ This file documents the revision history for Perl extension Mojolicious.
- Improved built-in web servers to log inactivity timeouts as debug messages
instead of errors.
- Improved documentation.
- Fixed html_escape to always use entities with semicolon. (OlegG, crab)
- Fixed typo in 414 status message.
- Fixed small cookie formatting bug.
- Fixed small bug in cookie parser.
- Fixed small backlog bug in Mojo::Server::Daemon.
- Fixed a small Mojo::Util::html_escape misfeature (OlegG).

2.93 2012-05-05
- Added remove method to Mojolicious::Routes::Route.
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/Util.pm
Expand Up @@ -33,7 +33,7 @@ my %ENTITIES;

# Reverse entities for html_escape (without "apos")
my %REVERSE = ("\x{0027}" => '#39;');
$REVERSE{$ENTITIES{$_}} //= $_ for sort grep /;$/, keys %ENTITIES;
$REVERSE{$ENTITIES{$_}} //= $_ for sort grep {/;/} keys %ENTITIES;

# Encode cache
my %ENCODE;
Expand Down
6 changes: 4 additions & 2 deletions t/mojo/bytestream.t
Expand Up @@ -199,7 +199,8 @@ is b('Hi there')->hmac_sha1_sum(1234567890),

# html_escape
$stream = b("foo bar'<baz>");
is $stream->html_escape, 'foo bar&#39;&LT;baz&GT;', 'right html escaped result';
is $stream->html_escape, 'foo bar&#39;&LT;baz&GT;',
'right html escaped result';

# html_escape (nothing to escape)
$stream = b("foobar123\n\r\t !#\$\%()*+,-./:;=?[\\]^-{|}@~");
Expand Down Expand Up @@ -230,7 +231,8 @@ is $stream->html_unescape, "&Ltf&&0oo\x{00a0}ba;<r",

# utf8 html_escape
$stream = b("fo\nobar<baz>&\"\x{152}")->html_escape;
is "$stream", "fo\nobar&LT;baz&GT;&AMP;&QUOT;&OElig;", 'right html escaped result';
is "$stream", "fo\nobar&LT;baz&GT;&AMP;&QUOT;&OElig;",
'right html escaped result';

# utf8 html_unescape
$stream
Expand Down

0 comments on commit fd0d86f

Please sign in to comment.