Changing all checks for "http://" and "https://" to use !parse_url($path, PHP_URL_SCHEME)
Hopefully this works better and is more readable than strpos everything.