diff --git a/core/includes/common.inc b/core/includes/common.inc index 91b6c1a..6c54958 100644 --- a/core/includes/common.inc +++ b/core/includes/common.inc @@ -1296,9 +1296,9 @@ function drupal_strip_dangerous_protocols($uri) { static $allowed_protocols; if (!isset($allowed_protocols)) { - // During upgrade path tests 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. + // filter_xss_admin() is called by the installer and update.php, in which + // case the configuration may not exist (yet). Provide a minimal default set + // of allowed protocols for these cases. $allowed_protocols = array_flip(config('system.filter')->get('protocols') ?: array('http', 'https')); } diff --git a/core/modules/filter/lib/Drupal/filter/Tests/FilterUnitTest.php b/core/modules/filter/lib/Drupal/filter/Tests/FilterUnitTest.php index 530ec42..b2264a4 100644 --- a/core/modules/filter/lib/Drupal/filter/Tests/FilterUnitTest.php +++ b/core/modules/filter/lib/Drupal/filter/Tests/FilterUnitTest.php @@ -20,7 +20,7 @@ class FilterUnitTest extends DrupalUnitTestBase { * * @var array */ - public static $modules = array('system'); + public static $modules = array('filter'); public static function getInfo() { return array( @@ -32,7 +32,7 @@ public static function getInfo() { protected function setUp() { parent::setUp(); - $this->enableModules(array('system')); + config_install_default_config('module', 'system'); } /** diff --git a/core/modules/system/lib/Drupal/system/Tests/Common/XssUnitTest.php b/core/modules/system/lib/Drupal/system/Tests/Common/XssUnitTest.php index 4a860c2..dff85bd 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Common/XssUnitTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Common/XssUnitTest.php @@ -19,7 +19,7 @@ class XssUnitTest extends DrupalUnitTestBase { * * @var array */ - public static $modules = array('system'); + public static $modules = array('filter'); public static function getInfo() { return array( @@ -31,7 +31,7 @@ public static function getInfo() { protected function setUp() { parent::setUp(); - $this->enableModules(array('system')); + config_install_default_config('module', 'system'); } /** diff --git a/core/modules/system/lib/Drupal/system/Tests/Upgrade/SystemUpgradePathTest.php b/core/modules/system/lib/Drupal/system/Tests/Upgrade/SystemUpgradePathTest.php index bf8321d..d8269a1 100644 --- a/core/modules/system/lib/Drupal/system/Tests/Upgrade/SystemUpgradePathTest.php +++ b/core/modules/system/lib/Drupal/system/Tests/Upgrade/SystemUpgradePathTest.php @@ -82,10 +82,12 @@ public function testVariableUpgrade() { $expected_config['system.filter'] = array( 'protocols.0' => 'http', 'protocols.1' => 'https', + 'protocols.2' => 'ftp', + 'protocols.3' => 'mailto', ); $expected_config['filter.settings'] = array( - 'fallback_format' => 'pagan_poetry' + 'fallback_format' => 'plain_text' ); foreach ($expected_config as $file => $values) { diff --git a/core/modules/system/tests/upgrade/drupal-7.system.database.php b/core/modules/system/tests/upgrade/drupal-7.system.database.php index 46cd25c..ca85f43 100644 --- a/core/modules/system/tests/upgrade/drupal-7.system.database.php +++ b/core/modules/system/tests/upgrade/drupal-7.system.database.php @@ -97,7 +97,7 @@ )) ->values(array( 'name' => 'filter_allowed_protocols', - 'value' => 'a:2:{i:0;s:4:"http";i:1;s:5:"https";}', + 'value' => 'a:4:{i:0;s:4:"http";i:1;s:5:"https";i:2;s:3:"ftp";i:3;s:6:"mailto";}', )) ->execute(); @@ -110,7 +110,7 @@ ->condition('name', 'site_name') ->execute(); db_update('variable') - ->fields(array('value' => 's:12:"pagan_poetry";')) + ->fields(array('value' => 's:10:"plain_text";')) ->condition('name', 'filter_fallback_format') ->execute();