From f603edde0b9c0cbdf7e42493c688fb3bb2e2a12b Mon Sep 17 00:00:00 2001 From: nanhaoluo <3075912108@qq.com> Date: Thu, 22 Jan 2026 13:16:22 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E7=A7=BB=E9=99=A4=E9=82=AE?= =?UTF-8?q?=E4=BB=B6=E6=A8=A1=E6=9D=BF=E5=90=91=E5=90=8E=E5=85=BC=E5=AE=B9?= =?UTF-8?q?=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 移除旧版 {{#if variable}}...{{/if}} 条件语法支持 - 仅保留 Mustache 标准语法({{#variable}} 和 {{^variable}}) --- email-templates/base.php | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/email-templates/base.php b/email-templates/base.php index 4321acb..cbaeab0 100644 --- a/email-templates/base.php +++ b/email-templates/base.php @@ -348,17 +348,6 @@ function argon_replace_placeholders($template, $vars, $escape = false) { return ''; }, $template); - // 处理旧版条件语句 {{#if variable}}...{{/if}}(向后兼容) - $template = preg_replace_callback('/\{\{#if\s+(\w+)\}\}(.*?)\{\{\/if\}\}/s', function($matches) use ($vars) { - $var_name = $matches[1]; - $content = $matches[2]; - // 如果变量存在且不为空,返回内容,否则返回空字符串 - if (isset($vars[$var_name]) && !empty($vars[$var_name])) { - return $content; - } - return ''; - }, $template); - // 替换普通占位符 foreach ($vars as $key => $value) { if ($escape && !in_array($key, array('theme_color', 'blog_url', 'post_url', 'comment_url', 'reset_url', 'login_url', 'feedback_manage_url', 'feedback_view_url'))) {