Make WordPress Core

Opened 3 years ago

Last modified 3 years ago

#51773 new defect (bug)

wp_guess_url() calls strpos() incorrectly if $_SERVER['SCRIPT_FILENAME'] is empty

Reported by: bjorsch's profile bjorsch Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version: 3.7
Component: General Keywords:
Focuses: Cc:

Description

This can happen, for example, if using PHPUnit's @runInSeparateProcess.

The message produced is

PHP Warning:  strpos(): Empty needle in /var/www/html/wp-includes/functions.php on line 5435

In the aforementioned PHPUnit case, that warning causes tests to fail.

Attachments (1)

patch.diff (919 bytes) - added by bjorsch 3 years ago.
Patch to check for empty $script_filename_dir before passing it to strpos()

Download all attachments as: .zip

Change History (2)

@bjorsch
3 years ago

Patch to check for empty $script_filename_dir before passing it to strpos()

#1 @kraftbj
3 years ago

  • Version set to 3.7

Introduced in r25436.

Note: See TracTickets for help on using tickets.