From ee18da9b73f94153de48eb8abaa7f49d156a912c Mon Sep 17 00:00:00 2001 From: helmut Date: Tue, 16 Oct 2012 21:08:58 +1200 Subject: [PATCH] Update laravel/file.php Fixed bug that was causing the latest function to return the 'last' file rather than the actual 'latest' file. --- laravel/file.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/laravel/file.php b/laravel/file.php index d2022268..26672291 100644 --- a/laravel/file.php +++ b/laravel/file.php @@ -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;