• Resolved horgster

    (@horgster)


    Hi!

    We get this error when our site is running in Debug Mode.
    Can you please fix this simple issue in next version of WooCommerce? Running version 7.3.0


    Deprecated: strstr(): Passing null to parameter #1 ($haystack) of type string is deprecated in?www/wp-content/plugins/woocommerce/includes/wc-page-functions.php?on line?139

    Thanks for helping out!
    Kind Regards
    Horgster

Viewing 5 replies - 1 through 5 (of 5 total)
  • I am facing the same issue on my websites

    Roxy

    (@roxannestoltz)

    Hi @horgster ,

    Thanks for reaching out!

    In order to get a better understanding of your sites current setup, please share a copy of your site’s System Status Report.

    You can find it via WooCommerce > Status. Select Get system report and then Copy for support

    Once you’ve done that, kindly share the results in your response here.

    Hi @mgaber ,

    I understand that you are experiencing the same issue.

    Since you’re not the person who originally started this topic then, per?the forum guidelines, would you?please start your own topic?

    Also, please include your System Status report when doing so. You can find it via WooCommerce > Status. Select Get system report and then Copy for support

    We’ll be more than happy to help there!

    Cheers!

    Thread Starter horgster

    (@horgster)

    Hi @roxannestoltz

    I don’t want to share the System Report here in the public as it contains sensitive data. But I can e-mail it if you contact me at [email protected]

    This error appears when running PHP 8.1

    The problem can be resolved if the variables are declared as “string” like this:

    OLD CODE
    if ( strstr( $path, $customer_logout ) || strstr( $query, $customer_logout ) ) {

    New CODE line 139
    if ( strstr( (string)$path, (string)$customer_logout ) || strstr( (string)$query, (string)$customer_logout ) ) {

    I have submitted this as an change in GitHub as well

    https://github.com/woocommerce/woocommerce/blob/trunk/plugins/woocommerce/includes/wc-page-functions.php

    Best Regards
    Horgster

    Roxy

    (@roxannestoltz)

    Hi @horgster ,

    Thanks for sharing this!

    So the issue is no longer present when rolling back to PHP Version 7.4, yes?

    I have checked and can see that there is already an open GitHub issue for this here, and our developers are aware of this however we do not have an ETA on this fix.

    I would suggest adding this as a comment on the issues thread, as well as subscribing for any updates are they happen.

    Hope this helps!

    Rynald0s

    (@rynald0s)

    Automattic Happiness Engineer

    Howdy.

    We haven’t heard back from you in a while, so I’m going to go ahead and mark this thread as resolved. If you have any other questions please start a new thread.

    Cheers!

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Deprecated error in wc-page-functions.php line 139’ is closed to new replies.