MP3 filter not working if there are 'new lines' between tags

MP3 filter not working if there are 'new lines' between tags

by Germán Matías -
Number of replies: 3

I found out that the MP3 media filter wasn´t working if there were 'new lines' between tags.

Ie not working:

<p align="center"><a href="../audios/2-1.mp3"><img 

src="../images/cassette.gif" border="0" width="33" height="23"></a></p> 

Ie working:

<p align="center"><a href="../audios/2-1.mp3"><img src="../images/cassette.gif" border="0" width="33" height="23"></a></p> 

So, I modified the code in 'filter/mediaplugin/filter.php' adding an 's' in the line where the search string is defined:

$search = '/<a(.*?)href=\"([^<]+)\.mp3\"([^>]*)>(.*?)<\/a>/is';

That let the script treat the page text as a single line and resolve my problem.

I´m sorry if it has been discussed in other posts, I couldn´t find.

Someone tell me if should I send it to bugs track?

Average of ratings: Useful (1)
In reply to Germán Matías

Re: MP3 filter not working if there are 'new lines' between tags

by Helen Foster -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers Picture of Translators
Hi Germán,

Thanks for your solution. approve Please report it in the bug tracker. smile
In reply to Germán Matías

Re: MP3 filter not working if there are 'new lines' between tags

by Martin Dougiamas -
Picture of Core developers Picture of Documentation writers Picture of Moodle HQ Picture of Particularly helpful Moodlers Picture of Plugin developers Picture of Testers
Putting it in the bug tracker is always a good idea, but I've already put this fix into CVS now (1.5.X and HEAD) so don't worry.  Thanks for the fix!
In reply to Martin Dougiamas

Re: MP3 filter not working if there are 'new lines' between tags

by Germán Matías -

There´s a lot of fixes I have implemented at our University here in Buenos Aires. I hope I´ll have more time to participate in these forums soon and let you know about them ..

Thank YOU all for the great work you are doing with Moodle every day ..