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

Fixed strcmp(): Passing null to parameter #1 ($string1) of type strin… #4212

Merged
merged 5 commits into from
Sep 23, 2024

Conversation

kiatng
Copy link
Contributor

@kiatng kiatng commented Sep 19, 2024

…g is deprecated

Description (*)

Array
(
    [type] => 8192:E_DEPRECATED
    [message] => strcmp(): Passing null to parameter #1 ($string1) of type string is deprecated
    [file] => .../app/code/core/Mage/Customer/controllers/AccountController.php
    [line] => 935
    [uri] => /customer/account/changeforgotten/
)

@kiatng kiatng added the PHP 8 Related to PHP8 label Sep 19, 2024
@github-actions github-actions bot added the Component: Customer Relates to Mage_Customer label Sep 19, 2024
Copy link
Contributor

@sreichel sreichel left a comment

Choose a reason for hiding this comment

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

Works.

Maybe use if (is_null($customerToken || ...) or if (!is_string($customerToken || ...) ?

It would avoid to call strcmp().

sreichel
sreichel previously approved these changes Sep 19, 2024
Co-authored-by: Sven Reichel <github-sr@hotmail.com>
@sreichel sreichel merged commit 4ddd7fb into OpenMage:main Sep 23, 2024
18 checks passed
@sreichel sreichel deleted the strcmp_null_deprecation branch September 23, 2024 05:52
fballiano added a commit to MahoCommerce/maho that referenced this pull request Sep 23, 2024
@sreichel
Copy link
Contributor

@fballiano thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Customer Relates to Mage_Customer PHP 8 Related to PHP8
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants