| 1 | <?php |
||
| 5 | class UriValidator |
||
| 6 | { |
||
| 7 | const URI_REGEXP = '/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#?(.*))?/'; |
||
| 8 | |||
| 9 | /** |
||
| 10 | * Validate a URI according to RFC 3986 (+errata) |
||
| 11 | * (See: http://www.rfc-editor.org/errata_search.php?rfc=3986). |
||
| 12 | * |
||
| 13 | * @param string $uri the URI to validate |
||
| 14 | * |
||
| 15 | * @return bool TRUE when the URI is valid, FALSE when invalid |
||
| 16 | */ |
||
| 17 | public static function validate($uri) |
||
| 27 | |||
| 28 | private static function checkHexDigits($uri) |
||
| 39 | } |
||
| 40 |