-
-
Notifications
You must be signed in to change notification settings - Fork 146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix removed "php_strtolower" for PHP 8.4 #690
base: develop
Are you sure you want to change the base?
Conversation
@@ -610,7 +610,7 @@ static zval *php_imagick_read_property(zend_object *object, zend_string *member, | |||
if (format) { | |||
retval = rv; | |||
ZVAL_STRING(retval, format); | |||
php_strtolower(Z_STRVAL_P(retval), Z_STRLEN_P(retval)); | |||
zend_str_tolower(Z_STRVAL_P(retval), Z_STRLEN_P(retval)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I bet it should be used conditionally depending on PHP version
zend_str_tolower(Z_STRVAL_P(retval), Z_STRLEN_P(retval)); | |
#if PHP_VERSION_ID < 80400 | |
php_strtolower(Z_STRVAL_P(retval), Z_STRLEN_P(retval)); | |
#else | |
zend_str_tolower(Z_STRVAL_P(retval), Z_STRLEN_P(retval)); | |
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other 2 places also needs this
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why - it is present at least since PHP 5.4 - https://github.com/php/php-src/blob/PHP-5.4.45/Zend/zend_operators.h#L332
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry, I didn't check php-src, looks like the function exists, so probably it's not required
@Danack can we get this merged? |
I checked the patch and it is working. One thing, though: I still use the same code to update PHP 5.3 (yeah, I know), so I had a #ifdef #else #endif construction anyway. |
Based on https://github.com/Imagick/imagick/blob/3.7.0/package.xml#L8 PHP 5.3 (and lower) is no longer supported. |
Fixes phpv8#540 Relates Imagick/imagick#690
Could we have this merged pretty please? It hit a popular repo in Ubuntu/Debian and now we can't use imagick. Than you for your work folks.
|
Same here :-) php8.4 -v |
WordPress uses imagick and certain functions are now broken in 8.4 |
https://github.com/mvorisek/image-php Docker images can be used which contain most of the extensions, incl. this one and the fix, prebuilt. |
We don't use WordPress in a docker image nor do we currently plan to expend the effort to migrate. We've rolled back to 8.3 for now, but I thought it would be worth mentioning that WordPress is also currently broken with regards to imagemagick on 8.4 |
Do we have to go back to 8.3, or will this get merged soon? |
First, just add the modules, copying from 8.3 versions. $ for p in php-8.3-*.yaml; do sed -e 's,epoch: .*,epoch: 0,' \ -e 's,name: php-8.3-,name: php-8.4-,' \ "$p" > php-8.4${p#php-8.3}; done Then fix some to build with 8.4, cherry picking from upstream. * php-8.4-pecl-mcrypt - cherry-pick a PR to build for 8.4 Grab php/pecl-encryption-mcrypt#19 which just uses php_mt_rand_range rather than now-removed php_rand. * php-8.4-imagick - cherry pick pr to build for 8.4 Grab Imagick/imagick#690 to replace php_strlower with zend_str_tolower * php-8.4-xdebug - cherry pick several upstream changes NOTE: I have very low confidence in this, other than it builds. xdebug is active and likely to release a 3.4.0 release soon that has php 8.4 support properly. By adding php-8.4-xdebug with updates enabled, we will get a PR automatically made and hopefully landed just by dropping the cherry-picks here. * Drop php-8.4-swoole - not supported upstream yet. Several changes would be needed to make the 5.1.5 version of swoole build with php 8.4. Upstream explicitly removed support from the 5.1 branch swoole/swoole-src#5525 There is likely 6.0.0 release coming soon (beta released 2024-10-17). We will have to manually re-add at that point in time. * php-8.4-memcached and php-8.4-redis are separated out to another PR as they are dependent on php-8.4-igbinary output.
Please merge this pull request ! |
@Danack any update on this? Sorry to rush but it's a major roadblock for many projects. |
fixes #689
see https://github.com/php/php-src/pull/15391/files