Skip to content

Commit

Permalink
PHP Deprecated: strpos(): Passing null to parameter #1 () of type str…
Browse files Browse the repository at this point in the history
…ing is deprecated in /wordpress/plugins/jetpack/11.3-a.7/functions.compat.php on line 94
  • Loading branch information
kraftbj committed Aug 23, 2022
1 parent d5e90d4 commit 1f4ad20
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions projects/plugins/jetpack/changelog/fix-atomic-php-warnings
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Significance: patch
Type: other

Compat: wp_startswith should only pass to strpos if string is passed.
5 changes: 4 additions & 1 deletion projects/plugins/jetpack/functions.compat.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,14 @@ function youtube_sanitize_url( $url ) {
/**
* Check whether a string starts with a specific substring.
*
* @param var $haystack String we are filtering.
* @param string $haystack String we are filtering.
* @param string $needle The substring we are looking for.
* @return bool
*/
function wp_startswith( $haystack, $needle ) {
if ( ! $haystack || ! is_string( $haystack ) ) {
return false;
}
return 0 === strpos( $haystack, $needle );
}
endif;
Expand Down

0 comments on commit 1f4ad20

Please sign in to comment.