~canonical-sysadmins/wordpress/4.1.3

« back to all changes in this revision

Viewing changes to wp-includes/kses.php

  • Committer: Nick Moffitt
  • Date: 2015-01-15 11:05:37 UTC
  • mfrom: (1.1.1 wp4-upstream)
  • Revision ID: nick.moffitt@canonical.com-20150115110537-8bp1y42eyg0jsa7c
Tags: 4.1
MergeĀ upstreamĀ versionĀ 4.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
88
88
                        'lang' => true,
89
89
                        'xml:lang' => true,
90
90
                ),
 
91
                'audio' => array(
 
92
                        'autoplay' => true,
 
93
                        'controls' => true,
 
94
                        'loop' => true,
 
95
                        'muted' => true,
 
96
                        'preload' => true,
 
97
                        'src' => true,
 
98
                ),
91
99
                'b' => array(),
92
100
                'big' => array(),
93
101
                'blockquote' => array(
119
127
                        'valign' => true,
120
128
                        'width' => true,
121
129
                ),
 
130
                'colgroup' => array(
 
131
                        'align' => true,
 
132
                        'char' => true,
 
133
                        'charoff' => true,
 
134
                        'span' => true,
 
135
                        'valign' => true,
 
136
                        'width' => true,
 
137
                ),
122
138
                'del' => array(
123
139
                        'datetime' => true,
124
140
                ),
364
380
                        'charoff' => true,
365
381
                        'valign' => true,
366
382
                ),
 
383
                'track' => array(
 
384
                        'default' => true,
 
385
                        'kind' => true,
 
386
                        'label' => true,
 
387
                        'src' => true,
 
388
                        'srclang' => true,
 
389
                ),
367
390
                'tt' => array(),
368
391
                'u' => array(),
369
392
                'ul' => array(
374
397
                        'type' => true,
375
398
                ),
376
399
                'var' => array(),
 
400
                'video' => array(
 
401
                        'autoplay' => true,
 
402
                        'controls' => true,
 
403
                        'height' => true,
 
404
                        'loop' => true,
 
405
                        'muted' => true,
 
406
                        'poster' => true,
 
407
                        'preload' => true,
 
408
                        'src' => true,
 
409
                        'width' => true,
 
410
                ),
377
411
        );
378
412
 
379
413
        /**
627
661
 *
628
662
 * @access private
629
663
 * @since 1.0.0
630
 
 * @uses wp_kses_attr()
631
664
 *
632
665
 * @param string $string Content to filter
633
666
 * @param array $allowed_html Allowed HTML elements
1139
1172
/**
1140
1173
 * Converts and fixes HTML entities.
1141
1174
 *
1142
 
 * This function normalizes HTML entities. It will convert "AT&T" to the correct
1143
 
 * "AT&T", ":" to ":", "&#XYZZY;" to "&#XYZZY;" and so on.
 
1175
 * This function normalizes HTML entities. It will convert `AT&T` to the correct
 
1176
 * `AT&T`, `:` to `:`, `&#XYZZY;` to `&#XYZZY;` and so on.
1144
1177
 *
1145
1178
 * @since 1.0.0
1146
1179
 *
1185
1218
/**
1186
1219
 * Callback for wp_kses_normalize_entities() regular expression.
1187
1220
 *
1188
 
 * This function helps wp_kses_normalize_entities() to only accept 16-bit values
1189
 
 * and nothing more for &#number; entities.
 
1221
 * This function helps {@see wp_kses_normalize_entities()} to only accept 16-bit
 
1222
 * values and nothing more for `&#number;` entities.
1190
1223
 *
1191
1224
 * @access private
1192
1225
 * @since 1.0.0
1244
1277
/**
1245
1278
 * Convert all entities to their character counterparts.
1246
1279
 *
1247
 
 * This function decodes numeric HTML entities (A and A). It doesn't do
1248
 
 * anything with other entities like ä, but we don't need them in the URL
1249
 
 * protocol whitelisting system anyway.
 
1280
 * This function decodes numeric HTML entities (`A` and `A`).
 
1281
 * It doesn't do anything with other entities like ä, but we don't
 
1282
 * need them in the URL protocol whitelisting system anyway.
1250
1283
 *
1251
1284
 * @since 1.0.0
1252
1285
 *
1284
1317
 * Sanitize content with allowed HTML Kses rules.
1285
1318
 *
1286
1319
 * @since 1.0.0
1287
 
 * @uses $allowedtags
1288
1320
 *
1289
1321
 * @param string $data Content to filter, expected to be escaped with slashes
1290
1322
 * @return string Filtered content
1297
1329
 * Sanitize content with allowed HTML Kses rules.
1298
1330
 *
1299
1331
 * @since 2.9.0
1300
 
 * @uses $allowedtags
1301
1332
 *
1302
1333
 * @param string $data Content to filter, expected to not be escaped
1303
1334
 * @return string Filtered content
1358
1389
 * 'excerpt_save_pre', and 'content_filtered_save_pre' hooks.
1359
1390
 *
1360
1391
 * @since 2.0.0
1361
 
 * @uses add_filter() See description for what functions are added to what hooks.
1362
1392
 */
1363
1393
function kses_init_filters() {
1364
1394
        // Normal filtering
1413
1443
 * to have Kses filter the content. If the user does not have unfiltered_html
1414
1444
 * capability, then Kses filters are added.
1415
1445
 *
1416
 
 * @uses kses_remove_filters() Removes the Kses filters
1417
 
 * @uses kses_init_filters() Adds the Kses filters back if the user
1418
 
 *              does not have unfiltered HTML capability.
1419
1446
 * @since 2.0.0
1420
1447
 */
1421
1448
function kses_init() {