From 164307dcd45f3c8b697aec32abbf2d8286154124 Mon Sep 17 00:00:00 2001 From: s-nakajima Date: Tue, 15 Mar 2022 11:53:39 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=8B=95=E7=94=BB=E3=82=B5=E3=83=A0?= =?UTF-8?q?=E3=83=8D=E3=82=A4=E3=83=AB=E3=82=84Wysiwyg=E3=81=AE=E7=94=BB?= =?UTF-8?q?=E5=83=8F=E3=82=92=E7=9B=B4=E3=83=AA=E3=83=B3=E3=82=AF=E3=81=97?= =?UTF-8?q?=E3=81=9F=E9=9A=9B=E3=81=AB=E6=8B=92=E5=90=A6IP=E3=82=A2?= =?UTF-8?q?=E3=83=89=E3=83=AC=E3=82=B9=E3=83=81=E3=82=A7=E3=83=83=E3=82=AF?= =?UTF-8?q?=E6=BC=8F=E3=82=8C=20(=E3=82=B3=E3=83=B3=E3=83=86=E3=83=B3?= =?UTF-8?q?=E3=83=84=E8=87=AA=E4=BD=93=E3=81=AF=E3=82=A8=E3=83=A9=E3=83=BC?= =?UTF-8?q?=E3=81=AB=E3=81=AA=E3=82=8B=E3=81=9F=E3=82=81=E5=95=8F=E9=A1=8C?= =?UTF-8?q?=E3=81=AA=E3=81=97)=20https://github.com/NetCommons3/NetCommons?= =?UTF-8?q?3/issues/1668?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Controller/VideoFilesController.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Controller/VideoFilesController.php b/Controller/VideoFilesController.php index a52a7d4..9823b03 100644 --- a/Controller/VideoFilesController.php +++ b/Controller/VideoFilesController.php @@ -11,6 +11,7 @@ App::uses('Controller', 'Controller'); App::uses('Current', 'NetCommons.Utility'); +App::uses('NetCommonsSecurity', 'NetCommons.Utility'); /** * サムネイル、動画の表示 Controller @@ -67,6 +68,10 @@ public function beforeFilter() { * @throws NotFoundException 表示できない記事へのアクセス */ public function file() { + if (! (new NetCommonsSecurity())->enableBadIps()) { + throw new NotFoundException(); + } + // ここから元コンテンツを取得する処理 $key = $this->params['key']; $conditions = $this->Video->getConditions(); @@ -99,7 +104,7 @@ public function file() { return $response; } else { // 表示できないなら404 - throw new NotFoundException(__d('videos', 'Invalid video entry')); + throw new NotFoundException(); } } }