From 733f68f17f0f227d0f970bc412177258c4580ea5 Mon Sep 17 00:00:00 2001 From: webchick Date: Mon, 13 Jan 2014 22:25:22 -0800 Subject: [PATCH] =?UTF-8?q?Issue=20#2159595=20by=20G=C3=A1bor=20Hojtsy:=20?= =?UTF-8?q?CKEditor=20should=20pass=20paths=20to=20locale=20not=20URLs.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../lib/Drupal/ckeditor/Plugin/Editor/CKEditor.php | 2 +- core/modules/locale/locale.module | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) 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 03f37e1b36d..ae1ef56f5cc 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 @@ class CKEditor extends EditorBase implements ContainerFactoryPluginInterface { // 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 e9b539c2f79..3c5dfedb481 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);