- fix builds where include/php/ext/iconv does not have php_have_*.h files
[m6w6/ext-http] / http_querystring_object.c
index 79f1b64a612d1b1069fe2d06b639a9d2b72831cf..6a3f0f30ff9cae302c3eb2a1f597cfdc1ea6e61f 100644 (file)
@@ -21,8 +21,9 @@
 #include "zend_interfaces.h"
 
 #ifdef HAVE_ICONV
-#      include "ext/standard/url.h"
+#      undef PHP_ATOM_INC
 #      include "ext/iconv/php_iconv.h"
+#      include "ext/standard/url.h"
 #endif
 
 #include "php_http_api.h"
@@ -338,7 +339,9 @@ PHP_METHOD(HttpQueryString, __construct)
        zval *params = NULL, *qarray = NULL, *qstring = NULL, **_GET, **_SERVER, **QUERY_STRING;
        
        SET_EH_THROW_HTTP();
-       if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|bz", &global, &params)) {
+       if (!sapi_module.treat_data) {
+               http_error(HE_ERROR, HTTP_E_QUERYSTRING, "The SAPI does not have a treat_data function registered");
+       } else if (SUCCESS == zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|bz", &global, &params)) {
                if (global) {
                        if (    (SUCCESS == zend_hash_find(&EG(symbol_table), "_SERVER", sizeof("_SERVER"), (void **) &_SERVER)) &&
                                        (Z_TYPE_PP(_SERVER) == IS_ARRAY) &&
@@ -475,7 +478,7 @@ PHP_METHOD(HttpQueryString, set)
 /* }}} */
 
 #ifndef WONKY
-/* {{{ proto HttpQueryString HttpQueryString::singleton([bool global = true])
+/* {{{ proto static HttpQueryString HttpQueryString::singleton([bool global = true])
  *
  * Get a single instance (differentiates between the global setting).
  */