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

convert_urls_into_links() is converting inside image tags

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.9.7
    • Fix Version/s: 1.9.8
    • Component/s: Usability
    • Labels:
      None
    • Database:
      Any
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE

      Description

      It appears that the convert_urls_into_links() function is converting URLs that are inside image tags. For instance, it converts this:

      <img src="http://moodle.org/logo/logo-240x60.gif" />

      into this:

      <img src="<a href="http://moodle.org/logo/logo-240x60.gif" target="_blank">http://moodle.org/logo/logo-240x60.gif</a>" />

      I can confirm that it is the convert_urls_into_links() function that's causing this by commenting out line ~2246 of lib/weblib.php that reads:

      convert_urls_into_links($text);

      With that line commented out, the images display as expected with the correct HTML.

      P.S. I'm assuming this has to do with the changes made in MDL-20826, but I wasn't sure whether or not I should create a new issue since that one is "Resolved."

        Gliffy Diagrams

          Attachments

          1. Broken links.jpg
            Broken links.jpg
            65 kB
          2. convert_urls_into_links.patch
            3 kB
          3. patch.txt
            3 kB
          4. patched.php
            254 kB
          5. patched2.php
            254 kB
          6. quiz_buggy_description.txt
            0.6 kB
          7. testweblib.patch
            1 kB
          8. weblib.patch
            0.9 kB

            Issue Links

              Activity

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    25/Mar/10