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
1 changed files with 2 additions and 1 deletions

View File

@ -10,8 +10,9 @@ register_module([
register_save_preprocessor(function(&$index_entry, &$pagedata) {
error_log("Running redirect check");
$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!
// Update the metadata to reflect this.
$index_entry->redirect = true;