From 2bf5b5d4fc059aaf005eb592553bf0231e5307f3 Mon Sep 17 00:00:00 2001 From: moodler Date: Fri, 3 Jun 2005 12:22:54 +0000 Subject: [PATCH] Merged fixes from stable --- mod/label/lib.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mod/label/lib.php b/mod/label/lib.php index fb4695bf3d3..7bc314b27a1 100644 --- a/mod/label/lib.php +++ b/mod/label/lib.php @@ -11,7 +11,7 @@ function label_add_instance($label) { /// will create a new instance and return the id number /// of the new instance. - $label->name = strip_tags(format_string(stripslashes($label->content),true)); + $label->name = addslashes(strip_tags(format_string(stripslashes($label->content),true))); if (strlen($label->name) > LABEL_MAX_NAME_LENGTH) { $label->name = substr($label->name, 0, LABEL_MAX_NAME_LENGTH)."..."; } @@ -25,7 +25,8 @@ function label_update_instance($label) { /// Given an object containing all the necessary data, /// (defined by the form in mod.html) this function /// will update an existing instance with new data. - $label->name = strip_tags(format_string(stripslashes($label->content),true)); + + $label->name = addslashes(strip_tags(format_string(stripslashes($label->content),true))); if (strlen($label->name) > LABEL_MAX_NAME_LENGTH) { $label->name = substr($label->name, 0, LABEL_MAX_NAME_LENGTH)."..."; }