Browse Source

Update laravel/file.php

Fixed bug that was causing the latest function to return the 'last' file rather than the actual 'latest' file.
helmut 12 years ago
parent
commit
ee18da9b73
1 changed files with 5 additions and 1 deletions
  1. 5 1
      laravel/file.php

+ 5 - 1
laravel/file.php

@@ -340,7 +340,11 @@ class File {
 		// with a UNIX timestamp greater than the latest one.
 		// with a UNIX timestamp greater than the latest one.
 		foreach ($items as $item)
 		foreach ($items as $item)
 		{
 		{
-			if ($item->getMTime() > $time) $latest = $item;
+			if ($item->getMTime() > $time) 
+			{
+				$latest = $item;
+				$time = $item->getMTime();
+			}
 		}
 		}
 
 
 		return $latest;
 		return $latest;