- fixed access of super globals
authorMichael Wallner <mike@php.net>
Sun, 26 Mar 2006 16:05:50 +0000 (16:05 +0000)
committerMichael Wallner <mike@php.net>
Sun, 26 Mar 2006 16:05:50 +0000 (16:05 +0000)
http_api.c
http_cache_api.c
http_headers_api.c
http_querystring_object.c
package2.xml

index e3ea4dc0499d85f097ebdf80307a5b8e8cbb7114..774e60335a1c70d7bb537bc6a6de88cacb8376e8 100644 (file)
@@ -196,7 +196,9 @@ PHP_HTTP_API zval *_http_get_server_var_ex(const char *key, size_t key_size, zen
 {
        zval **hsv;
        zval **var;
 {
        zval **hsv;
        zval **var;
-       
+#ifdef ZEND_ENGINE_2
+       zend_is_auto_global("_SERVER", lenof("_SERVER") TSRMLS_CC);
+#endif
        if ((SUCCESS != zend_hash_find(&EG(symbol_table), "_SERVER", sizeof("_SERVER"), (void **) &hsv)) || (Z_TYPE_PP(hsv) != IS_ARRAY)) {
                return NULL;
        }
        if ((SUCCESS != zend_hash_find(&EG(symbol_table), "_SERVER", sizeof("_SERVER"), (void **) &hsv)) || (Z_TYPE_PP(hsv) != IS_ARRAY)) {
                return NULL;
        }
index a03a9616f1dba581c81b7b706681dc268a57c1c1..582c3ccd455d764b26fcec0134ec58dff88080ea 100644 (file)
@@ -85,6 +85,7 @@ PHP_HTTP_API zend_bool _http_match_last_modified_ex(const char *entry, time_t t,
        if ((chr_ptr = strrchr(modified, ';'))) {
                chr_ptr = 0;
        }
        if ((chr_ptr = strrchr(modified, ';'))) {
                chr_ptr = 0;
        }
+       
        retval = (t <= http_parse_date(modified));
        efree(modified);
        return retval;
        retval = (t <= http_parse_date(modified));
        efree(modified);
        return retval;
index 2493218e2ece1ed848ed6531b4f2430c10b091f8..c26214592b02420628e66defb06a6c5fec29b03b 100644 (file)
@@ -426,7 +426,9 @@ PHP_HTTP_API void _http_get_request_headers_ex(HashTable *headers, zend_bool pre
        HashPosition pos;
 
        Z_ARRVAL(array) = headers;
        HashPosition pos;
 
        Z_ARRVAL(array) = headers;
-
+#ifdef ZEND_ENGINE_2
+       zend_is_auto_global("_SERVER", lenof("_SERVER") TSRMLS_CC);
+#endif
        if (SUCCESS == zend_hash_find(&EG(symbol_table), "_SERVER", sizeof("_SERVER"), (void **) &hsv)) {
                FOREACH_KEYLEN(pos, *hsv, key, keylen, idx) {
                        if (key && keylen > 6 && !strncmp(key, "HTTP_", 5)) {
        if (SUCCESS == zend_hash_find(&EG(symbol_table), "_SERVER", sizeof("_SERVER"), (void **) &hsv)) {
                FOREACH_KEYLEN(pos, *hsv, key, keylen, idx) {
                        if (key && keylen > 6 && !strncmp(key, "HTTP_", 5)) {
index dbfd85b15a8d94bef386a71256316a51219ccb95..d47c495d30ab2513380996e4f82ca728b97f7f4f 100644 (file)
@@ -401,12 +401,17 @@ PHP_METHOD(HttpQueryString, __construct)
                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) {
                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) {
+#ifdef ZEND_ENGINE_2
+                       zend_is_auto_global("_SERVER", lenof("_SERVER") TSRMLS_CC);
+#endif
                        if (    (SUCCESS == zend_hash_find(&EG(symbol_table), "_SERVER", sizeof("_SERVER"), (void **) &_SERVER)) &&
                                        (Z_TYPE_PP(_SERVER) == IS_ARRAY) &&
                                        (SUCCESS == zend_hash_find(Z_ARRVAL_PP(_SERVER), "QUERY_STRING", sizeof("QUERY_STRING"), (void **) &QUERY_STRING))) {
                                
                                qstring = *QUERY_STRING;
                        if (    (SUCCESS == zend_hash_find(&EG(symbol_table), "_SERVER", sizeof("_SERVER"), (void **) &_SERVER)) &&
                                        (Z_TYPE_PP(_SERVER) == IS_ARRAY) &&
                                        (SUCCESS == zend_hash_find(Z_ARRVAL_PP(_SERVER), "QUERY_STRING", sizeof("QUERY_STRING"), (void **) &QUERY_STRING))) {
                                
                                qstring = *QUERY_STRING;
-                               
+#ifdef ZEND_ENGINE_2
+                               zend_is_auto_global("_GET", lenof("_GET") TSRMLS_CC);
+#endif
                                if ((SUCCESS == zend_hash_find(&EG(symbol_table), "_GET", sizeof("_GET"), (void **) &_GET)) && (Z_TYPE_PP(_GET) == IS_ARRAY)) {
                                        qarray = *_GET;
                                } else {
                                if ((SUCCESS == zend_hash_find(&EG(symbol_table), "_GET", sizeof("_GET"), (void **) &_GET)) && (Z_TYPE_PP(_GET) == IS_ARRAY)) {
                                        qarray = *_GET;
                                } else {
index cc99e7d72e15b0a285f95f6ef73c360422746eb3..fe78373f13b4b7c07e7c5b7f3dd6958bbacce159 100644 (file)
@@ -47,6 +47,7 @@ HttpResponse
  <license>BSD, revised</license>
  <notes><![CDATA[
 * Fixed Bug #7192: Build against libcurl >= 7.15.2 fails
  <license>BSD, revised</license>
  <notes><![CDATA[
 * Fixed Bug #7192: Build against libcurl >= 7.15.2 fails
+* Fixed access of super globals
 ]]></notes>
  <contents>
   <dir name="/">
 ]]></notes>
  <contents>
   <dir name="/">