Skip to content

Commit

Permalink
prevent Cache::put() from falling into the forever/zero minute case t…
Browse files Browse the repository at this point in the history
…hat varies across different drivers (#13869)
  • Loading branch information
halaei authored and taylorotwell committed Jun 4, 2016
1 parent 52dd727 commit 2813687
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Illuminate/Cache/Repository.php
Original file line number Diff line number Diff line change
Expand Up @@ -490,7 +490,7 @@ protected function getMinutes($duration)
$duration = Carbon::now()->diffInSeconds(Carbon::instance($duration), false) / 60;
}

return $duration > 0 ? $duration : null;
return (int) ($duration * 60) > 0 ? $duration : null;
}

/**
Expand Down

0 comments on commit 2813687

Please sign in to comment.