php/php-src — pull request #236 by 1stvamp (2012-11-24 22:14:31+00:00)
Title: Fix bug #62524, only follow redirects in file streams for 3xx HTTP statuses

See https://bugs.php.net/bug.php?id=62524.

Discovered this also while debugging a problem in Composer during Github API auth token retrieval, Github return status 210 for a created token with the canonical URI for the token in the "Location" header.

This simple patch just checks the bounds of the HTTP status, when StreamContext says fopen et al should follow Location, are =>300 && <400.