X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-http;a=blobdiff_plain;f=http_response_object.c;h=02578d0b463bcdb66b8188f0b42a0a0352e3aa3f;hp=011944d71e7f0b5ae6a03a437cf79ba281356c2b;hb=ccd556e32e7264830790ec13b72a9b0e3760684b;hpb=64616c6675baf9dd168a7e2763e3124db0219921 diff --git a/http_response_object.c b/http_response_object.c index 011944d..02578d0 100644 --- a/http_response_object.c +++ b/http_response_object.c @@ -567,15 +567,12 @@ PHP_METHOD(HttpResponse, getContentType) */ PHP_METHOD(HttpResponse, guessContentType) { +#ifdef HTTP_HAVE_MAGIC char *magic_file, *ct = NULL; int magic_file_len; - long magic_mode = 0; + long magic_mode = MAGIC_MIME; RETVAL_FALSE; - -#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))) { @@ -608,6 +605,7 @@ PHP_METHOD(HttpResponse, guessContentType) SET_EH_NORMAL(); #else http_error(HE_THROW, HTTP_E_RUNTIME, "Cannot guess Content-Type; libmagic not available"); + RETURN_FALSE; #endif } /* }}} */