In version 1.6.0 the logo isn't shown on the PDF

I uploaded a custom invoice logo in System Settings → Invoices. Now, when working with a quote and attempting to “Download PDF” or “Send Email”, the application crashes when in debug mode.

Here is the debug log:

And, here is the backtrace received by the browser:

I have found a workaround.

In application/helpers/invoice_helper.php, I changed line 39 from:

return '<img src="file://' . getcwd() . '/uploads/' . $CI->mdl_settings->setting('invoice_logo') . '" id="invoice-logo">';


return '<img src="' . base_url() . '/uploads/' . $CI->mdl_settings->setting('invoice_logo') . '" id="invoice-logo">';

It is my understanding that the “file://” protocol attempts to access a file on the client system, not on the server, which is forbidden by the browser for security reasons.

I do not know the reason for the original coding, so I do not know if this is a bug nor if the above is a proper fix for it. If this is indeed a bug, should I go ahead and open an issue at the IP repo ?

System: LAMP with Apache2 and PHP 8.0.28
Browsers: Firefox and Chromium (both report the security exception in their consoles)

Try this solution:

The PR is already merged and will be released with version 1.6.1

Interesting. That’s the exact same fix I applied.

I searched the Issues before posting here. Apparently I used the wrong search term as there is no “logo image” in the title of the related issue.

Thank you for the note.

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.