Uploaded image for project: 'LAMS Development'
  1. LAMS Development
  2. LDEV-2387

Wrong rendering of FCKEditor if its value contains double dash

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 2.4
    • Fix Version/s: 2.4
    • Component/s: General, Tools
    • Labels:
      None

      Description

      let's say we have FCK editor somewhere on the page.
      Enter text containing double dash (--) in FCKEditor
      then reopen the page with FCK Editor -- html markup will be broken down.


      this happens because we render FCKEditor's <script> thing surrounded by comment tag <!-- -->
      (<!--
      <script type="text/javascript">
      var oFCKeditor=new FCKeditor('assessment.instructions');
      oFCKeditor.BasePath= "http://127.0.0.1:8080/lams//fckeditor/";
      oFCKeditor.ToolbarSet= "Default";
      oFCKeditor.Value= '<div>Instructions</div>';

      oFCKeditor.Config["ImageBrowserURL"]= "http://127.0.0.1:8080/lams//fckeditor/editor/filemanager/browser/default/browser.html?Type=Image&amp;Connector=connectors/jsp/connector&amp;CurrentFolder=/ff80818122109174012280be1bd60c74/";
      oFCKeditor.Config["LinkBrowserURL"]= "http://127.0.0.1:8080/lams//fckeditor/editor/filemanager/browser/default/browser.html?Connector=connectors/jsp/connector&amp;CurrentFolder=/ff80818122109174012280be1bd60c74/";
      oFCKeditor.Config["FlashBrowserURL"]= "http://127.0.0.1:8080/lams//fckeditor/editor/filemanager/browser/default/browser.html?Type=Flash&amp;Connector=connectors/jsp/connector&amp;CurrentFolder=/ff80818122109174012280be1bd60c74/";
      oFCKeditor.Config["ImageUploadURL"]= "http://127.0.0.1:8080/lams//fckeditor/editor/filemanager/upload/simpleuploader?Type=Image&CurrentFolder=/ff80818122109174012280be1bd60c74/";
      oFCKeditor.Config["LinkUploadURL"]= "http://127.0.0.1:8080/lams//fckeditor/editor/filemanager/upload/simpleuploader?Type=File&CurrentFolder=/ff80818122109174012280be1bd60c74/";
      oFCKeditor.Config["FlashUploadURL"]= "http://127.0.0.1:8080/lams//fckeditor/editor/filemanager/upload/simpleuploader?Type=Flash&CurrentFolder=/ff80818122109174012280be1bd60c74/";

      oFCKeditor.Config["AutoDetectLanguage"]= false ;
      oFCKeditor.Config["DefaultLanguage"]= "en-au" ;

      oFCKeditor.Config["ToolbarStartExpanded"]= "true" ;

      oFCKeditor.Create();
      </script>
      -->
      )

      so when FCKEditor's value contains "--" it's treated as the end of comment and everything else that goes after the ">" is treated as plain text and not JavaScript.

      so I think here are 2 possible solutions: either remove comment tag <!-- --> (because I guess there is no real need for them in new browsers)
      or just escape those dashes when saving FCKEditor's value

        Activity

        Hide
        ernieg Ernie Ghiglione added a comment -
        Cool.

        Then, let's go right ahead with the rest of the tools.

        Is this done with the fckeditor jsp tag?
        Show
        ernieg Ernie Ghiglione added a comment - Cool. Then, let's go right ahead with the rest of the tools. Is this done with the fckeditor jsp tag?
        Hide
        dronych Andrey Balan added a comment -
        sorry, I just forgot to answer

        and yes, it's done with the help of jsp tag
        Show
        dronych Andrey Balan added a comment - sorry, I just forgot to answer and yes, it's done with the help of jsp tag
        Hide
        ernieg Ernie Ghiglione added a comment -
        OK, go right ahead please.
        Show
        ernieg Ernie Ghiglione added a comment - OK, go right ahead please.
        Hide
        dronych Andrey Balan added a comment -
        done
        Show
        dronych Andrey Balan added a comment - done
        Hide
        ernieg Ernie Ghiglione added a comment -
        Tested and closed!
        Show
        ernieg Ernie Ghiglione added a comment - Tested and closed!

          People

          • Assignee:
            dronych Andrey Balan
            Reporter:
            dronych Andrey Balan
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development