1
0
Fork 0
mirror of https://github.com/sbrl/Pepperminty-Wiki.git synced 2024-11-25 17:23:00 +00:00

Bugfix: Fill $matches with the redirect pattern matches

This commit is contained in:
Starbeamrainbowlabs 2015-10-03 13:21:43 +01:00
parent 5b6bc5da7a
commit 1052d76184

View file

@ -10,8 +10,9 @@ register_module([
register_save_preprocessor(function(&$index_entry, &$pagedata) { register_save_preprocessor(function(&$index_entry, &$pagedata) {
error_log("Running redirect check"); error_log("Running redirect check");
$matches = []; $matches = [];
if(preg_match("/^# ?REDIRECT ?\[\[([^\]]+)\]\]/i", $pagedata) === 1) if(preg_match("/^# ?REDIRECT ?\[\[([^\]]+)\]\]/i", $pagedata, $matches) === 1)
{ {
error_log("matches: " . var_export($matches, true));
// We have found a redirect page! // We have found a redirect page!
// Update the metadata to reflect this. // Update the metadata to reflect this.
$index_entry->redirect = true; $index_entry->redirect = true;