GoogleChromeLabs / wp-native-lazyload

WordPress plugin to lazy-load media using the native browser feature.
https://wordpress.org/plugins/native-lazyload/
Apache License 2.0
51 stars 13 forks source link

Added escaping in line with VIP Coding Standards #20

Closed rebeccahum closed 4 years ago

rebeccahum commented 4 years ago

For more information, see: https://vip.wordpress.com/documentation/vip-go/code-review-blockers-warnings-notices/#validation-sanitization-and-escaping

Summary

This PR can be summarized in the following changelog entry:

Relevant technical choices

For more information, see: https://vip.wordpress.com/documentation/vip-go/code-review-blockers-warnings-notices/#validation-sanitization-and-escaping

Checklist:

googlebot commented 4 years ago

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

:memo: Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

rebeccahum commented 4 years ago

@googlebot I signed it!

googlebot commented 4 years ago

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

rebeccahum commented 4 years ago

Thanks for the feedback @swissspidy. Are we good to go on this?

swissspidy commented 4 years ago

@rebeccahum Almost! WordPress.Security.EscapeOutput.OutputNotEscaped now flags that the output of phpversion() is not escaped.

rebeccahum commented 4 years ago

@swissspidy That's a false positive. We typically don't recommend escaping on built-in PHP functions (as the output cannot be modified by any hooks).

swissspidy commented 4 years ago

That's a false positive. We typically don't recommend escaping on built-in PHP functions (as the output cannot be modified by any hooks).

Then let's use // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped to make PHPCS happy.

rebeccahum commented 4 years ago

@swissspidy Done, thanks!