Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 4 additions & 6 deletions UPGRADING
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,6 @@ PHP 8.6 UPGRADE NOTES
. imagesetstyle(), imagefilter() and imagecrop() filter their array arguments
types / values and raise a TypeError / ValueError accordingly.

- Phar:
. Files are only automatically interpreted as Phar archives when included
if ".phar" occurs as an extension in the filename component of their
paths. Previously, it could occur in a directory name or as part of an
extension such as ".pharma".

- GMP:
. GMP power and shift operators now throw a ValueError when GMP right operands
are outside the unsigned long range, instead of silently truncating them.
Expand Down Expand Up @@ -119,6 +113,10 @@ PHP 8.6 UPGRADE NOTES
the reserved magic ".phar" directory through that form.
. Phar::addEmptyDir() now treats non-magic names that merely share the
".phar" prefix as ordinary directories.
. Files are only automatically interpreted as Phar archives when included
if ".phar" occurs as an extension in the filename component of their
paths. Previously, it could occur in a directory name or as part of an
extension such as ".pharma".

- Posix:
. posix_access() now raises a ValueError when an invalid $flags
Expand Down
23 changes: 5 additions & 18 deletions Zend/zend_API.c
Original file line number Diff line number Diff line change
Expand Up @@ -2399,9 +2399,6 @@ ZEND_API void add_property_zval_ex(zval *arg, const char *key, size_t key_len, z

ZEND_API zend_result zend_startup_module_ex(zend_module_entry *module) /* {{{ */
{
size_t name_len;
zend_string *lcname;

if (module->module_started) {
return SUCCESS;
}
Expand All @@ -2413,20 +2410,15 @@ ZEND_API zend_result zend_startup_module_ex(zend_module_entry *module) /* {{{ */

while (dep->name) {
if (dep->type == MODULE_DEP_REQUIRED) {
zend_module_entry *req_mod;
zend_module_entry *req_mod = zend_hash_str_find_ptr_lc(
&module_registry, dep->name, strlen(dep->name));

name_len = strlen(dep->name);
lcname = zend_string_alloc(name_len, 0);
zend_str_tolower_copy(ZSTR_VAL(lcname), dep->name, name_len);

if ((req_mod = zend_hash_find_ptr(&module_registry, lcname)) == NULL || !req_mod->module_started) {
zend_string_efree(lcname);
if (req_mod == NULL || !req_mod->module_started) {
/* TODO: Check version relationship */
zend_error(E_CORE_WARNING, "Cannot load module \"%s\" because required module \"%s\" is not loaded", module->name, dep->name);
module->module_started = 0;
return FAILURE;
}
zend_string_efree(lcname);
}
++dep;
}
Expand Down Expand Up @@ -2614,17 +2606,12 @@ ZEND_API zend_module_entry* zend_register_module_ex(zend_module_entry *module, i

while (dep->name) {
if (dep->type == MODULE_DEP_CONFLICTS) {
name_len = strlen(dep->name);
lcname = zend_string_alloc(name_len, 0);
zend_str_tolower_copy(ZSTR_VAL(lcname), dep->name, name_len);

if (zend_hash_exists(&module_registry, lcname) || zend_get_extension(dep->name)) {
zend_string_efree(lcname);
if (zend_hash_str_find_ptr_lc(&module_registry, dep->name, strlen(dep->name)) != NULL
|| zend_get_extension(dep->name)) {
/* TODO: Check version relationship */
zend_error(E_CORE_WARNING, "Cannot load module \"%s\" because conflicting module \"%s\" is already loaded", module->name, dep->name);
return NULL;
}
zend_string_efree(lcname);
}
++dep;
}
Expand Down
5 changes: 1 addition & 4 deletions Zend/zend_builtin_functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -2207,15 +2207,12 @@ ZEND_FUNCTION(debug_backtrace)
ZEND_FUNCTION(extension_loaded)
{
zend_string *extension_name;
zend_string *lcname;

if (zend_parse_parameters(ZEND_NUM_ARGS(), "S", &extension_name) == FAILURE) {
RETURN_THROWS();
}

lcname = zend_string_tolower(extension_name);
RETVAL_BOOL(zend_hash_exists(&module_registry, lcname));
zend_string_release_ex(lcname, 0);
RETURN_BOOL(zend_hash_find_ptr_lc(&module_registry, extension_name) != NULL);
}
/* }}} */

Expand Down
Loading