From c0dc2ab869fa96528e8a8c6e2d8a0d0cf4e1741c Mon Sep 17 00:00:00 2001 From: Julio Montoya Date: Tue, 21 Oct 2014 13:13:05 +0200 Subject: [PATCH] Fixing suspend_data, launch_data and lesson_location see BT#8898 --- main/newscorm/learnpathItem.class.php | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/main/newscorm/learnpathItem.class.php b/main/newscorm/learnpathItem.class.php index af113462d2..9ecf8912d6 100755 --- a/main/newscorm/learnpathItem.class.php +++ b/main/newscorm/learnpathItem.class.php @@ -695,15 +695,19 @@ class learnpathItem error_log('learnpathItem::get_launch_data()', 0); } if (!empty($this->launch_data)) { - return $this->launch_data; + return str_replace( + array("\r", "\n", "'"), + array('\r', '\n', "\\'"), + $this->launch_data + ); } return ''; } /** * Gets the lesson location - * @return string lesson location as recorded by the SCORM and AICC - * elements. Defaults to '' + * @return string lesson location as recorded by the SCORM and AICC + * elements. Defaults to '' */ public function get_lesson_location() { @@ -711,7 +715,11 @@ class learnpathItem error_log('learnpathItem::get_lesson_location()', 0); } if (!empty($this->lesson_location)) { - return $this->lesson_location; + return str_replace( + array("\r", "\n", "'"), + array('\r', '\n', "\\'"), + $this->lesson_location + ); } else { return ''; } @@ -1749,8 +1757,8 @@ class learnpathItem // a beautiful way to do it ? if (!empty($this->current_data)) { return str_replace( - array("\r", "\n"), - array('\r', '\n'), + array("\r", "\n", "'"), + array('\r', '\n', "\\'"), $this->current_data ); } else {