[pmwiki-users] umlauts again

Joachim Durchholz jo at durchholz.org
Tue Mar 28 03:05:09 CST 2006


noskule schrieb:
> hi list
> I made the following script to get related pages (Discussion, 
> Presetation, ...)
> 
> GLOBAL $pagename;
> $presentation = '/.-Presentation/';
> 	if (preg_match($presentation, $pagename))
> 	$PageTextStartFmt = "*\n*<div id='presentation'>*\n*";
> 
> So, if the name ends with "-Presentation" the id wikipage id changes 
> from wikitext to presentation. This works except if the pagename 
> consists umlatuts.
> 
> cause the wikipage name is "Einleitung-Pr%e4sentation" but displays 
> Einleitung-Presentation. Could this be changed somhow?

Maybe

   $presentation = '/.-Pr%e4sentation/';

?

If page names with and without umlaut come along that code path, you may 
have to use alternatives:

$presentation = '/.-Präsentation|.-Pr%e4sentation/';


Um... speaking of that regular expression... you know that that initial 
dot isn't going to help you much; the regex /.-Presentation/ says "find 
the string '-Presentation' anywhere in the haystack, except at the very 
beginning".
You probably meant to say
   /-Presentation$/
which means "find the string '-Presentation' at the end of the haystack".

Regards,
Jo




More information about the pmwiki-users mailing list