From 8a9a478d515aaade32e8152eddda269efeaf9b6d Mon Sep 17 00:00:00 2001 From: xiaomlove Date: Mon, 21 Apr 2025 19:50:22 +0700 Subject: [PATCH] fix format_quote() --- include/functions.php | 7 +++---- include/globalfunctions.php | 6 ++++-- resources/lang/en/label.php | 1 + resources/lang/zh_CN/label.php | 1 + resources/lang/zh_TW/label.php | 1 + 5 files changed, 10 insertions(+), 6 deletions(-) diff --git a/include/functions.php b/include/functions.php index 332fc0d6..ea4c0787 100644 --- a/include/functions.php +++ b/include/functions.php @@ -98,7 +98,6 @@ function sqlerr($file = '', $line = '') function format_quotes($s) { - global $lang_functions; preg_match_all('/\\[quote.*?\\]/i', $s, $result, PREG_PATTERN_ORDER); $openquotecount = count($openquote = $result[0]); preg_match_all('/\\[\/quote\\]/i', $s, $result, PREG_PATTERN_ORDER); @@ -124,9 +123,9 @@ function format_quotes($s) for ($i=0; $i < count($openval); $i++) if ($openval[$i] > $closeval[$i]) return $s; // Cannot close before opening. Return raw string... - - $s = preg_replace("/\\[quote\\]/i","
".$lang_functions['text_quote']."
",$s); - $s = preg_replace("/\\[quote=(.+?)\\]/i", "
".$lang_functions['text_quote'].": \\1
", $s); + $textQuote = nexus_trans("label.text_quote"); + $s = preg_replace("/\\[quote\\]/i","
".$textQuote."
",$s); + $s = preg_replace("/\\[quote=(.+?)\\]/i", "
".$textQuote.": \\1
", $s); $s = preg_replace("/\\[\\/quote\\]/i","

",$s); return $s; } diff --git a/include/globalfunctions.php b/include/globalfunctions.php index 7c4d1e8a..1207c9cb 100644 --- a/include/globalfunctions.php +++ b/include/globalfunctions.php @@ -272,8 +272,10 @@ function getLogFile($append = '') $scriptUserInfo = posix_getpwuid(posix_getuid()); $name .= sprintf("-cli-%s", $scriptUserInfo['name']); } - $logFile = sprintf('%s-%s%s', $name, date('Y-m-d'), $suffix); - return $logFiles[$append] = $logFile; + if (IN_NEXUS) { + $name .= "-" . date('Y-m-d'); + } + return $logFiles[$append] = $name . $suffix; } diff --git a/resources/lang/en/label.php b/resources/lang/en/label.php index 24e1a973..6a30c196 100644 --- a/resources/lang/en/label.php +++ b/resources/lang/en/label.php @@ -44,6 +44,7 @@ return [ 'create' => 'Create', 'created_at_begin' => 'Created at begin', 'created_at_end' => 'Created at end', + 'text_quote' => 'Quote', 'setting' => [ 'nav_text' => 'Setting', 'backup' => [ diff --git a/resources/lang/zh_CN/label.php b/resources/lang/zh_CN/label.php index 84e6f766..3bc13b37 100644 --- a/resources/lang/zh_CN/label.php +++ b/resources/lang/zh_CN/label.php @@ -44,6 +44,7 @@ return [ 'create' => '创建', 'created_at_begin' => '创建时间开始', 'created_at_end' => '创建时间结束', + 'text_quote' => '引用', 'setting' => [ 'nav_text' => '设置', 'backup' => [ diff --git a/resources/lang/zh_TW/label.php b/resources/lang/zh_TW/label.php index 383014b8..af37333b 100644 --- a/resources/lang/zh_TW/label.php +++ b/resources/lang/zh_TW/label.php @@ -44,6 +44,7 @@ return [ 'create' => '創建', 'created_at_begin' => '創建時間開始', 'created_at_end' => '創建時間結束', + 'text_quote' => '引用', 'setting' => [ 'nav_text' => '設置', 'backup' => [