Moodle
  1. Moodle
  2. MDL-30208

HTML editor mangles background URL filenames

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Won't Fix
    • Affects Version/s: 2.1.2
    • Fix Version/s: None
    • Component/s: HTML Editor (TinyMCE)
    • Labels:
    • Affected Branches:
      MOODLE_21_STABLE
    • Rank:
      26134

      Description

      When a URL is specified as a CSS background in a style attribute, relative URLs are always converted to absolute URLs. However, after that first conversion, the function also mangles URL paths that contain an underscore followed by a number. E.g.

      <p style="background: url('http://example.org/dir_2/filename_2.jpg');">hello</p>
      

      Is converted to:

      <p style="background: url('http://example.org/dir;/filename;.jpg');">hello</p>
      

      The conversion that happens is predictable:

      _0 => &quot;
      _1 => \'
      _2 => ;
      _3 => :
      _4 => ;
      _5 => :
      _6 => _
      _7 => undefined
      _8 => undefined
      _9 => undefined
      

      Replication steps:

      1. Enter this using the raw HTML editor:
        <p style="background: url('http://example.org/dir_2/filename_2.jpg');">hello</p>
        
      2. Then close and re-open the raw HTML editor, and you'll see:
        <p style="background: url('http://example.org/dir;/filename;.jpg');">hello</p>
        

        Activity

        Hide
        Michael de Raadt added a comment -

        Thanks for that. What a piece of investigation work! Kudos.

        I've put that issue on our backlog.

        In the meantime feel free to help us work on this issue. If you are able to provide a patch, please add a patch label so we will spot it.

        Show
        Michael de Raadt added a comment - Thanks for that. What a piece of investigation work! Kudos. I've put that issue on our backlog. In the meantime feel free to help us work on this issue. If you are able to provide a patch, please add a patch label so we will spot it.
        Hide
        Mauno Korpelainen added a comment -

        This should not happen with the latest versions of tinymce.

        I was able to reproduce the issue with a couple months old moodle (with old tinymce) but not with the upgraded versions anymore.

        Show
        Mauno Korpelainen added a comment - This should not happen with the latest versions of tinymce. I was able to reproduce the issue with a couple months old moodle (with old tinymce) but not with the upgraded versions anymore.
        Hide
        Michael de Raadt added a comment -

        Thanks for reporting this issue.

        We have detected that this issue has been inactive for over a year. It was reported as affecting versions that are no longer supported.

        If you believe that this issue is still relevant to current versions (2.5 and beyond), please comment on the issue. Issues left inactive for a further month will be closed.

        Michael d.

        TW9vZGxlDQo=

        Show
        Michael de Raadt added a comment - Thanks for reporting this issue. We have detected that this issue has been inactive for over a year. It was reported as affecting versions that are no longer supported. If you believe that this issue is still relevant to current versions (2.5 and beyond), please comment on the issue. Issues left inactive for a further month will be closed. Michael d. TW9vZGxlDQo=
        Hide
        Michael de Raadt added a comment -

        I'm closing this issue as it has been inactive for over a year has been recorded as affecting versions that are no longer supported.

        This is being done as part of a bulk annual clean-up of issues.

        If you still believe this is an issue in supported versions, please create a new issue.

        Show
        Michael de Raadt added a comment - I'm closing this issue as it has been inactive for over a year has been recorded as affecting versions that are no longer supported. This is being done as part of a bulk annual clean-up of issues. If you still believe this is an issue in supported versions, please create a new issue.

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: