mirror of
https://github.com/php/php-src.git
synced 2024-11-24 02:15:04 +08:00
apache 2.0's apache_lookup_uri() was returning an array rather than an
object, which contradicted both the documentation and the behavior of the same function under apache 1.3. PR: 14999
This commit is contained in:
parent
78cac2a42e
commit
57a4a7ed39
@ -20,6 +20,7 @@
|
||||
#include "SAPI.h"
|
||||
|
||||
#include "apr_strings.h"
|
||||
#include "apr_time.h"
|
||||
#include "ap_config.h"
|
||||
#include "util_filter.h"
|
||||
#include "httpd.h"
|
||||
@ -69,9 +70,11 @@ PHP_FUNCTION(virtual)
|
||||
}
|
||||
|
||||
#define ADD_LONG(name) \
|
||||
add_assoc_long(return_value, #name, rr->name)
|
||||
add_property_long(return_value, #name, rr->name)
|
||||
#define ADD_TIME(name) \
|
||||
add_property_long(return_value, #name, rr->name / APR_USEC_PER_SEC);
|
||||
#define ADD_STRING(name) \
|
||||
if (rr->name) add_assoc_string(return_value, #name, (char *) rr->name, 1)
|
||||
if (rr->name) add_property_string(return_value, #name, (char *) rr->name, 1)
|
||||
|
||||
PHP_FUNCTION(apache_lookup_uri)
|
||||
{
|
||||
@ -82,13 +85,13 @@ PHP_FUNCTION(apache_lookup_uri)
|
||||
WRONG_PARAM_COUNT;
|
||||
|
||||
if (rr->status == HTTP_OK) {
|
||||
array_init(return_value);
|
||||
object_init(return_value);
|
||||
|
||||
ADD_LONG(status);
|
||||
ADD_STRING(the_request);
|
||||
ADD_STRING(status_line);
|
||||
ADD_STRING(method);
|
||||
ADD_LONG(mtime);
|
||||
ADD_TIME(mtime);
|
||||
ADD_LONG(clength);
|
||||
#if !MODULE_MAGIC_AT_LEAST(20020506,0)
|
||||
ADD_STRING(boundary);
|
||||
@ -104,6 +107,12 @@ PHP_FUNCTION(apache_lookup_uri)
|
||||
ADD_STRING(filename);
|
||||
ADD_STRING(path_info);
|
||||
ADD_STRING(args);
|
||||
ADD_LONG(allowed);
|
||||
ADD_LONG(sent_bodyct);
|
||||
ADD_LONG(bytes_sent);
|
||||
ADD_LONG(request_time);
|
||||
ADD_LONG(mtime);
|
||||
ADD_TIME(request_time);
|
||||
|
||||
ap_destroy_sub_req(rr);
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user