- commonize some error messages
[m6w6/ext-http] / http_response_object.c
index 30f5abaf8ba6f023df72c919c038e0d4239cc080..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));
 }
 /* }}} */
@@ -560,7 +556,7 @@ PHP_METHOD(HttpResponse, getContentType)
 }
 /* }}} */
 
-/* {{{ proto static string HttpResponse::guessContentType(string magic_file[, long magic_mode = MAGIC_MIME])
+/* {{{ proto static string HttpResponse::guessContentType(string magic_file[, int magic_mode = MAGIC_MIME])
  *
  * Attempts to guess the content type of supplied payload through libmagic.
  * If the attempt is successful, the guessed content type will automatically