Commit d6e1720
committed
Query: Prevent querying for all terms in
This change brings the `include` parameter of `WP_Term_Query` up-to-speed with the `include` and `__in` parameters of other `_Query` classes, so that sending a value of `[0]` will not unintentionally perform an unbound query that returns all Terms.
It also introduces 3 new unit tests (for the Post, Term, and User query classes) to compare this behavior between them and ensure they remain consistent going forward.
Props audrasjb, hareesh-pillai, hellofromTonya, johnjamesjacoby, mukesh27.
Fixes #47719.
git-svn-id: https://develop.svn.wordpress.org/trunk@61048 602fd350-edb4-49c9-b593-d223f7449a82WP_Term_Query when include is set to [0].1 parent 409d03b commit d6e1720
File tree
4 files changed
+56
-5
lines changed- src/wp-includes
- tests/phpunit/tests
- post
- term
- user
4 files changed
+56
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
470 | 470 | | |
471 | 471 | | |
472 | 472 | | |
473 | | - | |
474 | 473 | | |
475 | 474 | | |
476 | 475 | | |
477 | 476 | | |
478 | | - | |
479 | 477 | | |
480 | | - | |
481 | 478 | | |
482 | 479 | | |
483 | 480 | | |
| |||
815 | 812 | | |
816 | 813 | | |
817 | 814 | | |
| 815 | + | |
| 816 | + | |
818 | 817 | | |
819 | | - | |
| 818 | + | |
820 | 819 | | |
821 | | - | |
| 820 | + | |
| 821 | + | |
822 | 822 | | |
823 | 823 | | |
824 | 824 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
778 | 778 | | |
779 | 779 | | |
780 | 780 | | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
| 792 | + | |
| 793 | + | |
| 794 | + | |
| 795 | + | |
| 796 | + | |
| 797 | + | |
781 | 798 | | |
782 | 799 | | |
783 | 800 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1051 | 1051 | | |
1052 | 1052 | | |
1053 | 1053 | | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
| 1063 | + | |
| 1064 | + | |
| 1065 | + | |
| 1066 | + | |
| 1067 | + | |
| 1068 | + | |
| 1069 | + | |
| 1070 | + | |
| 1071 | + | |
| 1072 | + | |
| 1073 | + | |
1054 | 1074 | | |
1055 | 1075 | | |
1056 | 1076 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1740 | 1740 | | |
1741 | 1741 | | |
1742 | 1742 | | |
| 1743 | + | |
| 1744 | + | |
| 1745 | + | |
| 1746 | + | |
| 1747 | + | |
| 1748 | + | |
| 1749 | + | |
| 1750 | + | |
| 1751 | + | |
| 1752 | + | |
| 1753 | + | |
| 1754 | + | |
| 1755 | + | |
| 1756 | + | |
1743 | 1757 | | |
1744 | 1758 | | |
1745 | 1759 | | |
| |||
0 commit comments