This commit is contained in:
joyqi
2024-01-02 11:16:44 +08:00
committed by GitHub
parent f3299ecb8a
commit 77aebcbd0e
7 changed files with 22 additions and 6 deletions
+8 -1
View File
@@ -44,7 +44,14 @@ while ($parents->next()) {
$permalink = ltrim($permalink, '/');
$permalink = preg_replace("/\[([_a-z0-9-]+)[^\]]*\]/i", "{\\1}", $permalink);
if ($page->have()) {
$permalink = str_replace('{cid}', $page->cid, $permalink);
$permalink = preg_replace_callback(
"/\{(cid)\}/i",
function ($matches) use ($page) {
$key = $matches[1];
return $page->getRouterParam($key);
},
$permalink
);
}
$input = '<input type="text" id="slug" name="slug" autocomplete="off" value="' . htmlspecialchars($page->slug ?? '') . '" class="mono" />';
?>