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.

        Attachments

          Activity

            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: