From 1052d76184ed4ed0010a7c34390f2d95ab186152 Mon Sep 17 00:00:00 2001 From: Starbeamrainbowlabs Date: Sat, 3 Oct 2015 13:21:43 +0100 Subject: [PATCH] Bugfix: Fill $matches with the redirect pattern matches --- modules/feature-redirect.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/feature-redirect.php b/modules/feature-redirect.php index 0b55d9e..9c5dc73 100644 --- a/modules/feature-redirect.php +++ b/modules/feature-redirect.php @@ -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;