Update laravel/file.php

Fixed bug that was causing the latest function to return the 'last' file rather than the actual 'latest' file.
This commit is contained in:
helmut 2012-10-16 21:08:58 +12:00
parent 2e8364994f
commit ee18da9b73
1 changed files with 5 additions and 1 deletions

View File

@ -340,7 +340,11 @@ public static function latest($directory, $options = fIterator::SKIP_DOTS)
// with a UNIX timestamp greater than the latest one.
foreach ($items as $item)
{
if ($item->getMTime() > $time) $latest = $item;
if ($item->getMTime() > $time)
{
$latest = $item;
$time = $item->getMTime();
}
}
return $latest;