On Sat, 11 Sep 2004 17:19:28 +0200, Sebastian Riedel wrote
> Simon Flack schrieb:
>
> >This patch adds a trailing slash where necessary, rather than adding it on
> >after stripping it off.
> >
> >Index: trunk/lib/Maypole/View/Base.pm
> >===================================================================
> >--- trunk/lib/Maypole/View/Base.pm (revision 172)
> >+++ trunk/lib/Maypole/View/Base.pm (working copy)
> >@@ -22,7 +22,7 @@
> > my ($self, $r) = @_;
> > my $class = $r->model_class;
> > my $base = $r->{config}->{uri_base};
> >- $base =~ s/\/+$//;
> >+ $base =~ s/([^\/])$/$1\//;
> > my %args = (
> > request => $r,
> > objects => $r->objects,
> >
> >
[snip]
> And again, this is already fixed in the svn version...but by
> modifying the template macro.
That's fine. I just thought it would be a good idea to keep the trailing slash
on the base, because of the way that URI.pm works:
This oneliner:
perl -MURI -le 'print URI->new_abs("table/list", "http://127.1/maypole")'
returns different things depending on the presence of a trailing slash:
I thought that might be important for things like Template::Plugin::URI, but
it doesn't exist. I suppose it's not a good idea to unconditionally add a
trailing slash because it might not make sense for some providers. But I'm not
sure it's a good thing to unconditionally remove the trailing slash either :)
--simonflk
_______________________________________________
maypole mailing list
maypole at lists.netthink.co.uk
http://lists.netthink.co.uk/listinfo/maypole
This archive was generated by hypermail 2.1.3 : Thu Feb 24 2005 - 22:25:56 GMT