Moodle
  1. Moodle
  2. MDL-26605

Multimedia plugin - Missing HTML between link and media

    Details

    • Database:
      MySQL
    • Affected Branches:
      MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_19_STABLE
    • Rank:
      16396

      Description

      Insert this code in HTML mode.
      TEXT MIDDLE and LINK will be missing on save. (Must activate multimedia plugin)

      I have tested it in 1.9.10 and 1.9.11+

      But it was working in 1.9.7

      TEXT BEFORE
      <a href="http://www.domain.com/moodle/file.php/123/Test.pdf" target="_blank" title="Lien">LINK</a>
      TEXT MIDDLE
      <a href="http://www.domain.com/moodle/file.php/123/music.mp3">AUDIO LINK</a>
      TEXT AFTER
      

      I think the regex are incorrect in filter.php but they seems to be OK in moodle 2.0 branch

      I moved it to "major" cause it breaks something that was working before..

        Issue Links

          Activity

          Hide
          Petr Škoda added a comment -

          Jonathan Harker reported similar regression in 1.9.11

          The following is HTMLArea generated content, entered as a web page resource:

           
          <p style="text-align: center;"><strong><span style="font-size: medium;">Concrete Videos</span></strong></p>
          <p> </p>
          <div align="center">
          <p><a href="http://xxxxxxx/file.php/6583/Civil_Structures/Concrete Building/Videos/MVI_0142.AVI">Watch Fullscreen<br /></a></p>
          <p><a href="http://xxxxxxx/file.php/6583/Civil_Structures/Concrete Building/Videos/MVI_0143.AVI">Watch Fullscreen<br /></a></p>
          <p><a href="http://xxxxxxx/file.php/6583/Civil_Structures/Concrete Building/Videos/MVI_0144.AVI">Watch Fullscreen<br /></a></p>
          <p><a href="http://xxxxxxx/file.php/6583/Civil_Structures/Concrete Building/Videos/MVI_0156.AVI">Watch Fullscreen<br /></a></p>
          <p><a href="http://xxxxxxx/file.php/6583/Civil_Structures/Concrete Building/Videos/MVI_0160.AVI">Watch Fullscreen<br /></a></p>
          <p><a href="http://xxxxxxx/file.php/6583/Civil_Structures/Concrete Building/Videos/MVI_0161.wmv">Watch Fullscreen<br /></a></p>
          </div>
          <p> </p>
          

          The result is that only the last video is shown. Reverting the three 1.9.10-1.9.11 commits fixes the problem (all six videos are shown).

          Show
          Petr Škoda added a comment - Jonathan Harker reported similar regression in 1.9.11 The following is HTMLArea generated content, entered as a web page resource: <p style="text-align: center;"><strong><span style="font-size: medium;">Concrete Videos</span></strong></p> <p> </p> <div align="center"> <p><a href="http://xxxxxxx/file.php/6583/Civil_Structures/Concrete Building/Videos/MVI_0142.AVI">Watch Fullscreen<br /></a></p> <p><a href="http://xxxxxxx/file.php/6583/Civil_Structures/Concrete Building/Videos/MVI_0143.AVI">Watch Fullscreen<br /></a></p> <p><a href="http://xxxxxxx/file.php/6583/Civil_Structures/Concrete Building/Videos/MVI_0144.AVI">Watch Fullscreen<br /></a></p> <p><a href="http://xxxxxxx/file.php/6583/Civil_Structures/Concrete Building/Videos/MVI_0156.AVI">Watch Fullscreen<br /></a></p> <p><a href="http://xxxxxxx/file.php/6583/Civil_Structures/Concrete Building/Videos/MVI_0160.AVI">Watch Fullscreen<br /></a></p> <p><a href="http://xxxxxxx/file.php/6583/Civil_Structures/Concrete Building/Videos/MVI_0161.wmv">Watch Fullscreen<br /></a></p> </div> <p> </p> The result is that only the last video is shown. Reverting the three 1.9.10-1.9.11 commits fixes the problem (all six videos are shown).
          Hide
          Petr Škoda added a comment -

          From Eloy:

          <p><a title="mp3" href="http://www.pacdv.com/sounds/applause-sounds/app-5.mp3">mp3</a></p>
          <hr />
          <p><a title="swf" href="http://moodle.org/invaders.swf">swf</a></p>
          <hr />
          <p><a title="mov" href="http://www.thirdpartyplugins.com/stormtracer/movies/bubbles.mov?d=240x180">mov</a></p>
          <hr />
          <p><a title="vmv" href="http://www.socialtext.net/data/workspaces/exchange/attachments/a_simple_example_of_wmv_video_file:20090811235232-0-16969/original/travelingr_83q3cvch.wmv?d=240x180">vmv</a></p>
          <hr />
          <p><a title="mpg" href="http://www.cs.ubc.ca/nest/imager/contributions/forsey/dragon/mpeg/talk.mpg?d=240x180">mpg</a></p>
          <hr />
          <p><a title="avi" href="http://www.arielnet.com/topics2/AVI_files/Hammer_Sedick0001.avi?d=240x180">avi</a></p>
          <hr />
          <p><a title="flv" href="http://www.publiblanes.net/video_flv/flashplayer_swf/RUBIK_en_1_minuto.flv?d=240x180">flv</a></p>
          <hr />
          <p><a title="ram" href="http://www17.real.com/help/library/guides/realone/IntroToStreaming/samples/ramfiles/doublesize.ram">ram</a></p>
          <hr />
          <p>rpm</p>
          <hr />
          <p><a title="ra" href="http://mcprog.homedns.org/sound/AlleluiaHeIsComing.ra">rm</a></p>
          <hr />
          <p><a title="youtube" href="http://www.youtube.com/watch?v=FUrhl974wSE">youtubelinks</a></p>
          <hr />
          <p><a title="ogg" href="http://dspace.wijiti.com/i/testing/bitstream/123456789/16/1/06_-_Vivaldi_Summer_mvt_3_Presto_-_John_Harrison_violin.ogg">ogg</a></p>
          <hr />
          <p><a title="ogv" href="http://upload.wikimedia.org/wikipedia/commons/6/65/Examplevideo.ogv">ogv</a></p>
          <hr />
          <p><a title="gif" href="http://upload.wikimedia.org/wikipedia/en/8/8f/Example.gif">image gif</a></p>
          <hr />
          <p><a title="png" href="http://images2.wikia.nocookie.net/__cb20101001183661/htmlcss/images/2/28/PNG_Example_2.png">image png</a></p>
          <hr />
          
          Show
          Petr Škoda added a comment - From Eloy: <p><a title= "mp3" href= "http: //www.pacdv.com/sounds/applause-sounds/app-5.mp3" >mp3</a></p> <hr /> <p><a title= "swf" href= "http: //moodle.org/invaders.swf" >swf</a></p> <hr /> <p><a title= "mov" href= "http: //www.thirdpartyplugins.com/stormtracer/movies/bubbles.mov?d=240x180" >mov</a></p> <hr /> <p><a title= "vmv" href= "http: //www.socialtext.net/data/workspaces/exchange/attachments/a_simple_example_of_wmv_video_file:20090811235232-0-16969/original/travelingr_83q3cvch.wmv?d=240x180" >vmv</a></p> <hr /> <p><a title= "mpg" href= "http: //www.cs.ubc.ca/nest/imager/contributions/forsey/dragon/mpeg/talk.mpg?d=240x180" >mpg</a></p> <hr /> <p><a title= "avi" href= "http: //www.arielnet.com/topics2/AVI_files/Hammer_Sedick0001.avi?d=240x180" >avi</a></p> <hr /> <p><a title= "flv" href= "http: //www.publiblanes.net/video_flv/flashplayer_swf/RUBIK_en_1_minuto.flv?d=240x180" >flv</a></p> <hr /> <p><a title= "ram" href= "http: //www17.real.com/help/library/guides/realone/IntroToStreaming/samples/ramfiles/doublesize.ram" >ram</a></p> <hr /> <p>rpm</p> <hr /> <p><a title= "ra" href= "http: //mcprog.homedns.org/sound/AlleluiaHeIsComing.ra" >rm</a></p> <hr /> <p><a title= "youtube" href= "http: //www.youtube.com/watch?v=FUrhl974wSE" >youtubelinks</a></p> <hr /> <p><a title= "ogg" href= "http: //dspace.wijiti.com/i/testing/bitstream/123456789/16/1/06_-_Vivaldi_Summer_mvt_3_Presto_-_John_Harrison_violin.ogg" >ogg</a></p> <hr /> <p><a title= "ogv" href= "http: //upload.wikimedia.org/wikipedia/commons/6/65/Examplevideo.ogv" >ogv</a></p> <hr /> <p><a title= "gif" href= "http: //upload.wikimedia.org/wikipedia/en/8/8f/Example.gif" >image gif</a></p> <hr /> <p><a title= "png" href= "http: //images2.wikia.nocookie.net/__cb20101001183661/htmlcss/images/2/28/PNG_Example_2.png" >image png</a></p> <hr />
          Hide
          Petr Škoda added a comment -

          This should be fixed in the next weekly build, thanks a lot!

          Show
          Petr Škoda added a comment - This should be fixed in the next weekly build, thanks a lot!
          Hide
          David Mudrak added a comment -

          Tested using the HTML code fragments provided. Seems to work for me as expected.

          Show
          David Mudrak added a comment - Tested using the HTML code fragments provided. Seems to work for me as expected.
          Hide
          Sam Marshall added a comment -

          This behaviour is not working correctly using the example given at the top of this bug (repeated here for clarity):

          TEXT BEFORE
          <a href="http://www.domain.com/moodle/file.php/123/Test.pdf" target="_blank" title="Lien">LINK</a>
          TEXT MIDDLE
          <a href="http://www.domain.com/moodle/file.php/123/music.mp3">AUDIO LINK</a>
          TEXT AFTER
          

          Using current 1.9 with the media filter enabled, we added this as text in a web page. As a result of these changes, the text AUDIO LINK no longer appears. Instead it is replaced by the text 'MP3 audio'.

          This has caused a problem for some of our pages where we used the link text e.g. to include the track name, so it would be like

          Track 3 - Investigating the sclerosis factor of multi-variable gibberish
          [audio player buttons]

          and you could click the track name to download.

          Now they've lost all their track names...

          Could anyone confirm why the text was replaced and if this is a security requirement of some kind? We're thinking about patching it back locally. Our code in this area is majorly hacked already.

          I'm a bit surprised if nobody else relied on this also...

          Show
          Sam Marshall added a comment - This behaviour is not working correctly using the example given at the top of this bug (repeated here for clarity): TEXT BEFORE <a href= "http: //www.domain.com/moodle/file.php/123/Test.pdf" target= "_blank" title= "Lien" >LINK</a> TEXT MIDDLE <a href= "http: //www.domain.com/moodle/file.php/123/music.mp3" >AUDIO LINK</a> TEXT AFTER Using current 1.9 with the media filter enabled, we added this as text in a web page. As a result of these changes, the text AUDIO LINK no longer appears. Instead it is replaced by the text 'MP3 audio'. This has caused a problem for some of our pages where we used the link text e.g. to include the track name, so it would be like Track 3 - Investigating the sclerosis factor of multi-variable gibberish [audio player buttons] and you could click the track name to download. Now they've lost all their track names... Could anyone confirm why the text was replaced and if this is a security requirement of some kind? We're thinking about patching it back locally. Our code in this area is majorly hacked already. I'm a bit surprised if nobody else relied on this also...
          Hide
          Petr Škoda added a comment -

          Hello,

          this was changed multiple times and people keep requesting different behaviour. In latest 2.0.2+ the links are displayed for the legacy players only (quicktime, wmp and real player because they often do not work), the rest is using the original tag content (or "Mp3 file" if missing or if url specified) in the fallback text only (when flash not available).

          I doubt we can satisfy everybody, solution might be a new setting, unfortunately the filter settings are not properly implemented, we might have to keep abusing global $CFG settings...

          Show
          Petr Škoda added a comment - Hello, this was changed multiple times and people keep requesting different behaviour. In latest 2.0.2+ the links are displayed for the legacy players only (quicktime, wmp and real player because they often do not work), the rest is using the original tag content (or "Mp3 file" if missing or if url specified) in the fallback text only (when flash not available). I doubt we can satisfy everybody, solution might be a new setting, unfortunately the filter settings are not properly implemented, we might have to keep abusing global $CFG settings...
          Hide
          Petr Škoda added a comment -

          Sam: this bug was about missing "TEXT MIDDLE" not the "AUDIO LINK".

          Show
          Petr Škoda added a comment - Sam: this bug was about missing "TEXT MIDDLE" not the "AUDIO LINK".
          Hide
          Sam Marshall added a comment -

          Petr: Well actually the original bug was about both TEXT MIDDLE and LINK (but yes, audio link wasn't mentioned and the bug was used to fix the more serious issue). I just commented here because the example in this bug still 'fails' depending on what you think is correct.

          To be honest I am just trying to find out if there is any security reason for hiding the link text. I think from your answer that there is no security reason, as it is still displayed for certain types (the legacy/crappy ones). Consequently we can safely change our local 1.9 system to put it back.

          There is no need for moodle to take action on this, maybe nobody else has used it the way our users did (to include track names)!

          Show
          Sam Marshall added a comment - Petr: Well actually the original bug was about both TEXT MIDDLE and LINK (but yes, audio link wasn't mentioned and the bug was used to fix the more serious issue). I just commented here because the example in this bug still 'fails' depending on what you think is correct. To be honest I am just trying to find out if there is any security reason for hiding the link text. I think from your answer that there is no security reason, as it is still displayed for certain types (the legacy/crappy ones). Consequently we can safely change our local 1.9 system to put it back. There is no need for moodle to take action on this, maybe nobody else has used it the way our users did (to include track names)!
          Hide
          Rob Davenport added a comment -

          We have many links to media that use meaningful text (track names for example) - amongst other things this is an accessibility issue. Generic "MP3 File" link doesn't cut it. Thought this was resolved from Petr's initial contribution, and have updated our sizable Moodle installation only to find it is still broken - yes broken - it was working as expected, now it doesn't. The filter now ignores content that was put there for a reason - is that good form?

          Security models shouldn't rely on not advertising a URL, when the page source will tell any user who can read simple HTML.

          So how do we restore this functionality for our instance?
          Frustrated and confused over this, there are 100's of links in our site affected.

          Show
          Rob Davenport added a comment - We have many links to media that use meaningful text (track names for example) - amongst other things this is an accessibility issue. Generic "MP3 File" link doesn't cut it. Thought this was resolved from Petr's initial contribution, and have updated our sizable Moodle installation only to find it is still broken - yes broken - it was working as expected, now it doesn't. The filter now ignores content that was put there for a reason - is that good form? Security models shouldn't rely on not advertising a URL, when the page source will tell any user who can read simple HTML. So how do we restore this functionality for our instance? Frustrated and confused over this, there are 100's of links in our site affected.
          Hide
          Sam Marshall added a comment -

          Rob: I took from this discussion that there is no security issue regarding the change in link text. In other words it is safe to put the link text back by hacking that part of the code if you have the capacity and do not want to wait for moodle HQ to address the issue. We have done this in our system (unfortunately it contains many many local customisations in this file, so I can't just send you the code).

          Show
          Sam Marshall added a comment - Rob: I took from this discussion that there is no security issue regarding the change in link text. In other words it is safe to put the link text back by hacking that part of the code if you have the capacity and do not want to wait for moodle HQ to address the issue. We have done this in our system (unfortunately it contains many many local customisations in this file, so I can't just send you the code).
          Hide
          Kien Vu added a comment -

          Hi,

          After looking to this issue, I have found the temporarily way to fix this.

          Open the file : [moodle root]/filter/mediaplugin/filter.php

          In function mediaplugin_filter_mp3_callback($link), find this line:

          $printlink = '<a href="'.$url.'">'.get_string('mp3audio', 'mediaplugin').'</a>';

          comment it and replace by this line:

          $printlink=$link[0];

          Do the similar steps for other functions mediaplugin_filter_othertype_callback($link). if they have the same issue.

          Hope this can be fixed in next release version of Moodle 1.9

          Cheers,
          Kien

          Show
          Kien Vu added a comment - Hi, After looking to this issue, I have found the temporarily way to fix this. Open the file : [moodle root] /filter/mediaplugin/filter.php In function mediaplugin_filter_mp3_callback($link), find this line: $printlink = '<a href="'.$url.'">'.get_string('mp3audio', 'mediaplugin').'</a>'; comment it and replace by this line: $printlink=$link [0] ; Do the similar steps for other functions mediaplugin_filter_othertype_callback($link). if they have the same issue. Hope this can be fixed in next release version of Moodle 1.9 Cheers, Kien
          Hide
          Bill Burgos added a comment -

          Still not working here. Can give login details to client site per request.

          Show
          Bill Burgos added a comment - Still not working here. Can give login details to client site per request.
          Hide
          David Le Blanc added a comment - - edited

          Thank you for this fix Kien. I cannot tell you how much time I have spent working on this without success until your post.

          Show
          David Le Blanc added a comment - - edited Thank you for this fix Kien. I cannot tell you how much time I have spent working on this without success until your post.

            People

            • Votes:
              3 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: