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

convert_urls_into_links() is converting inside image tags

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Major Major
    • 1.9.8
    • 1.9.7
    • Usability
    • None
    • Any
    • MOODLE_19_STABLE
    • MOODLE_19_STABLE

      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."

        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

            andyjdavis Andrew Davis
            jnrbsn Jonathan Robson (Inactive)
            Nobody Nobody (Inactive)
            Votes:
            8 Vote for this issue
            Watchers:
            15 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.