summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXinchen Hui <laruence@php.net>2015-02-13 13:09:56 +0800
committerXinchen Hui <laruence@php.net>2015-02-13 13:09:56 +0800
commit3a71fa36a230d1908d71a98086ab7c6fa9519530 (patch)
treead37aa7316c39a3f8b53a42d1e8cb19d66025380
parent371c016986cb9c3ddeefe16375c1a760aafa478d (diff)
downloadphp-git-3a71fa36a230d1908d71a98086ab7c6fa9519530.tar.gz
Micro opt
-rw-r--r--ext/soap/soap.c3
-rw-r--r--ext/zlib/zlib.c4
2 files changed, 3 insertions, 4 deletions
diff --git a/ext/soap/soap.c b/ext/soap/soap.c
index 6e5116a2a3..daf977e8a3 100644
--- a/ext/soap/soap.c
+++ b/ext/soap/soap.c
@@ -2071,8 +2071,7 @@ static void soap_server_fault_ex(sdlFunctionPtr function, zval* fault, soapHeade
xmlDocDumpMemory(doc_return, &buf, &size);
- zend_is_auto_global("_SERVER", sizeof("_SERVER") - 1 TSRMLS_CC);
- if (PG(http_globals)[TRACK_VARS_SERVER] &&
+ if ((PG(http_globals)[TRACK_VARS_SERVER] || zend_is_auto_global("_SERVER", sizeof("_SERVER") - 1 TSRMLS_CC)) &&
zend_hash_find(PG(http_globals)[TRACK_VARS_SERVER]->value.ht, "HTTP_USER_AGENT", sizeof("HTTP_USER_AGENT"), (void **) &agent_name) == SUCCESS &&
Z_TYPE_PP(agent_name) == IS_STRING) {
if (strncmp(Z_STRVAL_PP(agent_name), "Shockwave Flash", sizeof("Shockwave Flash")-1) == 0) {
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
index 4c98fae8f7..d70198c674 100644
--- a/ext/zlib/zlib.c
+++ b/ext/zlib/zlib.c
@@ -82,8 +82,8 @@ static int php_zlib_output_encoding(TSRMLS_D)
zval **enc;
if (!ZLIBG(compression_coding)) {
- zend_is_auto_global(ZEND_STRL("_SERVER") TSRMLS_CC);
- if (PG(http_globals)[TRACK_VARS_SERVER] && SUCCESS == zend_hash_find(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER]), "HTTP_ACCEPT_ENCODING", sizeof("HTTP_ACCEPT_ENCODING"), (void *) &enc)) {
+ if ((PG(http_globals)[TRACK_VARS_SERVER] || zend_is_auto_global(ZEND_STRL("_SERVER") TSRMLS_CC)) &&
+ SUCCESS == zend_hash_find(Z_ARRVAL_P(PG(http_globals)[TRACK_VARS_SERVER]), "HTTP_ACCEPT_ENCODING", sizeof("HTTP_ACCEPT_ENCODING"), (void *) &enc)) {
convert_to_string(*enc);
if (strstr(Z_STRVAL_PP(enc), "gzip")) {
ZLIBG(compression_coding) = PHP_ZLIB_ENCODING_GZIP;