Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add WordPress.Security.SafeRedirect XML documentation #1742

Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
19 changes: 19 additions & 0 deletions WordPress/Docs/Security/SafeRedirectStandard.xml
@@ -0,0 +1,19 @@
<documentation title="Safe Redirect">
<standard>
<![CDATA[
Safe redirects must be used.
Copy link
Member

Choose a reason for hiding this comment

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

I'd like to see this expanded - why must safe redirects be used? What is a safe redirect? Why does a non-safe redirect even exist? Where can I find out more about this concept? etc.

]]>
</standard>
<code_comparison>
<code title="Valid: Safe redirect.">
<![CDATA[
wp_safe_redirect( $location );
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
wp_safe_redirect( $location );
<em>wp_safe_redirect</em>( $location );

]]>
</code>
<code title="Invalid: Unsafe redirect.">
<![CDATA[
wp_redirect( $location );
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
wp_redirect( $location );
<em>wp_redirect</em>( $location );

]]>
</code>
</code_comparison>
</documentation>