Commit 2ac765f
committed
ValidatedSanitizedInput: allow for more unslashing functions
As correctly pointed out in https://github.com/WordPress-Coding-Standards/WordPress-Coding-Standards/issues/ 869#issuecomment-478329921 and confirmed via a trace-back of the functions used by `wp_unslash()`, WP contains two additional unslashing functions which are perfectly valid to use for unslashing received data.
Refs:
* https://developer.wordpress.org/reference/functions/wp_unslash/
* https://developer.wordpress.org/reference/functions/stripslashes_deep/
* https://developer.wordpress.org/reference/functions/stripslashes_from_strings_only/
This commit adds allowance for using these. It also updates the error message to reflect this.
Includes unit tests.1 parent 363ff11 commit 2ac765f
File tree
2 files changed
+36
-11
lines changed- WordPress
- Tests/Security
2 files changed
+36
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
315 | 315 | | |
316 | 316 | | |
317 | 317 | | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
318 | 331 | | |
319 | 332 | | |
320 | 333 | | |
| |||
1801 | 1814 | | |
1802 | 1815 | | |
1803 | 1816 | | |
1804 | | - | |
1805 | | - | |
| 1817 | + | |
| 1818 | + | |
1806 | 1819 | | |
1807 | 1820 | | |
1808 | 1821 | | |
| |||
1833 | 1846 | | |
1834 | 1847 | | |
1835 | 1848 | | |
1836 | | - | |
1837 | | - | |
1838 | | - | |
1839 | | - | |
| 1849 | + | |
| 1850 | + | |
| 1851 | + | |
| 1852 | + | |
1840 | 1853 | | |
1841 | 1854 | | |
1842 | 1855 | | |
| |||
1851 | 1864 | | |
1852 | 1865 | | |
1853 | 1866 | | |
1854 | | - | |
1855 | | - | |
| 1867 | + | |
| 1868 | + | |
1856 | 1869 | | |
1857 | 1870 | | |
1858 | 1871 | | |
1859 | | - | |
| 1872 | + | |
| 1873 | + | |
| 1874 | + | |
| 1875 | + | |
1860 | 1876 | | |
1861 | 1877 | | |
1862 | 1878 | | |
| |||
1909 | 1925 | | |
1910 | 1926 | | |
1911 | 1927 | | |
1912 | | - | |
| 1928 | + | |
1913 | 1929 | | |
1914 | 1930 | | |
1915 | 1931 | | |
| |||
1918 | 1934 | | |
1919 | 1935 | | |
1920 | 1936 | | |
1921 | | - | |
| 1937 | + | |
1922 | 1938 | | |
1923 | 1939 | | |
1924 | 1940 | | |
| |||
Lines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
322 | 322 | | |
323 | 323 | | |
324 | 324 | | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
0 commit comments