X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=http_response_object.c;h=c0c66af090543aee016a5822866e0a04adee15c4;hp=dfc2476a8819259df634f5b2dbad0577cf9c3cf2;hb=c04184b2188a60efed4753d7eef7f3952aed9cef;hpb=afd561b680a07837192efbdb9ffe248def36f8e9 diff --git a/http_response_object.c b/http_response_object.c index dfc2476..c0c66af 100644 --- a/http_response_object.c +++ b/http_response_object.c @@ -500,7 +500,7 @@ PHP_METHOD(HttpResponse, getContentType) } /* }}} */ -/* {{{ proto static string HttpResponse::guessContentType(string magic_file[, long magic_mode]) +/* {{{ proto static string HttpResponse::guessContentType(string magic_file[, long magic_mode = MAGIC_MIME]) * * Attempts to guess the content type of supplied payload through libmagic. */ @@ -512,6 +512,9 @@ PHP_METHOD(HttpResponse, guessContentType) RETVAL_NULL(); +#ifdef HTTP_HAVE_MAGIC + magic_mode = MAGIC_MIME; + SET_EH_THROW_HTTP(); if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l", &magic_file, &magic_file_len, &magic_mode)) { switch (Z_LVAL_P(GET_STATIC_PROP(mode))) { @@ -542,6 +545,7 @@ PHP_METHOD(HttpResponse, guessContentType) } } SET_EH_NORMAL(); +#endif } /* }}} */