diff --git a/main/newscorm/learnpath.class.php b/main/newscorm/learnpath.class.php index 85863df652..16dbb56d37 100644 --- a/main/newscorm/learnpath.class.php +++ b/main/newscorm/learnpath.class.php @@ -1001,7 +1001,7 @@ class learnpath { $sql_update = " UPDATE " . $tbl_lp_item . " SET - title = '" . $this->escape_string(htmlspecialchars($title, ENT_QUOTES, $charset)) . "', + title = '" . $this->escape_string(api_htmlentities($title, ENT_QUOTES, $charset)) . "', prerequisite = '".$prerequisites."', description = '" . $this->escape_string(api_htmlentities($description, ENT_QUOTES, $charset)) . "' ". $audio_update_sql . ", @@ -1118,7 +1118,7 @@ class learnpath { $sql_update = " UPDATE " . $tbl_lp_item . " SET - title = '" . $this->escape_string(htmlspecialchars($title, ENT_QUOTES, $charset)) . "', + title = '" . $this->escape_string(api_htmlentities($title, ENT_QUOTES, $charset)) . "', description = '" . $this->escape_string(api_htmlentities($description, ENT_QUOTES, $charset)) . "', parent_item_id = " . $parent . ", previous_item_id = " . $previous . ", @@ -4681,7 +4681,7 @@ class learnpath { $title=''; for($i = 0; $i < count($arrLP); $i++) { - $title = api_html_entity_decode(addslashes($arrLP[$i]['title']), ENT_QUOTES, $charset); + $title = addslashes($arrLP[$i]['title']); $menu_page = api_get_self() . '?cidReq=' . $_GET['cidReq'] . '&action=view_item&id=' . $arrLP[$i]['id'] . '&lp_id=' . $_SESSION['oLP']->lp_id; $icon_name = str_replace(' ', '', $arrLP[$i]['item_type']); if (file_exists("../img/lp_" . $icon_name . ".png")) @@ -6254,7 +6254,8 @@ class learnpath { require_once (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php'); $form = new FormValidator('form','POST',api_get_self()."?".$_SERVER["QUERY_STRING"]); - $defaults["title"] = api_convert_encoding($item_title, $charset, $this->encoding); + //$defaults["title"] = api_convert_encoding($item_title, $charset, $this->encoding); + $defaults["title"] = api_html_entity_decode(api_convert_encoding($item_title, $charset, $this->encoding), ENT_QUOTES, $charset); $defaults["description"] = api_convert_encoding($item_description, $charset, $this->encoding); $form->addElement('html',$return); @@ -6538,11 +6539,13 @@ class learnpath { require_once (api_get_path(LIBRARY_PATH).'formvalidator/FormValidator.class.php'); $form = new FormValidator('form','POST',api_get_self()."?".$_SERVER["QUERY_STRING"],'','enctype="multipart/form-data"'); - $defaults["title"]= api_convert_encoding($defaults["title"], $charset, $this->encoding); - if(empty($defaults["title"])) - { + + $defaults["title"] = api_html_entity_decode(api_convert_encoding($item_title, $charset, $this->encoding), ENT_QUOTES, $charset); + + if (empty($item_title)) { $defaults["title"] = api_html_entity_decode(api_convert_encoding($item_title, $charset, $this->encoding), ENT_QUOTES, $charset); } + $defaults["description"] = api_convert_encoding($item_description, $charset, $this->encoding); $form->addElement('html',$return); @@ -7599,6 +7602,8 @@ class learnpath { */ function display_item_small_form($item_type, $title = '', $data) { + global $charset; + $return .= '
' . $title . '
'; @@ -7610,16 +7615,17 @@ class learnpath { $return .= "\t\t" . '