mirror of
https://github.com/sbrl/Pepperminty-Wiki.git
synced 2024-11-22 04:23:01 +00:00
Bugfix: Fill $matches with the redirect pattern matches
This commit is contained in:
parent
5b6bc5da7a
commit
1052d76184
1 changed files with 2 additions and 1 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue