Good catch! Looks like this function might need to be a bit more complicated, since apparently many URI components can be optional.

I'm gonna update the function to take two arguments. The first is the argument to validate, if no other argument is passed the behavior will be the same as it currently is. The optional second argument will be the protocol argument. This can either be a string or array of string, If the protocol argument is passed the parsed URI must have a specified protocol that matches what was given in the protocol argument.