From e027bc83196adbe67b868f92a8561527fd241a93 Mon Sep 17 00:00:00 2001 From: Kijin Sung Date: Thu, 11 Oct 2018 14:32:10 +0900 Subject: [PATCH] Add jquery-latest.js to blacklist MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit http://code.jquery.com/jquery-latest.js 와 같은 스크립트를 임의로 로딩하지 못하도록 막음. 버전이 붙은 파일명은 이미 대부분 막혀 있었지만, 이 커밋에서는 -latest가 포함된 것도 막도록 변경함. cf. https://xetown.com/qna/1089463 --- classes/display/HTMLDisplayHandler.php | 2 +- tests/unit/classes/FrontEndFileHandlerTest.php | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/classes/display/HTMLDisplayHandler.php b/classes/display/HTMLDisplayHandler.php index 36adaf5bb..0ec430e37 100644 --- a/classes/display/HTMLDisplayHandler.php +++ b/classes/display/HTMLDisplayHandler.php @@ -19,7 +19,7 @@ class HTMLDisplayHandler * List of scripts to block loading */ public static $blockedScripts = array( - '@(?:^|/)j[Qq]uery(?:-[0-9]+(?:\.[0-9x]+)*)?(?:\.min)?\.js$@', + '@(?:^|/)j[Qq]uery(?:-[0-9]+(?:\.[0-9x]+)*|-latest)?(?:\.min)?\.js$@', ); /** diff --git a/tests/unit/classes/FrontEndFileHandlerTest.php b/tests/unit/classes/FrontEndFileHandlerTest.php index dfe99509c..a0dc55837 100644 --- a/tests/unit/classes/FrontEndFileHandlerTest.php +++ b/tests/unit/classes/FrontEndFileHandlerTest.php @@ -258,6 +258,7 @@ class FrontEndFileHandlerTest extends \Codeception\TestCase\Test $handler->loadFile(array('./common/js/jquery-1.x.min.js')); $handler->loadFile(array('./common/js/jquery-2.0.0.js')); $handler->loadFile(array('./common/js/jQuery.min.js')); + $handler->loadFile(array('http://code.jquery.com/jquery-latest.js')); $result = $handler->getCssFileList(); $this->assertEquals(0, count($result)); $result = $handler->getJsFileList();