#64539 closed task (blessed) (fixed)
Deprecate the `addslashes_gpc()` function
| Reported by: |
|
Owned by: |
|
|---|---|---|---|
| Milestone: | 7.0 | Priority: | normal |
| Severity: | normal | Version: | |
| Component: | General | Keywords: | has-patch has-unit-tests commit add-to-field-guide needs-dev-note |
| Focuses: | Cc: |
Description (last modified by )
The addslashes_gpc() function is just a wrapper for wp_slash(). It should be moved to deprecated.php and deprecated to help reduce confusion about magic quoting, which is where this function originated.
There are some uses of addslashes_gpc() that need to be switched to wp_slash() too.
Change History (9)
This ticket was mentioned in PR #10771 on WordPress/wordpress-develop by @rutviksavsani.
4 months ago
#2
- Keywords has-patch has-unit-tests added; needs-patch removed
@rutviksavsani commented on PR #10771:
3 months ago
#4
@audrasjb @westonruter @mindctrl Thanks for the reviews.
Who would be the best person to merge this to the SVN?
@westonruter commented on PR #10771:
3 months ago
#5
I'm happy to do so.
#8
@
2 months ago
- Keywords add-to-field-guide needs-dev-note added
This is worth mentioning in the Field Guide.
Also adding needs-dev-note just in case we can mention it in a more general note.
#9
@
2 months ago
I drafted a dev note section for the field guide: https://docs.google.com/document/d/1PpVQE9kuNE0KWfQxUQKfrbzfuRBkuSg6Sz7-NUWCsKI/edit?tab=t.0
I wanted to take the opportunity to provide context for why this function was needed and why wp_slash() is still needed, since authors can still liable to pass unslashed data to functions that require it.
Related: https://github.com/WordPress/WordPress-Coding-Standards/issues/172
In this pull request, we are deprecating the
addslashes_gpcfunction as it was just a wrapper function towp_slashAdditionally, I have added PHPUnit tests for the same as well, let me know if they are not required and I can remove it.
Trac ticket: https://core.trac.wordpress.org/ticket/64539