diff --git a/core/modules/ckeditor/lib/Drupal/ckeditor/Plugin/Editor/CKEditor.php b/core/modules/ckeditor/lib/Drupal/ckeditor/Plugin/Editor/CKEditor.php index 03f37e1b36d4d87527e1698f6980951622f85ef4..ae1ef56f5cc0a3df8b364baeacdb460f80a7f0df 100644 --- a/core/modules/ckeditor/lib/Drupal/ckeditor/Plugin/Editor/CKEditor.php +++ b/core/modules/ckeditor/lib/Drupal/ckeditor/Plugin/Editor/CKEditor.php @@ -292,7 +292,7 @@ public function getJSSettings(EditorEntity $editor) { // Parse all CKEditor plugin JavaScript files for translations. if ($this->moduleHandler->moduleExists('locale')) { - locale_js_translate(array_values($settings['drupalExternalPlugins'])); + locale_js_translate(array_values($external_plugin_files)); } ksort($settings); diff --git a/core/modules/locale/locale.module b/core/modules/locale/locale.module index e9b539c2f79c4ab3808834d62a504fc62289fae5..3c5dfedb4816bb58f5afb23c5a299e2ab694877f 100644 --- a/core/modules/locale/locale.module +++ b/core/modules/locale/locale.module @@ -1153,12 +1153,21 @@ function _locale_refresh_configuration(array $langcodes, array $lids) { * * @return array * Array of string objects to update indexed by context and source. + * + * @throws Exception + * If a non-local file is attempted to be parsed. */ function _locale_parse_js_file($filepath) { // The file path might contain a query string, so make sure we only use the // actual file. $parsed_url = drupal_parse_url($filepath); $filepath = $parsed_url['path']; + + // If there is still a protocol component in the path, reject that. + if (strpos($filepath, ':')) { + throw new Exception('Only local files should be passed to _locale_parse_js_file().'); + } + // Load the JavaScript file. $file = file_get_contents($filepath);