Commit 1ebc4c5
committed
Block Supports: Avoid throwing warning when checking for class attribute as string.
When encountering HTML tags with boolean or missing tags, the get_attribute() method in the HTML API returns true and null, respectively. If these returned values are sent directly into string comparison functions then as of PHP 8.0 they will throw E_DEPRECATED errors.
In this patch, block supports is enhanced to check that the class value is a string before it performs string operations on it.
Also in this patch: using `assertEqualHTML()` in background support test instead of `assertSame()`
Developed in #5486
Discussed in https://core.trac.wordpress.org/ticket/59622
Props dmsnell, jonsurrell, hellofromtonya, peterwilsoncc.
Fixes #59622.
git-svn-id: https://develop.svn.wordpress.org/trunk@60727 602fd350-edb4-49c9-b593-d223f7449a821 parent 00b3b63 commit 1ebc4c5
File tree
3 files changed
+21
-9
lines changed- src/wp-includes/block-supports
- tests/phpunit/tests/block-supports
3 files changed
+21
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
97 | 95 | | |
98 | 96 | | |
99 | | - | |
100 | 97 | | |
101 | 98 | | |
102 | 99 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
184 | 184 | | |
185 | 185 | | |
186 | 186 | | |
187 | | - | |
| 187 | + | |
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
| |||
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
189 | 204 | | |
190 | 205 | | |
191 | 206 | | |
| |||
0 commit comments