Topic on Extension talk:Realnames

Unknown Modifier Error on Subpages

3
H.Mills (talkcontribs)

I am running Realnames v0.3.1 with the default options.

When navigating to a sub-page of a user's page (e.g. /User:somename/Subpage) an 'Unknown modifier' error is generated by preg_replace_callback() in lookForBare().

I have fixed this in our installation by changing the delimiters for the regex from '/' to '~' in the following two places in Realnames.body.php:

268 - $out->setPagetitle(static::lookForBare($out->getPageTitle(),'/'.static::getNamespacePrefixes().'\s*('.$title->getText().')(?:\/.+)?/'));
268 + $out->setPagetitle(static::lookForBare($out->getPageTitle(),'~'.static::getNamespacePrefixes().'\s*('.$title->getText().')(?:/.+)?~'));
334 - $pattern = '/'.static::getNamespacePrefixes().'([^ \t]+)(:\/.+)?/';
334 + $pattern = '~'.static::getNamespacePrefixes().'([^ \t]+)(:/.+)?~';

I have not yet noticed this breaking anything else but will post again if I notice anything.

Jpgill86 (talkcontribs)

Thank you, H.Mills. This solved my problem!

H.Mills (talkcontribs)

I had completely forgotten about this fix but I'm glad it helped!

Reply to "Unknown Modifier Error on Subpages"