Commit 205cc486 authored by Taylor Otwell's avatar Taylor Otwell

Merge pull request #1356 from helmut/patch-1

Update laravel/file.php
parents 0a0eb377 1d725b27
......@@ -331,6 +331,8 @@ class File {
*/
public static function latest($directory, $options = fIterator::SKIP_DOTS)
{
$latest = null;
$time = 0;
$items = new fIterator($directory, $options);
......@@ -340,7 +342,11 @@ class File {
// 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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment