Skip to content

Commit

Permalink
use transliteration when possible
Browse files Browse the repository at this point in the history
  • Loading branch information
kraih committed Feb 23, 2014
1 parent 097650c commit 84db5a7
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Changes
@@ -1,5 +1,5 @@

4.85 2014-02-23
4.85 2014-02-24

4.84 2014-02-22
- Added remaining attribute to Mojo::IOLoop::Delay.
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/Headers.pm
Expand Up @@ -18,7 +18,7 @@ my %NORMALCASE = map { lc($_) => $_ } (
);
for my $header (values %NORMALCASE) {
my $name = lc $header;
$name =~ s/-/_/g;
$name =~ y/-/_/;
monkey_patch __PACKAGE__, $name, sub { scalar shift->header($header => @_) };
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/Message/Request.pm
Expand Up @@ -204,7 +204,7 @@ sub _parse_env {
my $base = $url->base;
while (my ($name, $value) = each %$env) {
next unless $name =~ s/^HTTP_//i;
$name =~ s/_/-/g;
$name =~ y/_/-/;
$headers->header($name => $value);

# Host/Port
Expand Down
2 changes: 1 addition & 1 deletion lib/Mojo/Template.pm
Expand Up @@ -94,7 +94,7 @@ sub compile {
# Compile with line directive
return undef unless my $code = $self->code;
my $name = $self->name;
$name =~ s/"//g;
$name =~ y/"//d;
my $compiled = eval qq{#line 1 "$name"\n$code};
$self->compiled($compiled) and return undef unless $@;

Expand Down
2 changes: 1 addition & 1 deletion lib/Mojolicious/Plugin/TagHelpers.pm
Expand Up @@ -214,7 +214,7 @@ sub _tag {
my %attrs = @_;
if ($attrs{data} && ref $attrs{data} eq 'HASH') {
while (my ($key, $value) = each %{$attrs{data}}) {
$key =~ tr/_/-/;
$key =~ y/_/-/;
$attrs{lc("data-$key")} = $value;
}
delete $attrs{data};
Expand Down
4 changes: 2 additions & 2 deletions lib/Mojolicious/Sessions.pm
Expand Up @@ -13,7 +13,7 @@ sub load {
my ($self, $c) = @_;

return unless my $value = $c->signed_cookie($self->cookie_name);
$value =~ s/-/=/g;
$value =~ y/-/=/;
return unless my $session = j(b64_decode $value);

# "expiration" value is inherited
Expand Down Expand Up @@ -47,7 +47,7 @@ sub store {
if $expiration || $default;

my $value = b64_encode(encode_json($session), '');
$value =~ s/=/-/g;
$value =~ y/=/-/;
my $options = {
domain => $self->cookie_domain,
expires => $session->{expires},
Expand Down

0 comments on commit 84db5a7

Please sign in to comment.