Make WordPress Core

Opened 6 years ago

Last modified 6 years ago

#51773 new defect (bug)

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

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

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 6 years ago.
Patch to check for empty $script_filename_dir before passing it to strpos()

Download all attachments as: .zip

Change History (2)

@bjorsch
6 years ago

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

#1 @kraftbj
6 years ago

  • Version3.7

Introduced in r25436.

Note: See TracTickets for help on using tickets.