Moodle
  1. Moodle
  2. MDL-1185

JavaScript code is altered in javascript sections by replace_smilies()

    Details

    • Type: Bug Bug
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.2.1
    • Fix Version/s: None
    • Component/s: General
    • Labels:
      None
    • Environment:
      All
    • Affected Branches:
      MOODLE_12_STABLE
    • Rank:
      8269

      Description

      Breaking code!!!!

      In one html page using layers I've some javascript functions to hide/show them. The code includes expresions like:

      'visible':(v=='hide')?'

      and the is transformed to <img alt=triste width=15 height=15 src=http://www.formacionenlared.com/moodle/pix/s/sad.gif />

      This can break a lot of good js code!!!

        Activity

        Hide
        Martin Dougiamas added a comment -

        From Eloy Lafuente (stronk7 at moodle.org) Thursday, 25 March 2004, 03:26 AM:

        Hi,

        I've included some modifications to the replace_smilies() function in order to avoid replacing smilies in <script> sections. It's based in some code from Wiliams Castillo and his glossary filter.

        I've sent the updated library to the bugs reporter (thanks jouse 2001) to check it. My own test seems to work fine now.

        I've sent here, as attachment, the weblib.php modified version instead of committing it to CVS directly (because 1.2.1 is near and I don't want to run in possible risks...). So Martin, you decide if changes are solid

        Anyway, I'm thinking two things about this issue:

        1.-Perhaps more 'take out' zones should be included (any html tag, contents out of head, links...).

        2.-Perhaps transforming the replace_smilies() to a standard filter, should help adding modularity and allowing a lot of contents (upload resources, posts...) to be cached (by the filters system) at all, because all the transformations will happen under it...

        Comments will be welcome, ciao

        From Eloy Lafuente (stronk7 at moodle.org) Thursday, 25 March 2004, 03:28 AM:

        Sorry, my previous text was stripped (some awful filter in the bug system, perhaps? :-D

        Hi,

        I've included some modifications to the replace_smilies() function in order to avoid replacing smilies inside 'script' tags/sections. It's based in some code from Wiliams Castillo and his glossary filter.

        I've sent the updated library to the bugs reporter (thanks jouse 2001) to check it. My own test seems to work fine now.

        I've sent here, as attachment, the weblib.php modified version instead of committing it to CVS directly (because 1.2.1 is near and I don't want to run in possible risks...). So Martin, you decide if changes are solid

        Anyway, I'm thinking two things about this issue:

        1.-Perhaps more 'take out' zones should be included (any html tag, contents out of head, links...).

        2.-Perhaps transforming the replace_smilies() in a standard filter, should help adding modularity and allowing a lot of contents (upload resources, posts...) to be cached at all, because all the transformations happen under filters...

        Comments will be welcome, ciao

        From Eloy Lafuente (stronk7 at moodle.org) Thursday, 25 March 2004, 03:31 AM:

        </script>

        Curiosly I wrote the script tag two posts above ant thet went out until I've closed the tag in this (my 4th post to the bug). A bug's bug ? :-D

        I repeat my previous text here

        ==========================================

        Hi,

        I've included some modifications to the replace_smilies() function in order to avoid replacing smilies inside 'script' tags/sections. It's based in some code from Wiliams Castillo and his glossary filter.

        I've sent the updated library to the bugs reporter (thanks jouse 2001) to check it. My own test seems to work fine now.

        I've sent here, as attachment, the weblib.php modified version instead of committing it to CVS directly (because 1.2.1 is near and I don't want to run in possible risks...). So Martin, you decide if changes are solid

        Anyway, I'm thinking two things about this issue:

        1.-Perhaps more 'take out' zones should be included (any html tag, contents out of head, links...).

        2.-Perhaps transforming the replace_smilies() in a standard filter, should help adding modularity and allowing a lot of contents (upload resources, posts...) to be cached at all, because all the transformations happen under filters...

        Comments will be welcome, ciao

        From Eloy Lafuente (stronk7 at moodle.org) Thursday, 25 March 2004, 08:11 AM:

        Inform: Some users have confirmed that, now, their js pages are working fine...

        From Martin Dougiamas (martin at moodle.com) Thursday, 25 March 2004, 02:42 PM:

        Looks good to me! Checked in!

        Show
        Martin Dougiamas added a comment - From Eloy Lafuente (stronk7 at moodle.org) Thursday, 25 March 2004, 03:26 AM: Hi, I've included some modifications to the replace_smilies() function in order to avoid replacing smilies in <script> sections. It's based in some code from Wiliams Castillo and his glossary filter. I've sent the updated library to the bugs reporter (thanks jouse 2001) to check it. My own test seems to work fine now. I've sent here, as attachment, the weblib.php modified version instead of committing it to CVS directly (because 1.2.1 is near and I don't want to run in possible risks...). So Martin, you decide if changes are solid Anyway, I'm thinking two things about this issue: 1.-Perhaps more 'take out' zones should be included (any html tag, contents out of head, links...). 2.-Perhaps transforming the replace_smilies() to a standard filter, should help adding modularity and allowing a lot of contents (upload resources, posts...) to be cached (by the filters system) at all, because all the transformations will happen under it... Comments will be welcome, ciao From Eloy Lafuente (stronk7 at moodle.org) Thursday, 25 March 2004, 03:28 AM: Sorry, my previous text was stripped (some awful filter in the bug system, perhaps? :-D Hi, I've included some modifications to the replace_smilies() function in order to avoid replacing smilies inside 'script' tags/sections. It's based in some code from Wiliams Castillo and his glossary filter. I've sent the updated library to the bugs reporter (thanks jouse 2001) to check it. My own test seems to work fine now. I've sent here, as attachment, the weblib.php modified version instead of committing it to CVS directly (because 1.2.1 is near and I don't want to run in possible risks...). So Martin, you decide if changes are solid Anyway, I'm thinking two things about this issue: 1.-Perhaps more 'take out' zones should be included (any html tag, contents out of head, links...). 2.-Perhaps transforming the replace_smilies() in a standard filter, should help adding modularity and allowing a lot of contents (upload resources, posts...) to be cached at all, because all the transformations happen under filters... Comments will be welcome, ciao From Eloy Lafuente (stronk7 at moodle.org) Thursday, 25 March 2004, 03:31 AM: </script> Curiosly I wrote the script tag two posts above ant thet went out until I've closed the tag in this (my 4th post to the bug). A bug's bug ? :-D I repeat my previous text here ========================================== Hi, I've included some modifications to the replace_smilies() function in order to avoid replacing smilies inside 'script' tags/sections. It's based in some code from Wiliams Castillo and his glossary filter. I've sent the updated library to the bugs reporter (thanks jouse 2001) to check it. My own test seems to work fine now. I've sent here, as attachment, the weblib.php modified version instead of committing it to CVS directly (because 1.2.1 is near and I don't want to run in possible risks...). So Martin, you decide if changes are solid Anyway, I'm thinking two things about this issue: 1.-Perhaps more 'take out' zones should be included (any html tag, contents out of head, links...). 2.-Perhaps transforming the replace_smilies() in a standard filter, should help adding modularity and allowing a lot of contents (upload resources, posts...) to be cached at all, because all the transformations happen under filters... Comments will be welcome, ciao From Eloy Lafuente (stronk7 at moodle.org) Thursday, 25 March 2004, 08:11 AM: Inform: Some users have confirmed that, now, their js pages are working fine... From Martin Dougiamas (martin at moodle.com) Thursday, 25 March 2004, 02:42 PM: Looks good to me! Checked in!
        Hide
        Michael Blake added a comment -

        assign to a valid user

        Show
        Michael Blake added a comment - assign to a valid user

          People

          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: