diff --git a/core/includes/common.inc b/core/includes/common.inc index d5e9c90..e9883cd 100644 --- a/core/includes/common.inc +++ b/core/includes/common.inc @@ -1296,10 +1296,7 @@ function drupal_strip_dangerous_protocols($uri) { static $allowed_protocols; if (!isset($allowed_protocols)) { - // During test-setup system.filter.protocols may be empty. In order to - // avoid test breakage, a list of protocols necessary to run tests is - // supplied in that case. - $allowed_protocols = array_flip(config('system.filter')->get('protocols') ?: array('ftp', 'http', 'https', 'irc', 'mailto', 'news', 'nntp', 'rtsp', 'sftp', 'ssh', 'tel', 'telnet', 'webcal')); + $allowed_protocols = array_flip(config('system.filter')->get('protocols')); } // Iteratively remove any invalid protocol found. diff --git a/core/modules/filter/filter.module b/core/modules/filter/filter.module index c17971c..01948b0 100644 --- a/core/modules/filter/filter.module +++ b/core/modules/filter/filter.module @@ -1552,7 +1552,7 @@ function _filter_url($text, $filter) { // we cannot cleanly differ between protocols here without hard-coding MAILTO, // so '//' is optional for all protocols. // @see filter_xss_bad_protocol() - $protocols = config('system.filter')->get('protocols') ?: array('ftp', 'http', 'https', 'irc', 'mailto', 'news', 'nntp', 'rtsp', 'sftp', 'ssh', 'tel', 'telnet', 'webcal'); + $protocols = config('system.filter')->get('protocols'); $protocols = implode(':(?://)?|', $protocols) . ':(?://)?'; // Prepare domain name pattern. diff --git a/core/modules/filter/lib/Drupal/filter/Tests/FilterUnitTest.php b/core/modules/filter/lib/Drupal/filter/Tests/FilterUnitTest.php index e6e0999..fb28576 100644 --- a/core/modules/filter/lib/Drupal/filter/Tests/FilterUnitTest.php +++ b/core/modules/filter/lib/Drupal/filter/Tests/FilterUnitTest.php @@ -7,13 +7,14 @@ namespace Drupal\filter\Tests; -use Drupal\simpletest\UnitTestBase; +use Drupal\simpletest\WebTestBase; use stdClass; /** - * Unit tests for core filters. + * Unit tests for core filters. This class extends WebTestBase because we need + * the system module installed to get the allowed protocols from config. */ -class FilterUnitTest extends UnitTestBase { +class FilterUnitTest extends WebTestBase { public static function getInfo() { return array( 'name' => 'Filter module filters',