Commit 7f91e9bf authored by jcnventura's avatar jcnventura

Fix undefined offset warning in theme_print_pdf_tcpdf_header().

parent b1af2114
......@@ -489,10 +489,12 @@ function theme_print_pdf_tcpdf_header($vars) {
$ratio = 0;
$logo = '';
if (preg_match('!src\s*=\s*(?:\'(.*?)\'|"(.*?)"|([^\s]*))!i', $tpl_logo[1], $logo_url)) {
if (isset($tpl_logo[1]) && preg_match('!src\s*=\s*(?:"(.*?)"|\'(.*?)\'|([^\s]*))!i', $tpl_logo[1], $logo_url)) {
$logo = $logo_url[1];
$size = getimagesize($logo);
$ratio = $size ? ($size[0] / $size[1]) : 0;
if (!empty($logo)) {
$size = getimagesize($logo);
$ratio = $size ? ($size[0] / $size[1]) : 0;
}
}
// set header font
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment