Stackable Error – stripos expects string array given
-
Hi. In the latest two versions I got this error on my client’s website:
Fatal error: Uncaught TypeError: stripos(): Argument #1 ($haystack) must be of type string, array given in /wp-content/plugins/stackable-ultimate-gutenberg-blocks-premium-c/pro__premium_only/src/conditional-display/post-meta.php:76
And I had to fix it myself like this:
if ( $operator === 'contains' ) { if(is_array($value)){ return stripos( $value[0], $expected ) !== false; }else{ return stripos( $value, $expected ) !== false; } } if ( $operator === 'does-not-contain' ) { if(is_array($value)){ return stripos( $value[0], $expected ) === false; }else{ return stripos( $value, $expected ) === false; } }
Please consider applying it in the next version. Thanks.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Stackable Error – stripos expects string array given’ is closed to new replies.