[pmwiki-users] Handling canonical URLs (ie don't allow variable case in urls)

Peter Bowers pbowers at pobox.com
Mon Feb 8 14:31:10 CST 2010

On Mon, Feb 8, 2010 at 8:21 PM, Ed W <lists at wildgooses.com> wrote:
> Can someone please give me some suggestions on how to hook into PmWiki
> to make this happen?  Actually, more to the point I'm unsure where the
> case correction is actually happening (eg see URL examples above) -
> given that I'm on a unix based system with case sensitive URLs, it's not
> clear why it's finding files with different cased names?

I believe it's happening in MakePageName().

Note this set of lines:

  SDV($MakePageNamePatterns, array(
    "/'/" => '',			   # strip single-quotes
    "/[^$PageNameChars]+/" => ' ',         # convert everything else to space
    '/((^|[^-\\w])\\w)/e' => "strtoupper('$1')",
    '/ /' => ''));
    $group = preg_replace(array_keys($MakePageNamePatterns),
               array_values($MakePageNamePatterns), $m[0]);
    $name = preg_replace(array_keys($MakePageNamePatterns),
              array_values($MakePageNamePatterns), $m[1]);

Note particularly the 3rd element in $MakePageNamePatterns.

You will note that it is not completely case-insensitive; it is only
that pmwiki always capitalizes the 1st char of the group and of the
page.  After the 1st char it is case-sensitive.


More information about the pmwiki-users mailing list