Fix: Prevent empty markup when site title or description is empty#8582
Fix: Prevent empty markup when site title or description is empty#8582Sukhendu2002 wants to merge 10 commits intoWordPress:trunkfrom
Conversation
Test using WordPress PlaygroundThe changes in this pull request can previewed and tested using a WordPress Playground instance. WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser. Some things to be aware of
For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation. |
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
SirLouen
left a comment
There was a problem hiding this comment.
I understand that you were taking the @audrasjb first proposal, which is not wrong at all, but can be a little improved.
And after reviewing all my proposed changes, someone could say:
But not empty is a safer choice than full
And its true, but let's not forget that the incoming variables are variables coming from the database, variables that have been sanitized to death. It's not like a first variable coming from a mixed input parameter that we should take extra caution.
SirLouen
left a comment
There was a problem hiding this comment.
Some additional changes provided in almost all files to improve final code quality, give it a check.
joedolson
left a comment
There was a problem hiding this comment.
As is, this patch introduces security vulnerabilities. bloginfo() internally calls get_bloginfo() with the filter argument set to display, which executes esc_html on the output. But if you call get_bloginfo() directly, the output is fetched raw, and is not safe.
You can either add the display argument to all get_bloginfo() calls or add late escaping to the resulting variables; either would fix the issue.
|
The In the event that filtering might empty the string, adding PHPCS might complain about |
Trac ticket: https://core.trac.wordpress.org/ticket/44656
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.