// Copyright 2022 The Gitea Authors. All rights reserved. // SPDX-License-Identifier: MIT package migrations import ( "fmt" "strings" system_model "code.gitea.io/gitea/models/system" "code.gitea.io/gitea/modules/git" "code.gitea.io/gitea/modules/log" base "code.gitea.io/gitea/modules/migration" ) // WarnAndNotice will log the provided message and send a repository notice func WarnAndNotice(fmtStr string, args ...any) { log.Warn(fmtStr, args...) if err := system_model.CreateRepositoryNotice(fmt.Sprintf(fmtStr, args...)); err != nil { log.Error("create repository notice failed: ", err) } } func hasBaseURL(toCheck, baseURL string) bool { if len(baseURL) > 0 && baseURL[len(baseURL)-1] != '/' { baseURL += "/" } return strings.HasPrefix(toCheck, baseURL) } // CheckAndEnsureSafePR will check that a given PR is safe to download func CheckAndEnsureSafePR(pr *base.PullRequest, commonCloneBaseURL string, g base.Downloader) bool { valid := true // SECURITY: the patchURL must be checked to have the same baseURL as the current to prevent open redirect if pr.PatchURL != "" && !hasBaseURL(pr.PatchURL, commonCloneBaseURL) { // TODO: Should we check that this url has the expected format for a patch url? WarnAndNotice("PR #%d in %s has invalid PatchURL: %s baseURL: %s", pr.Number, g, pr.PatchURL, commonCloneBaseURL) pr.PatchURL = "" valid = false } // SECURITY: the headCloneURL must be checked to have the same baseURL as the current to prevent open redirect if pr.Head.CloneURL != "" && !hasBaseURL(pr.Head.CloneURL, commonCloneBaseURL) { // TODO: Should we check that this url has the expected format for a patch url? WarnAndNotice("PR #%d in %s has invalid HeadCloneURL: %s baseURL: %s", pr.Number, g, pr.Head.CloneURL, commonCloneBaseURL) pr.Head.CloneURL = "" valid = false } // SECURITY: SHAs Must be a SHA if pr.MergeCommitSHA != "" && !git.IsValidSHAPattern(pr.MergeCommitSHA) { WarnAndNotice("PR #%d in %s has invalid MergeCommitSHA: %s", pr.Number, g, pr.MergeCommitSHA) pr.MergeCommitSHA = "" } if pr.Head.SHA != "" && !git.IsValidSHAPattern(pr.Head.SHA) { WarnAndNotice("PR #%d in %s has invalid HeadSHA: %s", pr.Number, g, pr.Head.SHA) pr.Head.SHA = "" valid = false } if pr.Base.SHA != "" && !git.IsValidSHAPattern(pr.Base.SHA) { WarnAndNotice("PR #%d in %s has invalid BaseSHA: %s", pr.Number, g, pr.Base.SHA) pr.Base.SHA = "" valid = false } // SECURITY: Refs must be valid refs or SHAs if pr.Head.Ref != "" && !git.IsValidRefPattern(pr.Head.Ref) { WarnAndNotice("PR #%d in %s has invalid HeadRef: %s", pr.Number, g, pr.Head.Ref) pr.Head.Ref = "" valid = false } if pr.Base.Ref != "" && !git.IsValidRefPattern(pr.Base.Ref) { WarnAndNotice("PR #%d in %s has invalid BaseRef: %s", pr.Number, g, pr.Base.Ref) pr.Base.Ref = "" valid = false } pr.EnsuredSafe = true return valid } ion> Nextcloud server, a safe home for all your data: https://github.com/nextcloud/serverwww-data
summaryrefslogtreecommitdiffstats
path: root/l10n/ja_JP/files_trashbin.po
blob: f9f5fd6827cf555bc5f495b380da0a3442b300e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
# SOME DESCRIPTIVE TITLE.
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
# This file is distributed under the same license as the PACKAGE package.
# 
# Translators:
msgid ""
msgstr ""
"Project-Id-Version: ownCloud\n"
"Report-Msgid-Bugs-To: http://bugs.owncloud.org/\n"
"POT-Creation-Date: 2013-07-28 01:56-0400\n"
"PO-Revision-Date: 2013-07-27 06:10+0000\n"
"Last-Translator: I Robot <owncloud-bot@tmit.eu>\n"
"Language-Team: Japanese (Japan) (http://www.transifex.com/projects/p/owncloud/language/ja_JP/)\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: ja_JP\n"
"Plural-Forms: nplurals=1; plural=0;\n"

#: ajax/delete.php:42
#, php-format
msgid "Couldn't delete %s permanently"
msgstr "%s を完全に削除出来ませんでした"

#: ajax/undelete.php:42
#, php-format
msgid "Couldn't restore %s"
msgstr "%s を復元出来ませんでした"

#: js/trash.js:7 js/trash.js:97
msgid "perform restore operation"
msgstr "復元操作を実行する"

#: js/trash.js:19 js/trash.js:46 js/trash.js:115 js/trash.js:141
msgid "Error"
msgstr "エラー"

#: js/trash.js:34
msgid "delete file permanently"
msgstr "ファイルを完全に削除する"

#: js/trash.js:123
msgid "Delete permanently"
msgstr "完全に削除する"

#: js/trash.js:176 templates/index.php:17
msgid "Name"
msgstr "名前"

#: js/trash.js:177 templates/index.php:27
msgid "Deleted"
msgstr "削除済み"

#: js/trash.js:186
msgid "1 folder"
msgstr "1 フォルダ"

#: js/trash.js:188
msgid "{count} folders"
msgstr "{count} フォルダ"

#: js/trash.js:196
msgid "1 file"
msgstr "1 ファイル"

#: js/trash.js:198
msgid "{count} files"
msgstr "{count} ファイル"

#: templates/index.php:9
msgid "Nothing in here. Your trash bin is empty!"
msgstr "ここには何もありません。ゴミ箱は空です!"

#: templates/index.php:20 templates/index.php:22
msgid "Restore"
msgstr "復元"

#: templates/index.php:30 templates/index.php:31
msgid "Delete"
msgstr "削除"

#: templates/part.breadcrumb.php:9
msgid "Deleted Files"
msgstr "削除されたファイル"