php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #60887
Patch Bug60887_user_agent_FIX_rfc2616_compliant revision 2012-01-28 19:19 UTC by carloschilazo at gmail dot com
Patch 60887_user_agent_FIX revision 2012-01-28 08:28 UTC by carloschilazo at gmail dot com

Patch 60887_user_agent_FIX for SOAP related Bug #60887

Patch version 2012-01-28 08:28 UTC

Return to Bug #60887 | Download this patch
This patch is obsolete

Obsoleted by patches:

Patch Revisions:

Developer: carloschilazo@gmail.com

Index: trunk/ext/soap/php_sdl.c
===================================================================
--- trunk/ext/soap/php_sdl.c	(revision 322900)
+++ trunk/ext/soap/php_sdl.c	(working copy)
@@ -3158,7 +3158,7 @@
 	char* old_error_code = SOAP_GLOBAL(error_code);
 	int uri_len = 0;
 	php_stream_context *context=NULL;
-	zval **tmp, **proxy_host, **proxy_port, *orig_context = NULL, *new_context = NULL;
+	zval **tmp, **proxy_host, **proxy_port, **user_agent, *orig_context = NULL, *new_context = NULL;
 	smart_str headers = {0};
 	char* key = NULL;
 	time_t t = time(0);
@@ -3225,6 +3225,15 @@
 		context = php_stream_context_alloc(TSRMLS_C);
 	}
 
+	if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_user_agent", sizeof("_user_agent"), (void **) &user_agent) == SUCCESS &&
+		    Z_TYPE_PP(user_agent) == IS_STRING && Z_STRLEN_PP(user_agent) > 0){	
+
+		smart_str_appends(&headers, "User Agent: ");
+		smart_str_appends(&headers,Z_STRVAL_PP(user_agent));
+		smart_str_appends(&headers,"\r\n");
+
+	}
+
 	if (zend_hash_find(Z_OBJPROP_P(this_ptr), "_proxy_host", sizeof("_proxy_host"), (void **) &proxy_host) == SUCCESS &&
 	    Z_TYPE_PP(proxy_host) == IS_STRING &&
 	    zend_hash_find(Z_OBJPROP_P(this_ptr), "_proxy_port", sizeof("_proxy_port"), (void **) &proxy_port) == SUCCESS &&
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 17:01:29 2024 UTC