+ case '-':
+ if (!label) {
+ /* sort of a compromise, just ensure we don't end up
+ * with a hyphen at the beginning
+ */
+ if (!(state->flags & PHP_HTTP_URL_SILENT_ERRORS)) {
+ php_error_docref(NULL, E_WARNING,
+ "Failed to parse %s; unexpected '%c' at pos %u in '%s'",
+ port ? "port" : "host",
+ (unsigned char) *ptr, (unsigned) (ptr - tmp), tmp);
+ }
+ if (!(state->flags & PHP_HTTP_URL_IGNORE_ERRORS)) {
+ return FAILURE;
+ }
+ break;
+ }
+ /* no break */
+ case '_': case '~': /* unreserved */
+ case '!': case '$': case '&': case '\'': case '(': case ')': case '*':
+ case '+': case ',': case ';': case '=': /* sub-delims */