• Resolved Marc Bernard

    (@luxxor)


    PHP 8.1, Open-Search 4.1.0

    I’m getting multiple PHP Deprecated warnings when using Open Search:

    [16-Jan-2024 16:31:44 UTC] PHP Deprecated: strstr(): Passing null to parameter #1 ($haystack) of type string is deprecated in /.../wp-includes/functions.php on line 1153
    [16-Jan-2024 16:31:44 UTC] PHP Deprecated: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /.../wp-includes/functions.php on line 1160
    [16-Jan-2024 16:31:44 UTC] PHP Deprecated: stripos(): Passing null to parameter #1 ($haystack) of type string is deprecated in /.../wp-includes/functions.php on line 1163
    [16-Jan-2024 16:31:44 UTC] PHP Deprecated: str_contains(): Passing null to parameter #1 ($haystack) of type string is deprecated in /.../wp-includes/functions.php on line 1170
    [16-Jan-2024 16:31:44 UTC] PHP Deprecated: str_contains(): Passing null to parameter #1 ($haystack) of type string is deprecated in /.../wp-includes/functions.php on line 1173

    Backtrace:

    0 /wp-content/plugins/open-search-document/includes/functions.php(52): add_query_arg('s', 'searchTerms', NULL)
    1 /wp-content/plugins/open-search-document/templates/open-search-document.php(8): OpenSearchDocument\feed_url_template('atom')

    Root cause:

    Incorrect use of bloginfo() which always returns NULL

    Fix:

    Replace by get_bloginfo() in includes/function.php:

    $feed_url_template = add_query_arg( 's', 'searchTerms', get_bloginfo( "{$feed}_url" ) );

    Thanks for the fix,
    Marc

    • This topic was modified 10 months, 1 week ago by Marc Bernard.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘PHP deprecated: strstr(): Passing null to parameter’ is closed to new replies.