Changeset 52968
- Timestamp:
- 03/21/2022 12:11:08 AM (3 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/kses.php
r52895 r52968 82 82 ), 83 83 'article' => array( 84 'align' => true, 85 'dir' => true, 86 'lang' => true, 87 'xml:lang' => true, 84 'align' => true, 88 85 ), 89 86 'aside' => array( 90 'align' => true, 91 'dir' => true, 92 'lang' => true, 93 'xml:lang' => true, 87 'align' => true, 94 88 ), 95 89 'audio' => array( … … 102 96 ), 103 97 'b' => array(), 104 'bdo' => array( 105 'dir' => true, 106 ), 98 'bdo' => array(), 107 99 'big' => array(), 108 100 'blockquote' => array( 109 'cite' => true, 110 'lang' => true, 111 'xml:lang' => true, 101 'cite' => true, 112 102 ), 113 103 'br' => array(), … … 121 111 'align' => true, 122 112 ), 123 'cite' => array( 124 'dir' => true, 125 'lang' => true, 126 ), 113 'cite' => array(), 127 114 'code' => array(), 128 115 'col' => array( … … 131 118 'charoff' => true, 132 119 'span' => true, 133 'dir' => true,134 120 'valign' => true, 135 121 'width' => true, … … 149 135 'dfn' => array(), 150 136 'details' => array( 151 'align' => true, 152 'dir' => true, 153 'lang' => true, 154 'open' => true, 155 'xml:lang' => true, 137 'align' => true, 138 'open' => true, 156 139 ), 157 140 'div' => array( 158 'align' => true, 159 'dir' => true, 160 'lang' => true, 161 'xml:lang' => true, 141 'align' => true, 162 142 ), 163 143 'dl' => array(), … … 166 146 'fieldset' => array(), 167 147 'figure' => array( 168 'align' => true, 169 'dir' => true, 170 'lang' => true, 171 'xml:lang' => true, 148 'align' => true, 172 149 ), 173 150 'figcaption' => array( 174 'align' => true, 175 'dir' => true, 176 'lang' => true, 177 'xml:lang' => true, 151 'align' => true, 178 152 ), 179 153 'font' => array( … … 183 157 ), 184 158 'footer' => array( 185 'align' => true, 186 'dir' => true, 187 'lang' => true, 188 'xml:lang' => true, 159 'align' => true, 189 160 ), 190 161 'h1' => array( … … 207 178 ), 208 179 'header' => array( 209 'align' => true, 210 'dir' => true, 211 'lang' => true, 212 'xml:lang' => true, 180 'align' => true, 213 181 ), 214 182 'hgroup' => array( 215 'align' => true, 216 'dir' => true, 217 'lang' => true, 218 'xml:lang' => true, 183 'align' => true, 219 184 ), 220 185 'hr' => array( … … 254 219 ), 255 220 'main' => array( 256 'align' => true, 257 'dir' => true, 258 'lang' => true, 259 'xml:lang' => true, 221 'align' => true, 260 222 ), 261 223 'map' => array( … … 267 229 ), 268 230 'nav' => array( 269 'align' => true, 270 'dir' => true, 271 'lang' => true, 272 'xml:lang' => true, 231 'align' => true, 273 232 ), 274 233 'object' => array( … … 283 242 ), 284 243 'p' => array( 285 'align' => true, 286 'dir' => true, 287 'lang' => true, 288 'xml:lang' => true, 244 'align' => true, 289 245 ), 290 246 'pre' => array( … … 297 253 'samp' => array(), 298 254 'span' => array( 299 'dir' => true, 300 'align' => true, 301 'lang' => true, 302 'xml:lang' => true, 255 'align' => true, 303 256 ), 304 257 'section' => array( 305 'align' => true, 306 'dir' => true, 307 'lang' => true, 308 'xml:lang' => true, 258 'align' => true, 309 259 ), 310 260 'small' => array(), … … 313 263 'sub' => array(), 314 264 'summary' => array( 315 'align' => true, 316 'dir' => true, 317 'lang' => true, 318 'xml:lang' => true, 265 'align' => true, 319 266 ), 320 267 'sup' => array(), … … 325 272 'cellpadding' => true, 326 273 'cellspacing' => true, 327 'dir' => true,328 274 'rules' => true, 329 275 'summary' => true, … … 344 290 'charoff' => true, 345 291 'colspan' => true, 346 'dir' => true,347 292 'headers' => true, 348 293 'height' => true, … … 1238 1183 * 1239 1184 * @since 4.2.3 1240 * @since 5.0.0 Add support for `data-*` wildcard attributes.1185 * @since 5.0.0 Added support for `data-*` wildcard attributes. 1241 1186 * 1242 1187 * @param string $name The attribute name. Passed by reference. Returns empty string when not allowed. … … 1272 1217 * double hyphens `--` are not accepted by WordPress. 1273 1218 */ 1274 if ( strpos( $name_low, 'data-' ) === 0 && ! empty( $allowed_attr['data-*'] ) && preg_match( '/^data(?:-[a-z0-9_]+)+$/', $name_low, $match ) ) { 1219 if ( strpos( $name_low, 'data-' ) === 0 && ! empty( $allowed_attr['data-*'] ) 1220 && preg_match( '/^data(?:-[a-z0-9_]+)+$/', $name_low, $match ) 1221 ) { 1275 1222 /* 1276 1223 * Add the whole attribute name to the allowed attributes and set any restrictions … … 2553 2500 * 2554 2501 * @since 3.5.0 2555 * @since 5.0.0 Add support for `data-*` wildcard attributes. 2502 * @since 5.0.0 Added support for `data-*` wildcard attributes. 2503 * @since 6.0.0 Added `dir`, `lang`, and `xml:lang` to global attributes. 2504 * 2556 2505 * @access private 2557 2506 * @ignore … … 2568 2517 'aria-hidden' => true, 2569 2518 'class' => true, 2519 'data-*' => true, 2520 'dir' => true, 2570 2521 'id' => true, 2522 'lang' => true, 2571 2523 'style' => true, 2572 2524 'title' => true, 2573 2525 'role' => true, 2574 ' data-*'=> true,2526 'xml:lang' => true, 2575 2527 ); 2576 2528 -
trunk/tests/phpunit/tests/kses.php
r52326 r52968 495 495 foreach ( $tags as $tag ) { 496 496 $this->assertTrue( $tag['class'] ); 497 $this->assertTrue( $tag['dir'] ); 497 498 $this->assertTrue( $tag['id'] ); 499 $this->assertTrue( $tag['lang'] ); 498 500 $this->assertTrue( $tag['style'] ); 499 501 $this->assertTrue( $tag['title'] ); 502 $this->assertTrue( $tag['xml:lang'] ); 500 503 } 501 504
Note: See TracChangeset
for help on using the changeset viewer.