X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=blobdiff_plain;f=lib%2FCatalyst.pm;h=4ef7047a1b6133249318e4966be18124a8473e48;hp=d08e7ba55d0d1a3b59e317788e0b9584ef692bd9;hb=9d1f95081b5502041ce6597d67a7aa3c23dc8e08;hpb=e5ac67e5d706bf2e4a4c33537479f70c409a6e4e diff --git a/lib/Catalyst.pm b/lib/Catalyst.pm index d08e7ba..4ef7047 100644 --- a/lib/Catalyst.pm +++ b/lib/Catalyst.pm @@ -180,7 +180,7 @@ sub composed_stats_class { __PACKAGE__->_encode_check(Encode::FB_CROAK | Encode::LEAVE_SRC); # Remember to update this in Catalyst::Runtime as well! -our $VERSION = '5.90099_001'; +our $VERSION = '5.90095'; $VERSION = eval $VERSION if $VERSION =~ /_/; # numify for warning-free dev releases sub import { @@ -1632,6 +1632,14 @@ sub uri_for { my $query = ''; + # remove and save fragment if there is one + my $fragment; + if ($args =~ s/#(.+)$//) { + $fragment = encode_utf8($1); + $fragment =~ s/([^A-Za-z0-9\-_.!~*'() ])/$URI::Escape::escapes{$1}/go; + $fragment =~ s/ /+/g; + } + if (my @keys = keys %$params) { # somewhat lifted from URI::_query's query_form $query = '?'.join('&', map { @@ -1660,7 +1668,10 @@ sub uri_for { $base =~ s/([^$URI::uric])/$URI::Escape::escapes{$1}/go; $args = encode_utf8 $args; $args =~ s/([^$URI::uric])/$URI::Escape::escapes{$1}/go; - + + # re-attach fragment on the end of everything after adding params + $query .= "#$fragment" if $fragment; + my $res = bless(\"${base}${args}${query}", $class); $res; }