Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
N6REJ committed Oct 30, 2020
1 parent 3332b0d commit 8ef4846
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions libraries/src/HTML/Helpers/Icons.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,8 @@
defined('JPATH_PLATFORM') or die;

use Joomla\CMS\Factory;
use Joomla\CMS\Filesystem\Path;
use Joomla\CMS\HTML\HTMLHelper;
use Joomla\CMS\Language\Text;
use Joomla\CMS\Layout\FileLayout;
use Joomla\CMS\MVC\Controller\Exception;
use Joomla\CMS\Uri\Uri;

/**
Expand Down Expand Up @@ -99,11 +96,11 @@ public static function button($button)
* @param string $file The relative or absolute PATH to use for the src attribute.
* @param boolean $relative Flag if the path to the file is relative to the /media folder (and searches in template).
*
* @return string
* @return string|null
*
* @since 4.0
*/
public static function svg(string $file, $relative = true)
public static function svg(string $file, bool $relative = true): ?string
{
// Check extension for .svg
$extension = strtolower(substr($file, -3, strrpos($file, ".")));
Expand All @@ -123,7 +120,7 @@ public static function svg(string $file, $relative = true)
}

// Get contents to display inline
$file = file_get_contents(Path::clean(JPATH_ROOT . '/' . substr($file, \strlen(Uri::root(true)))));
$file = file_get_contents(JPATH_ROOT . '/' . substr($file, \strlen(Uri::root(true))));

return $file;
}
Expand Down

0 comments on commit 8ef4846

Please sign in to comment.