Uploaded image for project: 'phpBB3'
  1. phpBB3
  2. PHPBB3-11275

editor.js::colorPalette() breaks page with document.write > add proper target

    Details

    • Type: Improvement
    • Status: Unverified Fix
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.0.11, 3.1.0-dev
    • Fix Version/s: 3.1.0-a1
    • Component/s: Styles
    • Labels:
      None

      Description

      The current (3.0.11) function colorPalette(dir, width, height) in /styles/prosilver/template/editor.js uses document.write to directly write to the browser output. In this current state it is impossible to call this function from outside its target-environment or with another javascript. The document.write will cause the entire page to be overwritten.

      I'm proposing the usage of a variable to store the output while its being composed rather than writing it directly to the browser, the addition of an optional target argument and then the fallback to document.write if no target is present.

      I have attached how the new colorPallete() could look like, the +"\n" are optional, but replaces the old "writeln".

      This modification is fully backwards compatible and will not break any current implementation.

        Activity

        Hide
        Arty Vjacheslav Trushkin added a comment -

        Fixing this for 3.0 would break many custom styles. I think it would be a good idea to fix it for 3.1 though.

        Show
        Arty Vjacheslav Trushkin added a comment - Fixing this for 3.0 would break many custom styles. I think it would be a good idea to fix it for 3.1 though.
        Hide
        Arty Vjacheslav Trushkin added a comment -

        Patch for 3.1. Also replaces <script> with INCLUDEJS for editor.js.

        Show
        Arty Vjacheslav Trushkin added a comment - Patch for 3.1. Also replaces <script> with INCLUDEJS for editor.js.
        Hide
        bantu Andreas Fischer added a comment -

        Not fixing for 3.0 is fine.

        Show
        bantu Andreas Fischer added a comment - Not fixing for 3.0 is fine.

          People

          • Assignee:
            EXreaction EXreaction [X] (Inactive)
            Reporter:
            vindex vindex [X] (Inactive)
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development