The Wire · Showcase
LARAVEL FIXES NUMBER UTILITY CRASH ON INFINITE VALUES
By RepoJournal · Filed · About Laravel
Number::fileSize() was spinning into infinity on INF and NAN inputs, producing nonsensical output like "∞ YB" - a fix just landed in 13.x.
The Number::fileSize() method had a critical flaw: when passed non-finite values (INF, -INF, or NAN), the method would loop through every unit in the scale until memory exhaustion because dividing infinity by 1024 still yields infinity [1]. This mirrors a similar bug that was fixed in Number::summarize() just days ago [2], which guards against non-finite inputs before iteration. The new PR applies the same is_finite() guard to fileSize(), stopping the runaway loop immediately and returning a sensible fallback. Framework maintenance also bumped GitHub Actions dependencies [3] to keep CI pipelines current, a routine hygiene task that doesn't affect production code.
Action items
- → Monitor 13.x for the Number::fileSize() fix merge laravel/framework [monitor]
- → If you use Number::fileSize() with user input, add validation to reject non-finite values laravel/framework [plan]
References
- [1] [13.x] Fix Number::fileSize crashing on INF/NAN inputs ↗ laravel/framework
- [2] [13.x] Fix Number::fileSize returning wrong unit suffix for non-finite inputs (#60625) laravel/framework
- [3] Bump the github-actions group with 2 updates ↗ laravel/framework
FAQ
- What changed in Laravel on June 30, 2026?
- Number::fileSize() was spinning into infinity on INF and NAN inputs, producing nonsensical output like "∞ YB" - a fix just landed in 13.x.
- What should Laravel teams do about it?
- Monitor 13.x for the Number::fileSize() fix merge • If you use Number::fileSize() with user input, add validation to reject non-finite values
- Which Laravel repositories shipped on June 30, 2026?
- laravel/framework