On Tue, Sep 21, 2010 at 4:50 PM, Horst Rischbode <ho...@horibo.de> wrote:
>  Hi,
> this is really strange. In my pages, I have the following code:
> <r:if_url matches="^/articles/\d{4}/\d{2}/\d{2}/.+">
>    # do something brilliant
> </r:if_url>
> This regexpr matches to:
> /articles/2010/08/
> /articles/2010/08/07/xyz
> All tests with several online regexpr matchers match the second url only,
> which I would expect for my code, too.
> I'm on Windows with MySQL and Ruby 1.8.6 with Radiant 0.9.1 installed.
> Any idea, what's going wrong?
> Horst

Here's the problem with if_url: it uses this to check the url

 unless tag.locals.page.url.match(regexp).nil?

Notice that it's checking the page.url and not the request path. That
should probably be changed (and well-tested patches are always

So it's not checking the actual request, it's checking the current
page's url attribute. I'm just quickly looking at this but I would
think it wouldn't match either of those paths.

What are you trying to achieve? And are you using the
ArchiveMonthIndexPage type for a separate page or just checking the
url on individual articles?

Jim Gay
Saturn Flyer LLC

Reply via email to