]> granicus.if.org Git - php/commitdiff
don't set CLSCTX_REMOTE_SERVER if NULL is passed as servername
authorHarald Radi <phanto@php.net>
Sat, 27 Apr 2002 10:17:46 +0000 (10:17 +0000)
committerHarald Radi <phanto@php.net>
Sat, 27 Apr 2002 10:17:46 +0000 (10:17 +0000)
ext/com/COM.c
ext/rpc/com/com_wrapper.c

index 29cc7404556c04e94c6cbe2be56003eedf62c8ee..58ab66065051d91c54b4284dd6ec0fedaee4baaa 100644 (file)
@@ -501,14 +501,11 @@ PHP_FUNCTION(com_load)
        }
 
        if (server_name != NULL) {
-               /* if a server is passed, one obviously wants to instanciate a
-                * remote server
-                */
-               flags = CLSCTX_REMOTE_SERVER;
-
                /* What is server name? A String or an array? */
 
-               if (Z_TYPE_P(server_name) == IS_ARRAY) {
+               if (Z_TYPE_P(server_name) == IS_NULL) {
+                       server_name = NULL;
+               } else if (Z_TYPE_P(server_name) == IS_ARRAY) {
                        pval **tmp;
                        /* DAB: 22 Sept 2001 */
                        /* Aha - we have a number of possible */
@@ -568,14 +565,12 @@ PHP_FUNCTION(com_load)
                                convert_to_long_ex(tmp);
                                flags = (CLSCTX) Z_LVAL_PP(tmp);
                        }
-               }
-               if (Z_TYPE_P(server_name) == IS_NULL) {
-                       server_name = NULL;
                } else {
                        if (!INI_INT("com.allow_dcom")) {
                                php_error(E_WARNING, "DCOM is disabled");
                                RETURN_FALSE;
                        } else {
+                               flags = CLSCTX_REMOTE_SERVER;
                                convert_to_string_ex(&server_name);
                        }
                }
index 29cc7404556c04e94c6cbe2be56003eedf62c8ee..58ab66065051d91c54b4284dd6ec0fedaee4baaa 100644 (file)
@@ -501,14 +501,11 @@ PHP_FUNCTION(com_load)
        }
 
        if (server_name != NULL) {
-               /* if a server is passed, one obviously wants to instanciate a
-                * remote server
-                */
-               flags = CLSCTX_REMOTE_SERVER;
-
                /* What is server name? A String or an array? */
 
-               if (Z_TYPE_P(server_name) == IS_ARRAY) {
+               if (Z_TYPE_P(server_name) == IS_NULL) {
+                       server_name = NULL;
+               } else if (Z_TYPE_P(server_name) == IS_ARRAY) {
                        pval **tmp;
                        /* DAB: 22 Sept 2001 */
                        /* Aha - we have a number of possible */
@@ -568,14 +565,12 @@ PHP_FUNCTION(com_load)
                                convert_to_long_ex(tmp);
                                flags = (CLSCTX) Z_LVAL_PP(tmp);
                        }
-               }
-               if (Z_TYPE_P(server_name) == IS_NULL) {
-                       server_name = NULL;
                } else {
                        if (!INI_INT("com.allow_dcom")) {
                                php_error(E_WARNING, "DCOM is disabled");
                                RETURN_FALSE;
                        } else {
+                               flags = CLSCTX_REMOTE_SERVER;
                                convert_to_string_ex(&server_name);
                        }
                }