Title: PHP deprecated: strstr(): Passing null to parameter
Last modified: January 23, 2024

---

# PHP deprecated: strstr(): Passing null to parameter

 *  Resolved [Marc Bernard](https://wordpress.org/support/users/luxxor/)
 * (@luxxor)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/php-deprecated-preg_replace-passing-null-to-parameter-2/)
 * 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`:
 *     ```wp-block-code
       $feed_url_template = add_query_arg( 's', 'searchTerms', get_bloginfo( "{$feed}_url" ) );
       ```
   
 * Thanks for the fix,
   Marc
    -  This topic was modified 2 years, 4 months ago by [Marc Bernard](https://wordpress.org/support/users/luxxor/).

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [Marc Bernard](https://wordpress.org/support/users/luxxor/)
 * (@luxxor)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/php-deprecated-preg_replace-passing-null-to-parameter-2/#post-17365399)
 * PR: [https://github.com/pfefferle/wordpress-open-search-document/pull/6](https://github.com/pfefferle/wordpress-open-search-document/pull/6)
 *  Plugin Author [Matthias Pfefferle](https://wordpress.org/support/users/pfefferle/)
 * (@pfefferle)
 * [2 years, 4 months ago](https://wordpress.org/support/topic/php-deprecated-preg_replace-passing-null-to-parameter-2/#post-17365445)
 * Thanks [@luxxor](https://wordpress.org/support/users/luxxor/)
 * Merged and released 🙂

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘PHP deprecated: strstr(): Passing null to parameter’ is closed to new
replies.

 * ![](https://ps.w.org/open-search-document/assets/icon-128x128.png?rev=2841764)
 * [Open Search](https://wordpress.org/plugins/open-search-document/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/open-search-document/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/open-search-document/)
 * [Active Topics](https://wordpress.org/support/plugin/open-search-document/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/open-search-document/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/open-search-document/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Matthias Pfefferle](https://wordpress.org/support/users/pfefferle/)
 * Last activity: [2 years, 4 months ago](https://wordpress.org/support/topic/php-deprecated-preg_replace-passing-null-to-parameter-2/#post-17365445)
 * Status: resolved