Index: weblib.php
===================================================================
RCS file: /cvsroot/moodle/moodle/lib/weblib.php,v
retrieving revision 1.970.2.126
diff -u -r1.970.2.126 weblib.php
--- weblib.php	17 Jan 2009 18:09:38 -0000	1.970.2.126
+++ weblib.php	20 Jan 2009 12:02:44 -0000
@@ -43,6 +43,8 @@
 
 require_once("$CFG->libdir/ajax/ajaxlib.php");
 
+require_once("$CFG->libdir/videoembedding/lib.php");
+
 /// Constants
 
 /// Define text formatting types ... eventually we can add Wiki, BBcode etc
@@ -2005,6 +2007,9 @@
                 $text = preg_replace('/(&#[0-9]+)(;?)/', "\\1;", $text);
                 $text = preg_replace('/(&#x[0-9a-fA-F]+)(;?)/', "\\1;", $text);
 
+            /// Video embedding
+                $text = videoembedding_pre_filter($text);
+    
             /// Remove tags that are not allowed
                 $text = strip_tags($text, $ALLOWED_TAGS);
 
@@ -2014,6 +2019,8 @@
             /// Again remove tags that are not allowed
                 $text = strip_tags($text, $ALLOWED_TAGS);
 
+            /// Video embedding
+                $text = videoembedding_post_filter($text);
             }
 
         /// Remove potential script events - some extra protection for undiscovered bugs in our code
