Skip to content

Commit

Permalink
Fix image urls when exporting certificates to pdf - refs BT#10843
Browse files Browse the repository at this point in the history
  • Loading branch information
AngelFQC committed Feb 26, 2016
1 parent 2f290e9 commit 8f9d20c
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion main/inc/lib/pdf.lib.php
Expand Up @@ -327,7 +327,12 @@ public function html_to_pdf(
if (api_get_path(REL_PATH) != '/') {
$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);
if (strpos($old_src, 'courses/'.$course_data['path'].'/document/') !== false) {
$old_src_fixed = str_replace('courses/'.$course_data['path'].'/document/', '', $old_src);
} else {
$document_path = '';
$old_src_fixed = $old_src;
}
}

$new_path = $document_path.$old_src_fixed;
Expand Down

0 comments on commit 8f9d20c

Please sign in to comment.