laravel/framework — pull request #6011 by maddios (2014-10-07 18:03:02+00:00)
Title: only pre-pending root for path fragments

When a url is passed in that contains spaces the validate function fails and falls through further down the code, however at this point the root is always pre-pended, even when one already exists.

This patch checks the passed in path to make sure it's not a full url:

Example:
http://foo.com/bar baz/file -> http://foo.com/http://foo.com/bar%20baz/file

This is an invalid url, granted, but the behavior currently will convert it to an even less valid one.

I updated the code to check if the $path starts with an 'http' string, if it does then root will be set to an empty string and $path will be left alone in the next step.