Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-25836

TinyMCE strips src attributes from <script> tags

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.1
    • Fix Version/s: 2.0.2
    • Component/s: HTML Editor (TinyMCE)
    • Labels:
      None
    • Affected Branches:
      MOODLE_20_STABLE
    • Fixed Branches:
      MOODLE_20_STABLE

      Description

      If you paste some HTML source into TinyMCE containing a script tag with src attribute, like:

      <script src="http://widgets.twimg.com/j/2/widget.js"></script>

      TinyMCE will strip the src attribute and leave <script></script> there.

      This happens for all users, including those with trusted content capability.

      I believe this is a bug because:
      a) Moodle 1.9 used to allow this, and it's necessary for embedding things such as twitter widgets, etc into HTML blocks.
      b) If I turn off javascript and circumvent TinyMCE, I can paste my script tags into the textfield and save it without problems. So it's not Moodle that strips it, it's TinyMCE.

        Gliffy Diagrams

          Attachments

            Activity

              People

              • Votes:
                1 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  21/Feb/11