Make dates more flexible, a=chris

Chris Pollett [2022-09-16 04:Sep:th]
Make dates more flexible, a=chris
Filename
src/library/WikiParser.php
diff --git a/src/library/WikiParser.php b/src/library/WikiParser.php
index 0d2562970..77caf73ce 100644
--- a/src/library/WikiParser.php
+++ b/src/library/WikiParser.php
@@ -193,11 +193,16 @@ class WikiParser implements CrawlConstants
         $braces_substitutions = [
             ["/{{timestamp}}/si",
                 "<input type='hidden' name='timestamp' value='" .time()."' />"],
+            ["/{{timestamp\|(.+?)}}/si",
+                "<input type='hidden' name='$1' value='" .time()."' />"],
             ["/{{date}}/si",
-                "<input type='hidden' name='date' value='" .date('r').
-                "' />"],
+                "<input type='hidden' name='date' value='" .date('r'). "' />"],
+            ["/{{date\|(.+?)}}/si",
+                "<input type='hidden' name='$1' value='" .date('r'). "' />"],
             ["/{{username}}/si",
                 "<input type='hidden' name='username' value='[{username}]' />"],
+            ["/{{username\|(.+?)}}/si",
+                "<input type='hidden' name='$1' value='[{username}]' />"],
             ["/{{image-captcha\|(.+?)}}/si", "<div class='csv-captcha'>".
                 "[{image-captcha}]<br /><input id='captcha-id' ".
                 "type='text' name='user_captcha_text' placeholder='$1'/>".
ViewGit