You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-------------------------------------------------------------
| WORDPRESS CODING STANDARDS CODING STANDARD: SAFE REDIRECT |
-------------------------------------------------------------
wp_safe_redirect() should be used whenever possible to prevent open redirect vulnerabilities. One of
the main uses of an open redirect vulnerability is to make phishing attacks more credible. In this
case the user sees your (trusted) domain and might get redirected to an attacker controlled website
aimed at stealing private information.
----------------------------------------- CODE COMPARISON ------------------------------------------
| Valid: Redirect can only go to allowed | Invalid: Unsafe redirect, can be abused. || domains. ||
----------------------------------------------------------------------------------------------------
| wp_safe_redirect( $location );| wp_redirect( $location );|
----------------------------------------------------------------------------------------------------
The text was updated successfully, but these errors were encountered:
For anyone who wants to contribute to this, but isn't that familiar with the tooling:
For in-depth step-by-step instructions on how to get started creating these docs, have a look at the sister-issue in WPCS for this: WordPress/WordPress-Coding-Standards#1722
Like in the WPCS a documentation should be added for every sniff, so that the
--generator
can be used to generate documentation.The TRT can benefit from this as well, because we can use this in our handbook as well (the examples).
The documentation looks something like this.
You can test what it looks like in the terminal by running
In the terminal.
The text was updated successfully, but these errors were encountered: