Skip to content

Commit

Permalink
Fix type of results
Browse files Browse the repository at this point in the history
Return False if there is not dot, and '' if dot is last symbol.
I do not very like (string) substr, but it is very simple code and it works correct.
  • Loading branch information
mavik committed Sep 24, 2016
1 parent 1515999 commit 47169cb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions libraries/joomla/filesystem/file.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ class JFile
public static function getExt($file)
{
$dot = strrpos($file, '.');
if ($dot === false) { return ''; }
return substr($file, $dot + 1);
if ($dot === false) { return false; }
return (string) substr($file, $dot + 1);
}

/**
Expand Down

0 comments on commit 47169cb

Please sign in to comment.