aboutsummaryrefslogtreecommitdiff
path: root/mod/bookmarks/actions
diff options
context:
space:
mode:
Diffstat (limited to 'mod/bookmarks/actions')
-rw-r--r--mod/bookmarks/actions/add.php8
1 files changed, 8 insertions, 0 deletions
diff --git a/mod/bookmarks/actions/add.php b/mod/bookmarks/actions/add.php
index e633244c1..60859f90f 100644
--- a/mod/bookmarks/actions/add.php
+++ b/mod/bookmarks/actions/add.php
@@ -20,6 +20,14 @@ if (!$title || !$address) {
forward(REFERER);
}
+// don't allow malicious code.
+// put this in a context of a link so HTMLawed knows how to filter correctly.
+$xss_test = "<a href=\"$address\"></a>";
+if ($xss_test != filter_tags($xss_test)) {
+ register_error(elgg_echo('bookmarks:save:failed'));
+ forward(REFERER);
+}
+
//create a new bookmark object
$entity = new ElggObject;
$entity->subtype = "bookmarks";