Skip to content
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

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
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
6 changes: 3 additions & 3 deletions imagick.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Copy link
Contributor

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

Suggested change
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

Copy link
Contributor

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

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor

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

IMAGICK_FREE_MAGICK_MEMORY(format);
} else {
retval = rv;
Expand Down Expand Up @@ -683,7 +683,7 @@ static zval *php_imagick_read_property(zval *object, zval *member, int type, voi
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));
IMAGICK_FREE_MAGICK_MEMORY(format);
} else {
retval = rv;
Expand Down Expand Up @@ -766,7 +766,7 @@ static zval *php_imagick_read_property(zval *object, zval *member, int type, con

if (format) {
ZVAL_STRING(retval, format, 1);
php_strtolower(Z_STRVAL_P(retval), Z_STRLEN_P(retval));
zend_str_tolower(Z_STRVAL_P(retval), Z_STRLEN_P(retval));
IMAGICK_FREE_MAGICK_MEMORY(format);
} else {
ZVAL_STRING(retval, "", 1);
Expand Down