Skip to content
Snippets Groups Projects
Commit 733f68f1 authored by Angie Byron's avatar Angie Byron
Browse files

Issue #2159595 by Gábor Hojtsy: CKEditor should pass paths to locale not URLs.

parent 953da821
No related branches found
No related tags found
2 merge requests!7452Issue #1797438. HTML5 validation is preventing form submit and not fully...,!789Issue #3210310: Adjust Database API to remove deprecated Drupal 9 code in Drupal 10
......@@ -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);
......
......@@ -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);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment