Skip to content

Conversation

@AbmSourav
Copy link

@AbmSourav AbmSourav commented Jan 4, 2022

Copy link

@kasparsd kasparsd left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the pull request! Please see my initial feedback inline.

*/
function _foo_bar_php_version_error() {
printf( '<div class="error"><p>%s</p></div>', esc_html( _foo_bar_php_version_text() ) );
printf( '<div class="error"><p>%s</p></div>', _foo_bar_php_version_text() );

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we keep the esc_html() sanitiser during the output here? Currently it is being removed from all paces.

The best practice would be to sanitize late when we know the type of output we're serving. Technically, the return value of _foo_bar_php_version_text() could be used for things like REST API errors, JS callback errors which would each require a different santiser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants