In CGI, php_auto_globals_create_server() (i.e. auto_global_callback() here)
initializes $_ENV to reuse for $_SERVER. However, because $_SERVER is
constructed first, we have not yet initialized auto_global->armed of the $_ENV
global. Split the loop into initialization and constructor phases.
Closes GH-19870
* uri: Rename `uri_object_t` to `php_uri_object`
* uri: Rename `uri_(read|write)_component_*` to `php_uri_property_(read|write)_*_helper`
* uri: Rename `URI_SERIALIZED_PROPERTY_NAME` to `PHP_URI_SERIALIZE_URI_FIELD_NAME`
* uri: Rename `uri_internal_t` to `php_uri_internal`
* uri: Use proper `php_uri_ce_` prefix for all CEs
* uri: Make the object handlers `static` and remove them from the header
zend_jit_fetch_obj_r_slow_ex() may be used by the function JIT, which doesn't
rely on guards to handle references. Therefore it must deref the property value.
Other variants of zend_jit_fetch_obj_*_slow_ex can not be used used in function
JIT.
Fixes GH-19831
Closes GH-19838
The previous conditions were unreadable and incorrect. Extract the primary mode
first, then compare it to the allowed values.
Fixes GH-19810
Closes GH-19815
* uri: Inline `uri_internal_from_obj()` and `Z_URI_INTERNAL_P()`
Changes performed with Coccinelle with some minor adjustments in places where
it choked due to macros:
@@
expression e;
@@
- Z_URI_INTERNAL_P(e)
+ &Z_URI_OBJECT_P(e)->internal
@@
expression e;
@@
- uri_internal_from_obj(e)
+ &uri_object_from_obj(e)->internal
* uri: Inline definition of `URI_ASSERT_INITIALIZATION()`
While a `NULL` pointer to `zend_object` would result in `->internal` also
sitting at `0`, this is not a particularly useful assertion to have. Instead
just assert that we have a parsed `->uri` available.
Changes made with Coccinelle + some manual adjustments:
@@
uri_internal_t *u;
expression e;
@@
u = &Z_URI_OBJECT_P(e)->internal
... when != u
- URI_ASSERT_INITIALIZATION(u);
+ ZEND_ASSERT(u->uri != NULL);
@@
uri_internal_t *u;
expression e;
@@
u = &uri_object_from_obj(e)->internal
... when != u
- URI_ASSERT_INITIALIZATION(u);
+ ZEND_ASSERT(u->uri != NULL);
* uri: Inline `parser` and `uri` into `uri_object_t`
After this, `uri_internal_t` will only be used when interacting with the URI
parsers without having a full-blown URI object.
Changes made with Coccinelle and some manual adjustments:
@@
identifier u;
expression e;
@@
- uri_internal_t *u = &e->internal;
+ uri_object_t *u = e;
@@
uri_object_t *u;
identifier t;
@@
- u->internal.t
+ u->t
* uri: Fix outdated `internal` naming for `uri_object_t`
* uri: Clean up naming of `uri_object_t` variables
The __wakeup() method is obsolete as a __unserialize() magic method is implemented.
Therefore, any class extending from those classes that overload deserialization should call the __unserialize() method instead of __wakeup() to properly handle the deserialization.
This deprecation follows the wording of the deprecation of the SplFixedArray::__wakeup() magic method.
The functions derived non-const pointers from a const-pointer, which is not
correct. Since php/php-src#19854 no `const` pointers are passed into these
functions, so we can just make the parameter non-const.
* uri: Take `uri_object_t` in `uri_get_debug_properties()`
* uri: Take `uri_object_t` as `base_url_object` in `php_uri_instantiate_uri()`
* uri: Take `uri_object_t` as `that_object` in `uri_equals()`
* uri: Take `this_object` a `uri_object_t` in `uri_equals()`
* uri: Take `uri_object_t` in `throw_cannot_recompose_uri_to_string()`
This happened implicitly in the past due to EX(opline) being used - or in the hybrid VM case, the implicit LOAD_OPLINE() happening as part of ZEND_VM_ENTER().
With 76d7c616bb opline is used standalone and the return value of zend_interrupt_helper_SPEC ignored. Make use of it...
Signed-off-by: Bob Weinand <bobwei9@hotmail.com>