From aea3a945ab7381887862a4673c4cdbf2f1f14d74 Mon Sep 17 00:00:00 2001 From: houseme Date: Sun, 1 Dec 2024 17:09:26 +0800 Subject: [PATCH 1/3] Fix code scanning alert no. 9: Potentially unsafe quoting Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- util/gpage/gpage.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/util/gpage/gpage.go b/util/gpage/gpage.go index 1570ff1e2c6..642e78e811e 100644 --- a/util/gpage/gpage.go +++ b/util/gpage/gpage.go @@ -10,6 +10,7 @@ package gpage import ( "fmt" "math" + "html" "github.com/gogf/gf/v2/text/gstr" "github.com/gogf/gf/v2/util/gconv" @@ -215,12 +216,12 @@ func (p *Page) GetLink(page int, text, title string) string { if len(p.AjaxActionName) > 0 { return fmt.Sprintf( `%s`, - p.LinkStyle, p.AjaxActionName, p.GetUrl(page), title, text, + p.LinkStyle, p.AjaxActionName, p.GetUrl(page), html.EscapeString(title), text, ) } else { return fmt.Sprintf( `%s`, - p.LinkStyle, p.GetUrl(page), title, text, + p.LinkStyle, p.GetUrl(page), html.EscapeString(title), text, ) } } From 7970e3a79e540f42c007c8b3a11405779739b3fd Mon Sep 17 00:00:00 2001 From: houseme Date: Sun, 1 Dec 2024 18:28:37 +0800 Subject: [PATCH 2/3] improve import --- util/gpage/gpage.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/gpage/gpage.go b/util/gpage/gpage.go index 642e78e811e..afdb3e65062 100644 --- a/util/gpage/gpage.go +++ b/util/gpage/gpage.go @@ -9,8 +9,8 @@ package gpage import ( "fmt" - "math" "html" + "math" "github.com/gogf/gf/v2/text/gstr" "github.com/gogf/gf/v2/util/gconv" From 78a3a4dd70459d8f3bc0ac37032e37fe62611104 Mon Sep 17 00:00:00 2001 From: houseme Date: Sun, 1 Dec 2024 18:47:57 +0800 Subject: [PATCH 3/3] fix: modify Copyright --- .github/workflows/golangci-lint.yml | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index 42f1cc6eb2f..0aa08c04960 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -1,17 +1,8 @@ -# Tencent is pleased to support the open source community by making Polaris available. +# Copyright GoFrame Author(https://goframe.org). All Rights Reserved. # -# Copyright (C) 2019 THL A29 Limited, a Tencent company. All rights reserved. -# -# Licensed under the BSD 3-Clause License (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# https://opensource.org/licenses/BSD-3-Clause -# -# Unless required by applicable law or agreed to in writing, software distributed -# under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR -# CONDITIONS OF ANY KIND, either express or implied. See the License for the -# specific language governing permissions and limitations under the License. +# This Source Code Form is subject to the terms of the MIT License. +# If a copy of the MIT was not distributed with this file, +# You can obtain one at https://github.com/gogf/gf. name: GolangCI-Lint on: