Jump to content

Topic on Extension talk:HierarchyBuilder/Flow

Page name with special characters

3
Emmanuel Touvier (talkcontribs)

I found the extension does not work when a page name contains characters used in regular expressions. I had to modify HierarchyBuilder.php this way:

When there is a string comparison with preg_match_all, I first modify the $currentPagePattern

$currentPagePattern = '/\[\[' . '\Q' . str_replace('/','',$targetPageName) . '\E' . '\]\]/';

and the I do the same for $row in the comparison, example :

preg_match_all( $currentPagePattern, '\Q'.str_replace('/','',$row).'\E', $matches );

This solves my issues with Hierarchy Builder.

Kevin.ji (talkcontribs)

Thanks so much for the feedback Emmanuel! Would you mind submitting that fix as a patch in gerrit?

This post was hidden by Kevin.ji (history)
Reply to "Page name with special characters"