Edit File by line
/home/barbar84/www/wp-inclu...
File: kses.php
<?php
[0] Fix | Delete
/**
[1] Fix | Delete
* kses 0.2.2 - HTML/XHTML filter that only allows some elements and attributes
[2] Fix | Delete
* Copyright (C) 2002, 2003, 2005 Ulf Harnhammar
[3] Fix | Delete
*
[4] Fix | Delete
* This program is free software and open source software; you can redistribute
[5] Fix | Delete
* it and/or modify it under the terms of the GNU General Public License as
[6] Fix | Delete
* published by the Free Software Foundation; either version 2 of the License,
[7] Fix | Delete
* or (at your option) any later version.
[8] Fix | Delete
*
[9] Fix | Delete
* This program is distributed in the hope that it will be useful, but WITHOUT
[10] Fix | Delete
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
[11] Fix | Delete
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
[12] Fix | Delete
* more details.
[13] Fix | Delete
*
[14] Fix | Delete
* You should have received a copy of the GNU General Public License along
[15] Fix | Delete
* with this program; if not, write to the Free Software Foundation, Inc.,
[16] Fix | Delete
* 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
[17] Fix | Delete
* http://www.gnu.org/licenses/gpl.html
[18] Fix | Delete
*
[19] Fix | Delete
* [kses strips evil scripts!]
[20] Fix | Delete
*
[21] Fix | Delete
* Added wp_ prefix to avoid conflicts with existing kses users
[22] Fix | Delete
*
[23] Fix | Delete
* @version 0.2.2
[24] Fix | Delete
* @copyright (C) 2002, 2003, 2005
[25] Fix | Delete
* @author Ulf Harnhammar <http://advogato.org/person/metaur/>
[26] Fix | Delete
*
[27] Fix | Delete
* @package External
[28] Fix | Delete
* @subpackage KSES
[29] Fix | Delete
*/
[30] Fix | Delete
[31] Fix | Delete
/**
[32] Fix | Delete
* Specifies the default allowable HTML tags.
[33] Fix | Delete
*
[34] Fix | Delete
* Using `CUSTOM_TAGS` is not recommended and should be considered deprecated. The
[35] Fix | Delete
* {@see 'wp_kses_allowed_html'} filter is more powerful and supplies context.
[36] Fix | Delete
*
[37] Fix | Delete
* @see wp_kses_allowed_html()
[38] Fix | Delete
* @since 1.2.0
[39] Fix | Delete
*
[40] Fix | Delete
* @var array[]|false Array of default allowable HTML tags, or false to use the defaults.
[41] Fix | Delete
*/
[42] Fix | Delete
if ( ! defined( 'CUSTOM_TAGS' ) ) {
[43] Fix | Delete
define( 'CUSTOM_TAGS', false );
[44] Fix | Delete
}
[45] Fix | Delete
[46] Fix | Delete
// Ensure that these variables are added to the global namespace
[47] Fix | Delete
// (e.g. if using namespaces / autoload in the current PHP environment).
[48] Fix | Delete
global $allowedposttags, $allowedtags, $allowedentitynames, $allowedxmlentitynames;
[49] Fix | Delete
[50] Fix | Delete
if ( ! CUSTOM_TAGS ) {
[51] Fix | Delete
/**
[52] Fix | Delete
* KSES global for default allowable HTML tags.
[53] Fix | Delete
*
[54] Fix | Delete
* Can be overridden with the `CUSTOM_TAGS` constant.
[55] Fix | Delete
*
[56] Fix | Delete
* @var array[] $allowedposttags Array of default allowable HTML tags.
[57] Fix | Delete
* @since 2.0.0
[58] Fix | Delete
*/
[59] Fix | Delete
$allowedposttags = array(
[60] Fix | Delete
'address' => array(),
[61] Fix | Delete
'a' => array(
[62] Fix | Delete
'href' => true,
[63] Fix | Delete
'rel' => true,
[64] Fix | Delete
'rev' => true,
[65] Fix | Delete
'name' => true,
[66] Fix | Delete
'target' => true,
[67] Fix | Delete
'download' => array(
[68] Fix | Delete
'valueless' => 'y',
[69] Fix | Delete
),
[70] Fix | Delete
),
[71] Fix | Delete
'abbr' => array(),
[72] Fix | Delete
'acronym' => array(),
[73] Fix | Delete
'area' => array(
[74] Fix | Delete
'alt' => true,
[75] Fix | Delete
'coords' => true,
[76] Fix | Delete
'href' => true,
[77] Fix | Delete
'nohref' => true,
[78] Fix | Delete
'shape' => true,
[79] Fix | Delete
'target' => true,
[80] Fix | Delete
),
[81] Fix | Delete
'article' => array(
[82] Fix | Delete
'align' => true,
[83] Fix | Delete
'dir' => true,
[84] Fix | Delete
'lang' => true,
[85] Fix | Delete
'xml:lang' => true,
[86] Fix | Delete
),
[87] Fix | Delete
'aside' => array(
[88] Fix | Delete
'align' => true,
[89] Fix | Delete
'dir' => true,
[90] Fix | Delete
'lang' => true,
[91] Fix | Delete
'xml:lang' => true,
[92] Fix | Delete
),
[93] Fix | Delete
'audio' => array(
[94] Fix | Delete
'autoplay' => true,
[95] Fix | Delete
'controls' => true,
[96] Fix | Delete
'loop' => true,
[97] Fix | Delete
'muted' => true,
[98] Fix | Delete
'preload' => true,
[99] Fix | Delete
'src' => true,
[100] Fix | Delete
),
[101] Fix | Delete
'b' => array(),
[102] Fix | Delete
'bdo' => array(
[103] Fix | Delete
'dir' => true,
[104] Fix | Delete
),
[105] Fix | Delete
'big' => array(),
[106] Fix | Delete
'blockquote' => array(
[107] Fix | Delete
'cite' => true,
[108] Fix | Delete
'lang' => true,
[109] Fix | Delete
'xml:lang' => true,
[110] Fix | Delete
),
[111] Fix | Delete
'br' => array(),
[112] Fix | Delete
'button' => array(
[113] Fix | Delete
'disabled' => true,
[114] Fix | Delete
'name' => true,
[115] Fix | Delete
'type' => true,
[116] Fix | Delete
'value' => true,
[117] Fix | Delete
),
[118] Fix | Delete
'caption' => array(
[119] Fix | Delete
'align' => true,
[120] Fix | Delete
),
[121] Fix | Delete
'cite' => array(
[122] Fix | Delete
'dir' => true,
[123] Fix | Delete
'lang' => true,
[124] Fix | Delete
),
[125] Fix | Delete
'code' => array(),
[126] Fix | Delete
'col' => array(
[127] Fix | Delete
'align' => true,
[128] Fix | Delete
'char' => true,
[129] Fix | Delete
'charoff' => true,
[130] Fix | Delete
'span' => true,
[131] Fix | Delete
'dir' => true,
[132] Fix | Delete
'valign' => true,
[133] Fix | Delete
'width' => true,
[134] Fix | Delete
),
[135] Fix | Delete
'colgroup' => array(
[136] Fix | Delete
'align' => true,
[137] Fix | Delete
'char' => true,
[138] Fix | Delete
'charoff' => true,
[139] Fix | Delete
'span' => true,
[140] Fix | Delete
'valign' => true,
[141] Fix | Delete
'width' => true,
[142] Fix | Delete
),
[143] Fix | Delete
'del' => array(
[144] Fix | Delete
'datetime' => true,
[145] Fix | Delete
),
[146] Fix | Delete
'dd' => array(),
[147] Fix | Delete
'dfn' => array(),
[148] Fix | Delete
'details' => array(
[149] Fix | Delete
'align' => true,
[150] Fix | Delete
'dir' => true,
[151] Fix | Delete
'lang' => true,
[152] Fix | Delete
'open' => true,
[153] Fix | Delete
'xml:lang' => true,
[154] Fix | Delete
),
[155] Fix | Delete
'div' => array(
[156] Fix | Delete
'align' => true,
[157] Fix | Delete
'dir' => true,
[158] Fix | Delete
'lang' => true,
[159] Fix | Delete
'xml:lang' => true,
[160] Fix | Delete
),
[161] Fix | Delete
'dl' => array(),
[162] Fix | Delete
'dt' => array(),
[163] Fix | Delete
'em' => array(),
[164] Fix | Delete
'fieldset' => array(),
[165] Fix | Delete
'figure' => array(
[166] Fix | Delete
'align' => true,
[167] Fix | Delete
'dir' => true,
[168] Fix | Delete
'lang' => true,
[169] Fix | Delete
'xml:lang' => true,
[170] Fix | Delete
),
[171] Fix | Delete
'figcaption' => array(
[172] Fix | Delete
'align' => true,
[173] Fix | Delete
'dir' => true,
[174] Fix | Delete
'lang' => true,
[175] Fix | Delete
'xml:lang' => true,
[176] Fix | Delete
),
[177] Fix | Delete
'font' => array(
[178] Fix | Delete
'color' => true,
[179] Fix | Delete
'face' => true,
[180] Fix | Delete
'size' => true,
[181] Fix | Delete
),
[182] Fix | Delete
'footer' => array(
[183] Fix | Delete
'align' => true,
[184] Fix | Delete
'dir' => true,
[185] Fix | Delete
'lang' => true,
[186] Fix | Delete
'xml:lang' => true,
[187] Fix | Delete
),
[188] Fix | Delete
'h1' => array(
[189] Fix | Delete
'align' => true,
[190] Fix | Delete
),
[191] Fix | Delete
'h2' => array(
[192] Fix | Delete
'align' => true,
[193] Fix | Delete
),
[194] Fix | Delete
'h3' => array(
[195] Fix | Delete
'align' => true,
[196] Fix | Delete
),
[197] Fix | Delete
'h4' => array(
[198] Fix | Delete
'align' => true,
[199] Fix | Delete
),
[200] Fix | Delete
'h5' => array(
[201] Fix | Delete
'align' => true,
[202] Fix | Delete
),
[203] Fix | Delete
'h6' => array(
[204] Fix | Delete
'align' => true,
[205] Fix | Delete
),
[206] Fix | Delete
'header' => array(
[207] Fix | Delete
'align' => true,
[208] Fix | Delete
'dir' => true,
[209] Fix | Delete
'lang' => true,
[210] Fix | Delete
'xml:lang' => true,
[211] Fix | Delete
),
[212] Fix | Delete
'hgroup' => array(
[213] Fix | Delete
'align' => true,
[214] Fix | Delete
'dir' => true,
[215] Fix | Delete
'lang' => true,
[216] Fix | Delete
'xml:lang' => true,
[217] Fix | Delete
),
[218] Fix | Delete
'hr' => array(
[219] Fix | Delete
'align' => true,
[220] Fix | Delete
'noshade' => true,
[221] Fix | Delete
'size' => true,
[222] Fix | Delete
'width' => true,
[223] Fix | Delete
),
[224] Fix | Delete
'i' => array(),
[225] Fix | Delete
'img' => array(
[226] Fix | Delete
'alt' => true,
[227] Fix | Delete
'align' => true,
[228] Fix | Delete
'border' => true,
[229] Fix | Delete
'height' => true,
[230] Fix | Delete
'hspace' => true,
[231] Fix | Delete
'loading' => true,
[232] Fix | Delete
'longdesc' => true,
[233] Fix | Delete
'vspace' => true,
[234] Fix | Delete
'src' => true,
[235] Fix | Delete
'usemap' => true,
[236] Fix | Delete
'width' => true,
[237] Fix | Delete
),
[238] Fix | Delete
'ins' => array(
[239] Fix | Delete
'datetime' => true,
[240] Fix | Delete
'cite' => true,
[241] Fix | Delete
),
[242] Fix | Delete
'kbd' => array(),
[243] Fix | Delete
'label' => array(
[244] Fix | Delete
'for' => true,
[245] Fix | Delete
),
[246] Fix | Delete
'legend' => array(
[247] Fix | Delete
'align' => true,
[248] Fix | Delete
),
[249] Fix | Delete
'li' => array(
[250] Fix | Delete
'align' => true,
[251] Fix | Delete
'value' => true,
[252] Fix | Delete
),
[253] Fix | Delete
'map' => array(
[254] Fix | Delete
'name' => true,
[255] Fix | Delete
),
[256] Fix | Delete
'mark' => array(),
[257] Fix | Delete
'menu' => array(
[258] Fix | Delete
'type' => true,
[259] Fix | Delete
),
[260] Fix | Delete
'nav' => array(
[261] Fix | Delete
'align' => true,
[262] Fix | Delete
'dir' => true,
[263] Fix | Delete
'lang' => true,
[264] Fix | Delete
'xml:lang' => true,
[265] Fix | Delete
),
[266] Fix | Delete
'p' => array(
[267] Fix | Delete
'align' => true,
[268] Fix | Delete
'dir' => true,
[269] Fix | Delete
'lang' => true,
[270] Fix | Delete
'xml:lang' => true,
[271] Fix | Delete
),
[272] Fix | Delete
'pre' => array(
[273] Fix | Delete
'width' => true,
[274] Fix | Delete
),
[275] Fix | Delete
'q' => array(
[276] Fix | Delete
'cite' => true,
[277] Fix | Delete
),
[278] Fix | Delete
's' => array(),
[279] Fix | Delete
'samp' => array(),
[280] Fix | Delete
'span' => array(
[281] Fix | Delete
'dir' => true,
[282] Fix | Delete
'align' => true,
[283] Fix | Delete
'lang' => true,
[284] Fix | Delete
'xml:lang' => true,
[285] Fix | Delete
),
[286] Fix | Delete
'section' => array(
[287] Fix | Delete
'align' => true,
[288] Fix | Delete
'dir' => true,
[289] Fix | Delete
'lang' => true,
[290] Fix | Delete
'xml:lang' => true,
[291] Fix | Delete
),
[292] Fix | Delete
'small' => array(),
[293] Fix | Delete
'strike' => array(),
[294] Fix | Delete
'strong' => array(),
[295] Fix | Delete
'sub' => array(),
[296] Fix | Delete
'summary' => array(
[297] Fix | Delete
'align' => true,
[298] Fix | Delete
'dir' => true,
[299] Fix | Delete
'lang' => true,
[300] Fix | Delete
'xml:lang' => true,
[301] Fix | Delete
),
[302] Fix | Delete
'sup' => array(),
[303] Fix | Delete
'table' => array(
[304] Fix | Delete
'align' => true,
[305] Fix | Delete
'bgcolor' => true,
[306] Fix | Delete
'border' => true,
[307] Fix | Delete
'cellpadding' => true,
[308] Fix | Delete
'cellspacing' => true,
[309] Fix | Delete
'dir' => true,
[310] Fix | Delete
'rules' => true,
[311] Fix | Delete
'summary' => true,
[312] Fix | Delete
'width' => true,
[313] Fix | Delete
),
[314] Fix | Delete
'tbody' => array(
[315] Fix | Delete
'align' => true,
[316] Fix | Delete
'char' => true,
[317] Fix | Delete
'charoff' => true,
[318] Fix | Delete
'valign' => true,
[319] Fix | Delete
),
[320] Fix | Delete
'td' => array(
[321] Fix | Delete
'abbr' => true,
[322] Fix | Delete
'align' => true,
[323] Fix | Delete
'axis' => true,
[324] Fix | Delete
'bgcolor' => true,
[325] Fix | Delete
'char' => true,
[326] Fix | Delete
'charoff' => true,
[327] Fix | Delete
'colspan' => true,
[328] Fix | Delete
'dir' => true,
[329] Fix | Delete
'headers' => true,
[330] Fix | Delete
'height' => true,
[331] Fix | Delete
'nowrap' => true,
[332] Fix | Delete
'rowspan' => true,
[333] Fix | Delete
'scope' => true,
[334] Fix | Delete
'valign' => true,
[335] Fix | Delete
'width' => true,
[336] Fix | Delete
),
[337] Fix | Delete
'textarea' => array(
[338] Fix | Delete
'cols' => true,
[339] Fix | Delete
'rows' => true,
[340] Fix | Delete
'disabled' => true,
[341] Fix | Delete
'name' => true,
[342] Fix | Delete
'readonly' => true,
[343] Fix | Delete
),
[344] Fix | Delete
'tfoot' => array(
[345] Fix | Delete
'align' => true,
[346] Fix | Delete
'char' => true,
[347] Fix | Delete
'charoff' => true,
[348] Fix | Delete
'valign' => true,
[349] Fix | Delete
),
[350] Fix | Delete
'th' => array(
[351] Fix | Delete
'abbr' => true,
[352] Fix | Delete
'align' => true,
[353] Fix | Delete
'axis' => true,
[354] Fix | Delete
'bgcolor' => true,
[355] Fix | Delete
'char' => true,
[356] Fix | Delete
'charoff' => true,
[357] Fix | Delete
'colspan' => true,
[358] Fix | Delete
'headers' => true,
[359] Fix | Delete
'height' => true,
[360] Fix | Delete
'nowrap' => true,
[361] Fix | Delete
'rowspan' => true,
[362] Fix | Delete
'scope' => true,
[363] Fix | Delete
'valign' => true,
[364] Fix | Delete
'width' => true,
[365] Fix | Delete
),
[366] Fix | Delete
'thead' => array(
[367] Fix | Delete
'align' => true,
[368] Fix | Delete
'char' => true,
[369] Fix | Delete
'charoff' => true,
[370] Fix | Delete
'valign' => true,
[371] Fix | Delete
),
[372] Fix | Delete
'title' => array(),
[373] Fix | Delete
'tr' => array(
[374] Fix | Delete
'align' => true,
[375] Fix | Delete
'bgcolor' => true,
[376] Fix | Delete
'char' => true,
[377] Fix | Delete
'charoff' => true,
[378] Fix | Delete
'valign' => true,
[379] Fix | Delete
),
[380] Fix | Delete
'track' => array(
[381] Fix | Delete
'default' => true,
[382] Fix | Delete
'kind' => true,
[383] Fix | Delete
'label' => true,
[384] Fix | Delete
'src' => true,
[385] Fix | Delete
'srclang' => true,
[386] Fix | Delete
),
[387] Fix | Delete
'tt' => array(),
[388] Fix | Delete
'u' => array(),
[389] Fix | Delete
'ul' => array(
[390] Fix | Delete
'type' => true,
[391] Fix | Delete
),
[392] Fix | Delete
'ol' => array(
[393] Fix | Delete
'start' => true,
[394] Fix | Delete
'type' => true,
[395] Fix | Delete
'reversed' => true,
[396] Fix | Delete
),
[397] Fix | Delete
'var' => array(),
[398] Fix | Delete
'video' => array(
[399] Fix | Delete
'autoplay' => true,
[400] Fix | Delete
'controls' => true,
[401] Fix | Delete
'height' => true,
[402] Fix | Delete
'loop' => true,
[403] Fix | Delete
'muted' => true,
[404] Fix | Delete
'playsinline' => true,
[405] Fix | Delete
'poster' => true,
[406] Fix | Delete
'preload' => true,
[407] Fix | Delete
'src' => true,
[408] Fix | Delete
'width' => true,
[409] Fix | Delete
),
[410] Fix | Delete
);
[411] Fix | Delete
[412] Fix | Delete
/**
[413] Fix | Delete
* @var array[] $allowedtags Array of KSES allowed HTML elements.
[414] Fix | Delete
* @since 1.0.0
[415] Fix | Delete
*/
[416] Fix | Delete
$allowedtags = array(
[417] Fix | Delete
'a' => array(
[418] Fix | Delete
'href' => true,
[419] Fix | Delete
'title' => true,
[420] Fix | Delete
),
[421] Fix | Delete
'abbr' => array(
[422] Fix | Delete
'title' => true,
[423] Fix | Delete
),
[424] Fix | Delete
'acronym' => array(
[425] Fix | Delete
'title' => true,
[426] Fix | Delete
),
[427] Fix | Delete
'b' => array(),
[428] Fix | Delete
'blockquote' => array(
[429] Fix | Delete
'cite' => true,
[430] Fix | Delete
),
[431] Fix | Delete
'cite' => array(),
[432] Fix | Delete
'code' => array(),
[433] Fix | Delete
'del' => array(
[434] Fix | Delete
'datetime' => true,
[435] Fix | Delete
),
[436] Fix | Delete
'em' => array(),
[437] Fix | Delete
'i' => array(),
[438] Fix | Delete
'q' => array(
[439] Fix | Delete
'cite' => true,
[440] Fix | Delete
),
[441] Fix | Delete
's' => array(),
[442] Fix | Delete
'strike' => array(),
[443] Fix | Delete
'strong' => array(),
[444] Fix | Delete
);
[445] Fix | Delete
[446] Fix | Delete
/**
[447] Fix | Delete
* @var string[] $allowedentitynames Array of KSES allowed HTML entitity names.
[448] Fix | Delete
* @since 1.0.0
[449] Fix | Delete
*/
[450] Fix | Delete
$allowedentitynames = array(
[451] Fix | Delete
'nbsp',
[452] Fix | Delete
'iexcl',
[453] Fix | Delete
'cent',
[454] Fix | Delete
'pound',
[455] Fix | Delete
'curren',
[456] Fix | Delete
'yen',
[457] Fix | Delete
'brvbar',
[458] Fix | Delete
'sect',
[459] Fix | Delete
'uml',
[460] Fix | Delete
'copy',
[461] Fix | Delete
'ordf',
[462] Fix | Delete
'laquo',
[463] Fix | Delete
'not',
[464] Fix | Delete
'shy',
[465] Fix | Delete
'reg',
[466] Fix | Delete
'macr',
[467] Fix | Delete
'deg',
[468] Fix | Delete
'plusmn',
[469] Fix | Delete
'acute',
[470] Fix | Delete
'micro',
[471] Fix | Delete
'para',
[472] Fix | Delete
'middot',
[473] Fix | Delete
'cedil',
[474] Fix | Delete
'ordm',
[475] Fix | Delete
'raquo',
[476] Fix | Delete
'iquest',
[477] Fix | Delete
'Agrave',
[478] Fix | Delete
'Aacute',
[479] Fix | Delete
'Acirc',
[480] Fix | Delete
'Atilde',
[481] Fix | Delete
'Auml',
[482] Fix | Delete
'Aring',
[483] Fix | Delete
'AElig',
[484] Fix | Delete
'Ccedil',
[485] Fix | Delete
'Egrave',
[486] Fix | Delete
'Eacute',
[487] Fix | Delete
'Ecirc',
[488] Fix | Delete
'Euml',
[489] Fix | Delete
'Igrave',
[490] Fix | Delete
'Iacute',
[491] Fix | Delete
'Icirc',
[492] Fix | Delete
'Iuml',
[493] Fix | Delete
'ETH',
[494] Fix | Delete
'Ntilde',
[495] Fix | Delete
'Ograve',
[496] Fix | Delete
'Oacute',
[497] Fix | Delete
'Ocirc',
[498] Fix | Delete
'Otilde',
[499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function