From 95a1104713937e4b819d84c668c15db6a75592f3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juan=20Carlos=20Ra=C3=B1a?= Date: Fri, 3 Jul 2009 12:00:42 +0200 Subject: [PATCH] [svn r21760] eliminates the double brackets in the exported wiki pages --- main/wiki/index.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main/wiki/index.php b/main/wiki/index.php index 8232935c16..71f47be102 100644 --- a/main/wiki/index.php +++ b/main/wiki/index.php @@ -3539,11 +3539,13 @@ function export2doc($wikiTitle, $wikiContents, $groupId) $exportDir = api_get_path(SYS_COURSE_PATH).api_get_course_path(). '/document'.$groupPath; $exportFile = replace_dangerous_char(replace_accents($wikiTitle), 'strict' ) . $groupPart; + $wikiContents = stripslashes($wikiContents); + $wikiContents = trim(preg_replace("/\[\[|\]\]/", " ", $wikiContents)); + $i = 1; while ( file_exists($exportDir . '/' .$exportFile.'_'.$i.'.html') ) $i++; //only export last version, but in new export new version in document area $wikiFileName = $exportFile . '_' . $i . '.html'; $exportPath = $exportDir . '/' . $wikiFileName; - $wikiContents = stripslashes($wikiContents); file_put_contents( $exportPath, $wikiContents ); $doc_id = add_document($_course, $groupPath.'/'.$wikiFileName,'file',filesize($exportPath),$wikiFileName); api_item_property_update($_course, TOOL_DOCUMENT, $doc_id, 'DocumentAdded', api_get_user_id(), $groupId);