MDL-24223 same basic support for "safe" flash embedding
authorPetr Skoda <skodak@moodle.org>
Tue, 21 Sep 2010 07:20:40 +0000 (07:20 +0000)
committerPetr Skoda <skodak@moodle.org>
Tue, 21 Sep 2010 07:20:40 +0000 (07:20 +0000)
lib/weblib.php

index aaabf20..af60b5a 100644 (file)
@@ -1511,6 +1511,11 @@ function purify_html($text) {
         $config->set('URI.AllowedSchemes', array('http'=>true, 'https'=>true, 'ftp'=>true, 'irc'=>true, 'nntp'=>true, 'news'=>true, 'rtsp'=>true, 'teamspeak'=>true, 'gopher'=>true, 'mms'=>true));
         $config->set('Attr.AllowedFrameTargets', array('_blank'));
 
+        if (!empty($CFG->allowobjectembed)) {
+            $config->set('HTML.SafeObject', true);
+            $config->set('Output.FlashCompat', true);
+        }
+
         $def = $config->getHTMLDefinition(true);
         $def->addElement('nolink', 'Block', 'Flow', array());                       // skip our filters inside
         $def->addElement('tex', 'Inline', 'Inline', array());                       // tex syntax, equivalent to $$xx$$