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

Glossary Autolink replace javascript in resources

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.5, 1.9.1, 2.1, 2.2
    • Fix Version/s: 2.2
    • Component/s: Glossary
    • Labels:
      None
    • Testing Instructions:
      Hide

      Testing:
      1) Make sure you have turned on the 'Glossary auto linking' under Site administration -> Plugins -> Filters -> Manage filters
      2) Now go to any of your testing course to create a glossary activity. Make sure you have set the 'Automatically link glossary entries' to Yes.
      3) Create an entry called 'alert' in this glossary. Make sure you have ticked the box for 'This entry should be automatically linked'.
      4) Next we need to create a page activity which containing the glossary entry 'alert' in the javascript. To add javascript to the page content, we must first disabled the HTML editor as it automatically removes all the javascript tag when you save the page.
      5) Turn off the HTML editor by going to 'edit my profile'. Under 'When editing text', choose 'Use standard web forms' from the dropdown.
      6) Go to the same course which contains the glossary, create a 'Page activity'.
      7) Fill in the Name and Description fields with anything you like. Under the 'Page content box', copy the code below and click 'Save and display'
      <p>Glossary entry alert should not be autolinked in javascript.</p>
      <script language="JavaScript" type="text/javascript">
      alert ("hello world");
      </script>

      Expected result: When you save and view the page, the alert text ought to display.
      Actual result prior to this fix: The alert does not run. If you view the page source, you will find the alert has been turned into glossary link.

      Show
      Testing: 1) Make sure you have turned on the 'Glossary auto linking' under Site administration -> Plugins -> Filters -> Manage filters 2) Now go to any of your testing course to create a glossary activity. Make sure you have set the 'Automatically link glossary entries' to Yes. 3) Create an entry called 'alert' in this glossary. Make sure you have ticked the box for 'This entry should be automatically linked'. 4) Next we need to create a page activity which containing the glossary entry 'alert' in the javascript. To add javascript to the page content, we must first disabled the HTML editor as it automatically removes all the javascript tag when you save the page. 5) Turn off the HTML editor by going to 'edit my profile'. Under 'When editing text', choose 'Use standard web forms' from the dropdown. 6) Go to the same course which contains the glossary, create a 'Page activity'. 7) Fill in the Name and Description fields with anything you like. Under the 'Page content box', copy the code below and click 'Save and display' <p>Glossary entry alert should not be autolinked in javascript.</p> <script language="JavaScript" type="text/javascript"> alert ("hello world"); </script> Expected result: When you save and view the page, the alert text ought to display. Actual result prior to this fix: The alert does not run. If you view the page source, you will find the alert has been turned into glossary link.
    • Affected Branches:
      MOODLE_18_STABLE, MOODLE_19_STABLE, MOODLE_21_STABLE, MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-15377-master

      Description

      Administration > Modules > Filters (Manage Filters for 1.9) > Enable glossary Auto-link (Filer uploaded files: all files for 1.9)
      In a course create a glossary with the entry name "else". Enter a description (but not "else"). Choose to automatically link this entry.
      In the same course create a file resource. Use the index.html file attached to this issue.
      Save.
      Open the resource, and view source. "else" keyword from javascript (line 167 in the index.html file) has been replaced by the glossary entry.

        Gliffy Diagrams

          Attachments

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  5/Dec/11