diff --git a/lib/resourcelib.php b/lib/resourcelib.php
index 67216ee3c86..6e505d9f25e 100644
--- a/lib/resourcelib.php
+++ b/lib/resourcelib.php
@@ -262,13 +262,13 @@ function resourcelib_embed_general($fullurl, $title, $clicktoopen, $mimetype) {
$fullurl = $fullurl->out();
}
- $param = '';
+ $title = s($title);
// Always use iframe embedding because object tag does not work much,
// this is ok in HTML5.
$code = <<
-