From 718034a7b4ef18c1cdcf33634aed136d75c75133 Mon Sep 17 00:00:00 2001 From: augushong Date: Wed, 6 May 2026 20:55:17 +0800 Subject: [PATCH] =?UTF-8?q?fix(update):=20=E4=BF=AE=E5=A4=8D=E7=9B=AE?= =?UTF-8?q?=E5=BD=95=E5=BF=BD=E7=95=A5=E9=80=BB=E8=BE=91=E7=9A=84=E5=89=8D?= =?UTF-8?q?=E7=BC=80=E5=8C=B9=E9=85=8D=E8=AF=AF=E5=91=BD=E4=B8=AD=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit isIgnoredPath 和 testIsOptionalFiles 方法使用 str_starts_with 做前缀匹配, 导致 .gitea 被 .git 规则误跳过,.gitignore/.gitattributes 同样受影响。 改为精确目录名匹配: === || str_starts_with(, . '/') --- extend/base/admin/service/AdminUpdateServiceBase.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extend/base/admin/service/AdminUpdateServiceBase.php b/extend/base/admin/service/AdminUpdateServiceBase.php index 7e39057..8a2345d 100644 --- a/extend/base/admin/service/AdminUpdateServiceBase.php +++ b/extend/base/admin/service/AdminUpdateServiceBase.php @@ -347,7 +347,7 @@ class AdminUpdateServiceBase ]; foreach ($optional_files_prefix as $prefix) { - if (str_starts_with($file_path, $prefix)) { + if ($file_path === $prefix || str_starts_with($file_path, $prefix . '/')) { return true; } } @@ -393,7 +393,7 @@ class AdminUpdateServiceBase protected function isIgnoredPath(string $path, array $ignore_prefix) { foreach ($ignore_prefix as $prefix) { - if (str_starts_with($path, $prefix)) { + if ($path === $prefix || str_starts_with($path, $prefix . '/')) { return true; } }