- commonize some error messages
[m6w6/ext-http] / http_response_object.c
index 0e1eb29abd7455fdb3a26c9756722cc1498a3a30..8be3efd7e988f1dc9308576d7b00df8e5bc2255c 100644 (file)
@@ -533,11 +533,7 @@ PHP_METHOD(HttpResponse, setContentType)
                RETURN_FALSE;
        }
 
-       if (!strchr(ctype, '/')) {
-               http_error_ex(HE_WARNING, HTTP_E_INVALID_PARAM, "Content type '%s' doesn't seem to contain a primary and a secondary part", ctype);
-               RETURN_FALSE;
-       }
-
+       HTTP_CHECK_CONTENT_TYPE(ctype, RETURN_FALSE);
        RETURN_SUCCESS(UPD_STATIC_STRL(contentType, ctype, ctype_len));
 }
 /* }}} */