From a4f05db4b0fa56734c084f457235908eef6c4e7e Mon Sep 17 00:00:00 2001 From: Julio Bonifacio Date: Fri, 22 Feb 2013 18:19:51 -0500 Subject: [PATCH] resolved image export with PDF Export refs #5948 --- main/inc/lib/pdf.lib.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/main/inc/lib/pdf.lib.php b/main/inc/lib/pdf.lib.php index 9f681d002b..9d8dedf204 100644 --- a/main/inc/lib/pdf.lib.php +++ b/main/inc/lib/pdf.lib.php @@ -213,10 +213,12 @@ if($complete_style === false) { error_log(__FUNCTION__.' with no style'); } $old_src = $item->getAttribute('src'); if (strpos($old_src, 'http') === false) { if (strpos($old_src, '/main/default_course_document') === false) { + $old_src_fixed = ''; if (api_get_path(REL_PATH) != '/') { - $old_src = str_replace(api_get_path(REL_PATH), '', $old_src); + $old_src_fixed = str_replace(api_get_path(REL_PATH).'courses/'.$course_data['path'].'/document/', '', $old_src); + } else { + $old_src_fixed = str_replace('courses/'.$course_data['path'].'/document/', '', $old_src); } - $old_src_fixed = str_replace('courses/'.$course_data['path'].'/document/', '', $old_src); $new_path = $document_path.$old_src_fixed; $document_html= str_replace($old_src, $new_path, $document_html); }