Skip to content

Commit

Permalink
Fix error in JFile::getExt
Browse files Browse the repository at this point in the history
JFile::getExt works incorrect if file does not have extension.
  • Loading branch information
mavik committed Sep 24, 2016
1 parent 0e2cc40 commit 1515999
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions libraries/joomla/filesystem/file.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ class JFile
*/
public static function getExt($file)
{
$dot = strrpos($file, '.') + 1;

return substr($file, $dot);
$dot = strrpos($file, '.');
if ($dot === false) { return ''; }
return substr($file, $dot + 1);
}

/**
Expand Down

0 comments on commit 1515999

Please sign in to comment.