PHP Deprecated: ltrim(): Passing null to parameter #59154#5045
PHP Deprecated: ltrim(): Passing null to parameter #59154#5045NiharRan wants to merge 3 commits intoWordPress:trunkfrom
Conversation
|
@NiharRan Ultra-rapid fix 😃 |
|
The change LGTM 👍 But it needs a test. I'll push a test to this PR shortly. |
3480618 to
ce94eeb
Compare
|
Seems the service is hiccuping
|
Co-authored-by: Mukesh Panchal <mukeshpanchal27@users.noreply.github.com>
|
Running the new test locally on PHP 8.1 using the following command: Before the fix, the test result: After the fix, the test result: One of the first things I consider is if the fix breaks BC (backward compatibility). In other words, is the result (except for the deprecation) the same? This is why I forced pushed the test to come before the fix, i.e. to test what the result is. Before the fix, the result is:
After the fix, an empty string is still returned. This can also be seen in action here across different PHP versions https://3v4l.org/7cIvT. Notice, all versions return an empty string, even on PHP 8.1+. This means: no BC break 🎉 |
hellofromtonya
left a comment
There was a problem hiding this comment.
As noted here, the fix does indeed resolve the issue while maintaining BC of still returning an empty string.
LGTM 👍 Ready for commit.
|
Committed via https://core.trac.wordpress.org/changeset/56740. Thank you everyone for your contributions :) |
I added a check before filtering the link using the esc_url function.
function next_posts( $max_page = 0, $display = true ) {
$link = get_next_posts_page_link( $max_page );
}
Trac ticket: 59154