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

Wolfgang Faust wolfgangmcq at gmail.com
Sat Apr 25 11:50:56 CDT 2015


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
);

On Sat, Apr 25, 2015 at 8:37 AM, Bernd Schatz <bernd.schatz at gmx.net> wrote:

> Hi,
>
> Am 21.04.2015 um 22:11 schrieb ABClf:
> [...]
> > Also, you can use
> http://www.pmwiki.org/wiki/Cookbook/AlternateNamingScheme
> > as well, define a new scheme, thus all links ignore uppercase.
>
> I think that could be the solution,
> something like:
>
> $MakePageNamePatterns = array(
> "/([\\w])+/e" => "return strtolower('$1')", # all lowercase
>     "/\\s+/" => ''                          # remove spaces
> );
>
>
> Unfortunately, now i have a problem with php5
>
>
> Deprecated: preg_replace(): The /e modifier is deprecated, use
> preg_replace_callback instead in /var/www/bswiki/pmwiki.php on line 467
>
>
> There seems to be deprectaed method in pmwiki.php:467 ==>
>
> function PPRA($array, $x) {
>   foreach($array as $pat => $rep) {
>      if(is_callable($rep)) $x = preg_replace_callback($pat,$rep,$x);
>      else $x = preg_replace($pat,$rep,$x);
>   }
>   return $x;
> }
>
>
> How i can i fix it ?
>
>
> greets
>   Bernd
>
>
> _______________________________________________
> pmwiki-users mailing list
> pmwiki-users at pmichaud.com
> http://www.pmichaud.com/mailman/listinfo/pmwiki-users
>
>


-- 
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/20150425/de27e958/attachment.html>


More information about the pmwiki-users mailing list