]> granicus.if.org Git - php/commitdiff
Fixed bug #34905 (Digest authentication does not work with Apache 1).
authorIlia Alshanetsky <iliaa@php.net>
Tue, 18 Oct 2005 23:14:47 +0000 (23:14 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Tue, 18 Oct 2005 23:14:47 +0000 (23:14 +0000)
sapi/apache/mod_php5.c

index 93c340bb76c845b2c1c752301deab4efdfb17bb8..e2fcd5ede554ea37518a8955cdf3f651f2a35b5e 100644 (file)
@@ -497,9 +497,9 @@ static void init_request_info(TSRMLS_D)
        SG(request_info).auth_user = NULL;
        SG(request_info).auth_password = NULL;
 
-       if (authorization
-               && (!PG(safe_mode) || (PG(safe_mode) && !auth_type(r)))) {
-               if (!strcasecmp(getword(r->pool, &authorization, ' '), "Basic")) {
+       if (authorization && (!PG(safe_mode) || (PG(safe_mode) && !auth_type(r)))) {
+               char *p = getword(r->pool, &authorization, ' ');
+               if (!strcasecmp(p, "Basic")) {
                        tmp = uudecode(r->pool, authorization);
                        tmp_user = getword_nulls_nc(r->pool, &tmp, ':');
                        if (tmp_user) {
@@ -510,9 +510,9 @@ static void init_request_info(TSRMLS_D)
                        if (tmp) {
                                SG(request_info).auth_password = estrdup(tmp);
                        }
-               } else if  (!strcasecmp(getword(r->pool, &authorization, ' '), "Digest")) {
-            r->connection->ap_auth_type = "Digest";
-            SG(request_info).auth_digest = estrdup(authorization);
+               } else if (!strcasecmp(p, "Digest")) {
+                       r->connection->ap_auth_type = "Digest";
+                       SG(request_info).auth_digest = estrdup(authorization);
                }
        }
 }