dmchale / disable-json-api

Public repo for the "Disable REST API" WordPress plugin, currently with 90,000+ active installs in the wordpress.org repository
10 stars 9 forks source link

Suggest: Use single quotes whenever possible #25

Closed tangrufus closed 6 years ago

tangrufus commented 6 years ago

Although we already using esc_xxx functions to avoid XSS kind of things, consider using single quotes whenever possible to avoid evil translator do evil string interpolations. Better safe than worry.

For example:

https://github.com/dmchale/disable-json-api/blob/0b635aae0de1ddee752541139973f49d66efbc8e/admin.php#L24

tangrufus commented 6 years ago

I was over worried. After checking the source code, string interpolations should not happen after translation, i.e: __() or similar functions.