"MDL-25184, fixed regular expression of youtube"
authorDongsheng Cai <unoter@gmail.com>
Fri, 12 Nov 2010 07:26:42 +0000 (07:26 +0000)
committerDongsheng Cai <unoter@gmail.com>
Fri, 12 Nov 2010 07:26:42 +0000 (07:26 +0000)
filter/mediaplugin/filter.php

index 4324a96..59d8151 100644 (file)
@@ -123,7 +123,7 @@ class filter_mediaplugin extends moodle_text_filter {
             $search = '/<a[^>]*href="([^<]*?)youtube.com\/watch\?v=([^"]*)"[^>]*>(.*?)<\/a>/is';
             $newtext = preg_replace_callback($search, 'filter_mediaplugin_youtube_callback', $newtext);
 
-            $search = '/<a.*?href="([^<]*)youtube.com\/v\/([^"]*)"[^>]*>(.*?)<\/a>/is';
+            $search = '/<a[^>]*href="([^<]*)youtube.com\/v\/([^"]*)"[^>]*>(.*?)<\/a>/is';
             $newtext = preg_replace_callback($search, 'filter_mediaplugin_youtube_callback', $newtext);
         }