Title: E_WARNING: strpos(): Empty needle
Last modified: August 19, 2023

---

# E_WARNING: strpos(): Empty needle

 *  Resolved [Oliver Campion](https://wordpress.org/support/users/domainsupport/)
 * (@domainsupport)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/e_warning-strpos-empty-needle/)
 * Hi,
 * We’re getting quite a few of these notices …
 *     ```wp-block-code
       [19-Aug-2023 16:22:11 UTC] E_WARNING: strpos(): Empty needle in /wp-content/plugins/product-input-fields-for-woocommerce/includes/alg-wc-pif-functions.php on line 141
       ```
   
 * Please advise.
 * Many thanks,
 * Oliver

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

 *  Plugin Support [oluisrael](https://wordpress.org/support/users/oluisrael/)
 * (@oluisrael)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/e_warning-strpos-empty-needle/#post-16986234)
 * [@domainsupport](https://wordpress.org/support/users/domainsupport/) Can you 
   please let me know the PHP version your site is running on and the WooCommerce
   version currently active on your site?
 *  Thread Starter [Oliver Campion](https://wordpress.org/support/users/domainsupport/)
 * (@domainsupport)
 * [2 years, 9 months ago](https://wordpress.org/support/topic/e_warning-strpos-empty-needle/#post-16986404)
 * PHP v7.4.30, WooCommerce v8.0.2
 * This is happening because on line 141 of `/product-input-fields-for-woocommerce/
   includes/alg-wc-pif-functions.php` …
 *     ```wp-block-code
       $jqueryui_format .= ( isset( $symbols_matching[ $char ] ) && strpos( $jqueryui_format, $symbols_matching[ $char ] ) !== false ) ? $symbols_matching[ $char ] : $char;
       ```
   
 * … you are using `isset( $symbols_matching[ $char ] )` to check if an array element
   exists but this is not sufficient because some of the array elements are empty
   strings. So you need to use this instead `isset( $symbols_matching[ $char ] )&&``
   $symbols_matching[ $char ]`
 * The line should then read as follows …
 *     ```wp-block-code
       $jqueryui_format .= ( isset( $symbols_matching[ $char ] ) && $symbols_matching[ $char ] && strpos( $jqueryui_format, $symbols_matching[ $char ] ) !== false ) ? $symbols_matching[ $char ] : $char;
       ```
   
 * … and the warning will not be shown.
 * Oliver

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

The topic ‘E_WARNING: strpos(): Empty needle’ is closed to new replies.

 * ![](https://ps.w.org/product-input-fields-for-woocommerce/assets/icon-256x256.
   png?rev=2717446)
 * [Product Input Fields for WooCommerce](https://wordpress.org/plugins/product-input-fields-for-woocommerce/)
 * [Support Threads](https://wordpress.org/support/plugin/product-input-fields-for-woocommerce/)
 * [Active Topics](https://wordpress.org/support/plugin/product-input-fields-for-woocommerce/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/product-input-fields-for-woocommerce/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/product-input-fields-for-woocommerce/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [Oliver Campion](https://wordpress.org/support/users/domainsupport/)
 * Last activity: [2 years, 9 months ago](https://wordpress.org/support/topic/e_warning-strpos-empty-needle/#post-16986404)
 * Status: resolved