diff --git a/main/wiki/wiki.inc.php b/main/wiki/wiki.inc.php index 2d0c7ca847..b11c01af78 100755 --- a/main/wiki/wiki.inc.php +++ b/main/wiki/wiki.inc.php @@ -885,20 +885,6 @@ function display_wiki_entry($newtitle) //page action: export to pdf echo ''; - // Modified by Ivan Tcholakov, 28-JAN-2010. - //echo '
'; - - /*echo ''; - // - echo ''; - $clean_pdf_content=trim(preg_replace("/\[\[|\]\]/", " ", $content)); - $array_clean_pdf_content= explode('|', $clean_pdf_content); - $clean_pdf_content= $array_clean_pdf_content[1]; - echo ''; - echo ''; - echo '
'; - echo '
';*/ - echo '
'; echo ''; echo ''; @@ -1763,7 +1749,9 @@ function export2doc($wikiTitle, $wikiContents, $groupId) $exportDir = api_get_path(SYS_COURSE_PATH).api_get_course_path(). '/document'.$groupPath; $exportFile = replace_dangerous_char($wikiTitle, 'strict') . $groupPart; - $wikiContents = trim(preg_replace("/\[\[|\]\]/", " ", $wikiContents)); + $clean_wikiContents = trim(preg_replace("/\[\[|\]\]/", " ", $wikiContents)); + $array_clean_wikiContents= explode('|', $clean_wikiContents); + $wikiContents= $array_clean_wikiContents[1]; $wikiContents = str_replace('{CONTENT}', $wikiContents, $template); @@ -1791,7 +1779,15 @@ function export_to_pdf($id, $course_code) { require_once api_get_path(LIBRARY_PATH).'pdf.lib.php'; $data = get_wiki_data($id); + + $content_pdf = api_html_entity_decode($data['content'], ENT_QUOTES, api_get_system_encoding()); + + //clean wiki links + $clean_pdf_content=trim(preg_replace("/\[\[|\]\]/", " ", $content_pdf)); + $array_clean_pdf_content= explode('|', $clean_pdf_content); + $content_pdf= $array_clean_pdf_content[1]; + $title_pdf = api_html_entity_decode($data['title'], ENT_QUOTES, api_get_system_encoding()); $title_pdf = api_utf8_encode($title_pdf, api_get_system_encoding());