Skip to content

Commit

Permalink
Fix for absolute paths in pdf, avoid 'empty needle' warning to strstr…
Browse files Browse the repository at this point in the history
… if no subfolder.
  • Loading branch information
cheesegrits committed Jul 13, 2017
1 parent 7f1d252 commit f90ec54
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions components/com_fabrik/helpers/pdf.php
Expand Up @@ -94,7 +94,7 @@ public static function fullPaths(&$data)
{
if (!strstr($a['href'], $schemeString))
{
$base = strstr($a['href'], $subdir) ? $base_root : $base_root . $subdir;
$base = empty($subdir) || strstr($a['href'], $subdir) ? $base_root : $base_root . $subdir;
$a['href'] = $base . ltrim($a['href'],'/');
}
}
Expand All @@ -106,7 +106,7 @@ public static function fullPaths(&$data)
{
if ($link['rel'] == 'stylesheet' && !strstr($link['href'], $schemeString))
{
$base = strstr($link['href'], $subdir) ? $base_root : $base_root . $subdir;
$base = empty($subdir) || strstr($link['href'], $subdir) ? $base_root : $base_root . $subdir;
$link['href'] = $base . ltrim($link['href'],'/');
}
}
Expand Down

0 comments on commit f90ec54

Please sign in to comment.