Opened 4 years ago
Last modified 4 years ago
#51773 new defect (bug)
wp_guess_url() calls strpos() incorrectly if $_SERVER['SCRIPT_FILENAME'] is empty
Reported by: | 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)
Note: See
TracTickets for help on using
tickets.
Patch to check for empty $script_filename_dir before passing it to strpos()