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

Remove deprecation Warning on sanitize_url() #2031

Closed
Ipstenu opened this issue Mar 11, 2022 · 3 comments · Fixed by #2121
Closed

Remove deprecation Warning on sanitize_url() #2031

Ipstenu opened this issue Mar 11, 2022 · 3 comments · Fixed by #2121
Assignees
Milestone

Comments

@Ipstenu
Copy link
Contributor

Ipstenu commented Mar 11, 2022

Bug Description

The use of sanitize_url() is still listed as deprecated, however as of WordPress 5.9 it has been un deprecated

Minimal Code Snippet

Use sanitize_url() in a line of code.
ERROR sanitize_url() has been deprecated since WordPress version 2.8.0. Use esc_url_raw() instead.
(WordPress.WP.DeprecatedFunctions.sanitize_urlFound)

This can be fixed by removing it from the deprecation list.

Tested Against develop branch?

I have not tested against develop, but I did check here:

https://github.com/WordPress/WordPress-Coding-Standards/blob/develop/WordPress/Sniffs/WP/DeprecatedFunctionsSniff.php#L412

So it's still on the sniffs :)

@jrfnl
Copy link
Member

jrfnl commented Mar 11, 2022

@Ipstenu Thanks for reporting this. The deprecation lists haven't been updated for WP 5.9 yet.

@jrfnl jrfnl added this to the 3.0.0 milestone Mar 11, 2022
@SergeyBiryukov
Copy link
Member

As of WordPress 6.1, sanitize_url() becomes the recommended function for sanitizing a URL, see #WP55852 for details.

I think it should be removed from the deprecated functions sniff (as noted above) and added to the list of sanitizing functions.

@jrfnl
Copy link
Member

jrfnl commented Jun 6, 2022

@SergeyBiryukov It definitely will be removed when we run the deprecated code scanner before releasing the next version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants