You are viewing a plain text version of this content. The canonical link for it is here.
Posted to site-dev@apache.org by sebb <se...@gmail.com> on 2020/07/22 21:57:37 UTC

Re: svn commit: r1063340 - /websites/staging/www/trunk/content/dyn/closer.lua

On Wed, 22 Jul 2020 at 18:16, <hu...@apache.org> wrote:
>
> Author: humbedooh
> Date: Wed Jul 22 17:07:33 2020
> New Revision: 1063340
>
> Log:
> allow for dashes in project name
>
> Modified:
>     websites/staging/www/trunk/content/dyn/closer.lua
>
> Modified: websites/staging/www/trunk/content/dyn/closer.lua
> ==============================================================================
> --- websites/staging/www/trunk/content/dyn/closer.lua (original)
> +++ websites/staging/www/trunk/content/dyn/closer.lua Wed Jul 22 17:07:33 2020
> @@ -290,7 +290,7 @@ function handle(r)
>      -- Final sanity check: page variable must match this path to be a valid template file
>      -- If not, default to our standard template
>      -- TODO: Weed out the /var/www later on and always only have /www/foo.a.o/bar.html as valid
> -    if not r:regex(page, [[^(/var/www|/www)/([a-z0-9]+\.apache\.org)/[-a-zA-Z0-9/]*\.html?$]]) then
> +    if not r:regex(page, [[^(/var/www|/www)/([-a-z0-9]+\.apache\.org)/[-a-zA-Z0-9/]*\.html?$]]) then

The page name matching looks wrong:
- it allows an empty stem, e.g. '.html'
- it restricts the page name unnecessarily, e.g. underscore not allowed.

But is there any need to validate the page name at all?
If so, it should handle the above issues.

>          page = CLOSER_PG
>      end
>
>
>