From 53307632ae6aa81a47666b1cae86b4adcdaeaa65 Mon Sep 17 00:00:00 2001 From: xxq250 Date: Sat, 13 Dec 2025 17:08:34 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A6=81=E7=94=A8=E6=95=8F=E6=84=9F=E8=AF=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/helpers/repositories_helper.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/helpers/repositories_helper.rb b/app/helpers/repositories_helper.rb index a855dfdf1..695fc8072 100644 --- a/app/helpers/repositories_helper.rb +++ b/app/helpers/repositories_helper.rb @@ -255,7 +255,7 @@ module RepositoriesHelper content = entry['content'].present? ? entry['content'] : Gitea::Repository::Entries::GetService.call(owner, repo.identifier, URI.escape(entry['path']), ref: ref)['content'] # readme_render_decode64_content(content, owner, repo, ref) text = new_readme_render_decode64_content(content, owner, repo, ref, entry['path'], entry['name']) - text = "该内容不合规,请修改。" if text.present? && !HarmoniousDictionary.clean?(text) + # text = "该内容不合规,请修改。" if text.present? && !HarmoniousDictionary.clean?(text) text end @@ -266,11 +266,11 @@ module RepositoriesHelper # Rails.logger.info("content===#{content}") return Base64.decode64(content).force_encoding("GBK").encode("UTF-8") unless Base64.decode64(content).force_encoding('UTF-8').valid_encoding? text = Base64.decode64(content).force_encoding('UTF-8') - text = "该内容不合规,请修改。" if text.present? && !HarmoniousDictionary.clean?(text) + # text = "该内容不合规,请修改。" if text.present? && !HarmoniousDictionary.clean?(text) text elsif entry['is_text_file'] == true text = render_decode64_content(entry['content']) - text = "该内容不合规,请修改。" if text.present? && !HarmoniousDictionary.clean?(text) + # text = "该内容不合规,请修改。" if text.present? && !HarmoniousDictionary.clean?(text) text else file_type = File.extname(entry['name'].to_s)[1..-1] @@ -281,7 +281,7 @@ module RepositoriesHelper return entry['content'] end text = render_decode64_content(entry['content']) - text = "该内容不合规,请修改。" if text.present? && !HarmoniousDictionary.clean?(text) + # text = "该内容不合规,请修改。" if text.present? && !HarmoniousDictionary.clean?(text) text end end