[pmwiki-users] Same name but different pages if case sensitive

Wolfgang Faust wolfgangmcq at gmail.com
Thu Apr 30 09:19:05 CDT 2015


On Wed, Apr 29, 2015 at 9:55 PM, Bernd Schatz <bernd.schatz at gmx.net> wrote:

> Hi,
>
> Am 25.04.2015 um 18:50 schrieb Wolfgang Faust:> PPRA() checks if the
> replacement is a callable, and uses
> > preg_replace_callback if necessary. Instead of using /e in the pattern,
> > make the replacement an anonymous function, like so:
> > $MakePageNamePatterns = array(
> >      "/([\\w])+/" => function($match) {
> >         return strtolower($match[1]); # all lowercase
> >     },
> >     "/\\s+/" => ''                          # remove spaces
> > );
>
>
> Great, that was it:
>
> $MakePageNamePatterns = array(
>      "/(^\w)(\w+)/" => function($match)
>      {
>            return strtoupper($match[1]).strtolower($match[2]); # all
> lowercase, except first character
>      },
>     "/\\s+/" => ''                          # remove spaces
> );
>
> Hooray!

>
> To fix already existing pages in directory wiki.d ==>
> for i in $(ls -1); do mv $i  $(echo $i | sed -e
> 's/Main\.\(\w\)\(.*\)/Main.\U\1\L\2/g'); done;
>
>
> To fix special pages (hard coded anywhere ???) ==>
> ln -s Main.Sidebar Main.SideBar
>
> Rather than symlinking (which will in effect create duplicate pages) why
not set up a redirect?
http://www.pmwiki.org/wiki/PmWiki/PageDirectives#redirect


>
> Now there is still a small issue with the PmWiki.* and Site.* pages,
> but i think you could fix it with a small script that creates a link for
> every of this pages.
>
>
> thx and greets
>
>   Bernd
>
>
>
>
>
>


-- 
The views expressed above are exclusively mine, if anyone's.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.pmichaud.com/pipermail/pmwiki-users/attachments/20150430/704de1e1/attachment.html>


More information about the pmwiki-users mailing list