Browse Source

Don't fix images that are in app/upload see BT#14143

jmontoyaa 6 years ago
parent
commit
275ae9644d
1 changed files with 3 additions and 3 deletions
  1. 3 3
      main/inc/lib/pdf.lib.php

+ 3 - 3
main/inc/lib/pdf.lib.php

@@ -389,9 +389,7 @@ class PDF
 
         // Formatting the pdf
         $course_data = api_get_course_info($course_code);
-
         self::format_pdf($course_data, $completeHeader);
-
         $document_html = preg_replace($clean_search, '', $document_html);
 
         //absolute path for frames.css //TODO: necessary?
@@ -419,7 +417,9 @@ class PDF
                     $old_src = $item->getAttribute('src');
                     if (strpos($old_src, $protocol) === false) {
                         if (strpos($old_src, '/main/default_course_document') === false) {
-                            if (strpos($old_src, '/main/inc/lib/') === false) {
+                            if (strpos($old_src, '/main/inc/lib/') === false &&
+                                strpos($old_src, '/app/upload/') === false
+                            ) {
                                 $old_src_fixed = str_replace(
                                     api_get_path(REL_COURSE_PATH).$course_data['path'].'/document/',
                                     '',