WP-API / OAuth2

Connect applications to your WordPress site without ever giving away your password.
GNU General Public License v2.0
172 stars 42 forks source link

Switch wp_safe_redirect back to wp_redirect #67

Closed rmccue closed 3 years ago

rmccue commented 3 years ago

This redirect is intentionally open, so must use the regular redirect function.

This was inadvertently broken as part of #58.

rmccue commented 3 years ago

I included the reasoning within the phpcs:ignore line; can add more if it's necessary?

kadamwhite commented 3 years ago

Nah that's good, I didn't scroll far enough right and forgot it could be explained online!

rmccue commented 3 years ago

Well, as it happens, I had the wrong sniff code anyway 😒

WPCS is additionally failing due to the (I guess new?) "Short array syntax is not allowed (Generic.Arrays.DisallowShortArraySyntax.Found)" error here, as well as "date() is affected by runtime timezone changes which can cause date/time to be incorrectly displayed. Use gmdate() instead. (WordPress.DateTime.RestrictedFunctions.date_date)".

Should I add these errors to the ignored rules? Should we have a separate PR for fixing them? The function change here has broken the entire OAuth system, so it's key that we get it fixed (i.e. the current head version just doesn't work).

rmccue commented 3 years ago

Should I add these errors to the ignored rules? Should we have a separate PR for fixing them?

Tackled in #68; I can merge that into this branch and phpcs should pass, if desired.

kadamwhite commented 3 years ago

Going to proceed with merge, fix looks good and the branch management makes sense