Locale JS alter breaks on remote JS files

Created on 1 December 2014, over 10 years ago
Updated 20 October 2023, over 1 year ago

Problem/Motivation

_locale_parse_js_file() throws an exception if an external file is passed in, but I can't see anywhere in the call path (locale_js_alter() -> locale_js_translate() where those are supposed to be filtered out.

This makes it impossible to add external JS files on a non-en site.

As a workaround, you can specifiy a protocol-agnostic URL (//example.org/file.js), but that just gets you around that check, I have no idea what actually happens then.

I also have no idea what exactly caused this?

Proposed resolution

Filter out external JS files.

Remaining tasks

User interface changes

API changes

πŸ› Bug report
Status

Closed: duplicate

Version

9.5

Component
LocaleΒ  β†’

Last updated 2 days ago

Created by

πŸ‡¨πŸ‡­Switzerland berdir Switzerland

Live updates comments and jobs are added and updated live.
  • Needs tests

    The change is currently missing an automated test that fails when run with the original code, and succeeds when the bug has been fixed.

  • Needs backport to D7

    After being applied to the 8.x branch, it should be considered for backport to the 7.x branch. Note: This tag should generally remain even after the backport has been written, approved, and committed.

  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024