Commit 4fc5f0e
committed
Code Modernization: Pass correct value to
This particular code block only makes sense to run when `$this->return_url` is not null. Previously, it caused a "passing null to non-nullable" deprecation notice on PHP 8.1.
By moving the code into the `if ( $this->return_url )` condition block, the code will only be run when `$this->return_url` contains a non-falsey/non-null value.
No additional tests added as this issue was found via the existing tests for the function containing the bug.
This solves the following two PHP 8.1 test errors:
{{{
1) Tests_WP_Customize_Manager::test_return_url
parse_url(): Passing null to parameter #1 ($url) of type string is deprecated
/var/www/src/wp-includes/class-wp-customize-manager.php:4696
/var/www/tests/phpunit/tests/customize/manager.php:2975
/var/www/vendor/bin/phpunit:123
2) Tests_WP_Customize_Manager::test_customize_pane_settings
parse_url(): Passing null to parameter #1 ($url) of type string is deprecated
/var/www/src/wp-includes/class-wp-customize-manager.php:4696
/var/www/src/wp-includes/class-wp-customize-manager.php:4898
/var/www/tests/phpunit/tests/customize/manager.php:3085
/var/www/vendor/bin/phpunit:123
}}}
Follow-up to [46754].
Props jrf, costdev.
See #55656.
git-svn-id: https://develop.svn.wordpress.org/trunk@54135 602fd350-edb4-49c9-b593-d223f7449a82parse_url() in WP_Customize_Manager::get_return_url().1 parent 2d98ba4 commit 4fc5f0e
1 file changed
Lines changed: 15 additions & 15 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4686 | 4686 | | |
4687 | 4687 | | |
4688 | 4688 | | |
| 4689 | + | |
| 4690 | + | |
| 4691 | + | |
| 4692 | + | |
| 4693 | + | |
| 4694 | + | |
| 4695 | + | |
| 4696 | + | |
| 4697 | + | |
| 4698 | + | |
| 4699 | + | |
| 4700 | + | |
| 4701 | + | |
| 4702 | + | |
| 4703 | + | |
4689 | 4704 | | |
4690 | 4705 | | |
4691 | 4706 | | |
| |||
4694 | 4709 | | |
4695 | 4710 | | |
4696 | 4711 | | |
4697 | | - | |
4698 | | - | |
4699 | | - | |
4700 | | - | |
4701 | | - | |
4702 | | - | |
4703 | | - | |
4704 | | - | |
4705 | | - | |
4706 | | - | |
4707 | | - | |
4708 | | - | |
4709 | | - | |
4710 | | - | |
4711 | | - | |
4712 | 4712 | | |
4713 | 4713 | | |
4714 | 4714 | | |
| |||
0 commit comments