Fixed undefined index for path and query on validate url

| Q             | A
| ------------- | ---
| Bug fix?      | yes
| New feature?  | no
| Tests pass?   | yes
| License       | MIT