• Hi,

    I was going through our site’s debugging log, and noticed there are thousands of PHP deprecated notice below:

    PHP Deprecated:  strpos(): Passing null to parameter #1 ($haystack) of type string is deprecated in [...]/wp-content/plugins/wp-migrate-db/class/Common/Compatibility/Compatibility.php on line 278

    Line 278 is a comparison:

    false === strpos( $request_path, $api_base )

    and earlier (line 265):

    $request_path = parse_url( $request_uri, PHP_URL_PATH );

    parse_url() can return null when REQUEST_URI is missing or has no path (e.g. on CLI, cron, etc.). That leads to strpos( null, $api_base ), which triggers the PHP deprecated notice.

    Suggested fix in wp-migrate-db/class/Common/Compatibility/Compatibility.php:265:

    $request_path = parse_url( $request_uri, PHP_URL_PATH ) ?? '';
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.