diff --git a/mod/forum/restorelib.php b/mod/forum/restorelib.php
index e530408f5d3..922e2716da7 100644
--- a/mod/forum/restorelib.php
+++ b/mod/forum/restorelib.php
@@ -688,7 +688,7 @@
$searchstring='/\$@(FORUMVIEWBYID)\*([0-9]+)@\$/';
//We look for it
- preg_match_all($searchstring,$content,$foundset);
+ preg_match_all($searchstring,$result,$foundset);
//If found, then we are going to look for its new id (in backup tables)
if ($foundset[0]) {
//print_object($foundset); //Debug
@@ -709,7 +709,7 @@
$searchstring='/\$@(FORUMVIEWBYF)\*([0-9]+)@\$/';
//We look for it
- preg_match_all($searchstring,$content,$foundset);
+ preg_match_all($searchstring,$result,$foundset);
//If found, then we are going to look for its new id (in backup tables)
if ($foundset[0]) {
//print_object($foundset); //Debug
@@ -730,7 +730,7 @@
$searchstring='/\$@(FORUMDISCUSSIONVIEW)\*([0-9]+)@\$/';
//We look for it
- preg_match_all($searchstring,$content,$foundset);
+ preg_match_all($searchstring,$result,$foundset);
//If found, then we are going to look for its new id (in backup tables)
if ($foundset[0]) {
//print_object($foundset); //Debug
@@ -751,7 +751,7 @@
$searchstring='/\$@(FORUMDISCUSSIONVIEWPARENT)\*([0-9]+)\*([0-9]+)@\$/';
//We look for it
- preg_match_all($searchstring,$content,$foundset);
+ preg_match_all($searchstring,$result,$foundset);
//If found, then we are going to look for its new id (in backup tables)
if ($foundset[0]) {
//print_object($foundset); //Debug
@@ -774,7 +774,7 @@
$searchstring='/\$@(FORUMDISCUSSIONVIEWINSIDE)\*([0-9]+)\*([0-9]+)@\$/';
//We look for it
- preg_match_all($searchstring,$content,$foundset);
+ preg_match_all($searchstring,$result,$foundset);
//If found, then we are going to look for its new id (in backup tables)
if ($foundset[0]) {
//print_object($foundset); //Debug
@@ -829,7 +829,7 @@
$result = forum_decode_content_links($content,$restore);
if ($result != $content) {
//Update record
- $post->message = $result;
+ $post->message = addslashes($result);
$status = update_record("forum_posts",$post);
if ($CFG->debug>7) {
echo "