[pmwiki-devel] Bug in MakeBaseName
Stirling Westrup
sti at pooq.com
Fri Nov 3 13:41:38 CST 2006
Currently the MakeBaseName function in pmwiki.php always ignores its second
argument. I think PM forgot an if on the setting of $patlist. Here's a
corrected version:
## MakeBaseName uses $BaseNamePatterns to return the "base" form
## of a given pagename -- i.e., stripping any recipe-defined
## prefixes or suffixes from the page.
function MakeBaseName($pagename, $patlist = NULL) {
global $BaseNamePatterns;
if(!$patlist) $patlist = (array)@$BaseNamePatterns;
foreach((array)$patlist as $pat => $rep)
$pagename = preg_replace($pat, $rep, $pagename);
return $pagename;
}
More information about the pmwiki-devel
mailing list