Edit File by line
/home/barbar84/www/wp-inclu...
File: formatting.php
'´' => '´',
[4000] Fix | Delete
'µ' => 'µ',
[4001] Fix | Delete
'¶' => '¶',
[4002] Fix | Delete
'·' => '·',
[4003] Fix | Delete
'¸' => '¸',
[4004] Fix | Delete
'¹' => '¹',
[4005] Fix | Delete
'º' => 'º',
[4006] Fix | Delete
'»' => '»',
[4007] Fix | Delete
'¼' => '¼',
[4008] Fix | Delete
'½' => '½',
[4009] Fix | Delete
'¾' => '¾',
[4010] Fix | Delete
'¿' => '¿',
[4011] Fix | Delete
'À' => 'À',
[4012] Fix | Delete
'Á' => 'Á',
[4013] Fix | Delete
'Â' => 'Â',
[4014] Fix | Delete
'Ã' => 'Ã',
[4015] Fix | Delete
'Ä' => 'Ä',
[4016] Fix | Delete
'Å' => 'Å',
[4017] Fix | Delete
'Æ' => 'Æ',
[4018] Fix | Delete
'Ç' => 'Ç',
[4019] Fix | Delete
'È' => 'È',
[4020] Fix | Delete
'É' => 'É',
[4021] Fix | Delete
'Ê' => 'Ê',
[4022] Fix | Delete
'Ë' => 'Ë',
[4023] Fix | Delete
'Ì' => 'Ì',
[4024] Fix | Delete
'Í' => 'Í',
[4025] Fix | Delete
'Î' => 'Î',
[4026] Fix | Delete
'Ï' => 'Ï',
[4027] Fix | Delete
'Ð' => 'Ð',
[4028] Fix | Delete
'Ñ' => 'Ñ',
[4029] Fix | Delete
'Ò' => 'Ò',
[4030] Fix | Delete
'Ó' => 'Ó',
[4031] Fix | Delete
'Ô' => 'Ô',
[4032] Fix | Delete
'Õ' => 'Õ',
[4033] Fix | Delete
'Ö' => 'Ö',
[4034] Fix | Delete
'×' => '×',
[4035] Fix | Delete
'Ø' => 'Ø',
[4036] Fix | Delete
'Ù' => 'Ù',
[4037] Fix | Delete
'Ú' => 'Ú',
[4038] Fix | Delete
'Û' => 'Û',
[4039] Fix | Delete
'Ü' => 'Ü',
[4040] Fix | Delete
'Ý' => 'Ý',
[4041] Fix | Delete
'Þ' => 'Þ',
[4042] Fix | Delete
'ß' => 'ß',
[4043] Fix | Delete
'à' => 'à',
[4044] Fix | Delete
'á' => 'á',
[4045] Fix | Delete
'â' => 'â',
[4046] Fix | Delete
'ã' => 'ã',
[4047] Fix | Delete
'ä' => 'ä',
[4048] Fix | Delete
'å' => 'å',
[4049] Fix | Delete
'æ' => 'æ',
[4050] Fix | Delete
'ç' => 'ç',
[4051] Fix | Delete
'è' => 'è',
[4052] Fix | Delete
'é' => 'é',
[4053] Fix | Delete
'ê' => 'ê',
[4054] Fix | Delete
'ë' => 'ë',
[4055] Fix | Delete
'ì' => 'ì',
[4056] Fix | Delete
'í' => 'í',
[4057] Fix | Delete
'î' => 'î',
[4058] Fix | Delete
'ï' => 'ï',
[4059] Fix | Delete
'ð' => 'ð',
[4060] Fix | Delete
'ñ' => 'ñ',
[4061] Fix | Delete
'ò' => 'ò',
[4062] Fix | Delete
'ó' => 'ó',
[4063] Fix | Delete
'ô' => 'ô',
[4064] Fix | Delete
'õ' => 'õ',
[4065] Fix | Delete
'ö' => 'ö',
[4066] Fix | Delete
'÷' => '÷',
[4067] Fix | Delete
'ø' => 'ø',
[4068] Fix | Delete
'ù' => 'ù',
[4069] Fix | Delete
'ú' => 'ú',
[4070] Fix | Delete
'û' => 'û',
[4071] Fix | Delete
'ü' => 'ü',
[4072] Fix | Delete
'ý' => 'ý',
[4073] Fix | Delete
'þ' => 'þ',
[4074] Fix | Delete
'ÿ' => 'ÿ',
[4075] Fix | Delete
'Œ' => 'Œ',
[4076] Fix | Delete
'œ' => 'œ',
[4077] Fix | Delete
'Š' => 'Š',
[4078] Fix | Delete
'š' => 'š',
[4079] Fix | Delete
'Ÿ' => 'Ÿ',
[4080] Fix | Delete
'ƒ' => 'ƒ',
[4081] Fix | Delete
'ˆ' => 'ˆ',
[4082] Fix | Delete
'˜' => '˜',
[4083] Fix | Delete
'Α' => 'Α',
[4084] Fix | Delete
'Β' => 'Β',
[4085] Fix | Delete
'Γ' => 'Γ',
[4086] Fix | Delete
'Δ' => 'Δ',
[4087] Fix | Delete
'Ε' => 'Ε',
[4088] Fix | Delete
'Ζ' => 'Ζ',
[4089] Fix | Delete
'Η' => 'Η',
[4090] Fix | Delete
'Θ' => 'Θ',
[4091] Fix | Delete
'Ι' => 'Ι',
[4092] Fix | Delete
'Κ' => 'Κ',
[4093] Fix | Delete
'Λ' => 'Λ',
[4094] Fix | Delete
'Μ' => 'Μ',
[4095] Fix | Delete
'Ν' => 'Ν',
[4096] Fix | Delete
'Ξ' => 'Ξ',
[4097] Fix | Delete
'Ο' => 'Ο',
[4098] Fix | Delete
'Π' => 'Π',
[4099] Fix | Delete
'Ρ' => 'Ρ',
[4100] Fix | Delete
'Σ' => 'Σ',
[4101] Fix | Delete
'Τ' => 'Τ',
[4102] Fix | Delete
'Υ' => 'Υ',
[4103] Fix | Delete
'Φ' => 'Φ',
[4104] Fix | Delete
'Χ' => 'Χ',
[4105] Fix | Delete
'Ψ' => 'Ψ',
[4106] Fix | Delete
'Ω' => 'Ω',
[4107] Fix | Delete
'α' => 'α',
[4108] Fix | Delete
'β' => 'β',
[4109] Fix | Delete
'γ' => 'γ',
[4110] Fix | Delete
'δ' => 'δ',
[4111] Fix | Delete
'ε' => 'ε',
[4112] Fix | Delete
'ζ' => 'ζ',
[4113] Fix | Delete
'η' => 'η',
[4114] Fix | Delete
'θ' => 'θ',
[4115] Fix | Delete
'ι' => 'ι',
[4116] Fix | Delete
'κ' => 'κ',
[4117] Fix | Delete
'λ' => 'λ',
[4118] Fix | Delete
'μ' => 'μ',
[4119] Fix | Delete
'ν' => 'ν',
[4120] Fix | Delete
'ξ' => 'ξ',
[4121] Fix | Delete
'ο' => 'ο',
[4122] Fix | Delete
'π' => 'π',
[4123] Fix | Delete
'ρ' => 'ρ',
[4124] Fix | Delete
'ς' => 'ς',
[4125] Fix | Delete
'σ' => 'σ',
[4126] Fix | Delete
'τ' => 'τ',
[4127] Fix | Delete
'υ' => 'υ',
[4128] Fix | Delete
'φ' => 'φ',
[4129] Fix | Delete
'χ' => 'χ',
[4130] Fix | Delete
'ψ' => 'ψ',
[4131] Fix | Delete
'ω' => 'ω',
[4132] Fix | Delete
'ϑ' => 'ϑ',
[4133] Fix | Delete
'ϒ' => 'ϒ',
[4134] Fix | Delete
'ϖ' => 'ϖ',
[4135] Fix | Delete
' ' => ' ',
[4136] Fix | Delete
' ' => ' ',
[4137] Fix | Delete
' ' => ' ',
[4138] Fix | Delete
'‌' => '‌',
[4139] Fix | Delete
'‍' => '‍',
[4140] Fix | Delete
'‎' => '‎',
[4141] Fix | Delete
'‏' => '‏',
[4142] Fix | Delete
'–' => '–',
[4143] Fix | Delete
'—' => '—',
[4144] Fix | Delete
'‘' => '‘',
[4145] Fix | Delete
'’' => '’',
[4146] Fix | Delete
'‚' => '‚',
[4147] Fix | Delete
'“' => '“',
[4148] Fix | Delete
'”' => '”',
[4149] Fix | Delete
'„' => '„',
[4150] Fix | Delete
'†' => '†',
[4151] Fix | Delete
'‡' => '‡',
[4152] Fix | Delete
'•' => '•',
[4153] Fix | Delete
'…' => '…',
[4154] Fix | Delete
'‰' => '‰',
[4155] Fix | Delete
'′' => '′',
[4156] Fix | Delete
'″' => '″',
[4157] Fix | Delete
'‹' => '‹',
[4158] Fix | Delete
'›' => '›',
[4159] Fix | Delete
'‾' => '‾',
[4160] Fix | Delete
'⁄' => '⁄',
[4161] Fix | Delete
'€' => '€',
[4162] Fix | Delete
'ℑ' => 'ℑ',
[4163] Fix | Delete
'℘' => '℘',
[4164] Fix | Delete
'ℜ' => 'ℜ',
[4165] Fix | Delete
'™' => '™',
[4166] Fix | Delete
'ℵ' => 'ℵ',
[4167] Fix | Delete
'↵' => '↵',
[4168] Fix | Delete
'⇐' => '⇐',
[4169] Fix | Delete
'⇑' => '⇑',
[4170] Fix | Delete
'⇒' => '⇒',
[4171] Fix | Delete
'⇓' => '⇓',
[4172] Fix | Delete
'⇔' => '⇔',
[4173] Fix | Delete
'∀' => '∀',
[4174] Fix | Delete
'∂' => '∂',
[4175] Fix | Delete
'∃' => '∃',
[4176] Fix | Delete
'∅' => '∅',
[4177] Fix | Delete
'∇' => '∇',
[4178] Fix | Delete
'∈' => '∈',
[4179] Fix | Delete
'∉' => '∉',
[4180] Fix | Delete
'∋' => '∋',
[4181] Fix | Delete
'∏' => '∏',
[4182] Fix | Delete
'∑' => '∑',
[4183] Fix | Delete
'−' => '−',
[4184] Fix | Delete
'∗' => '∗',
[4185] Fix | Delete
'√' => '√',
[4186] Fix | Delete
'∝' => '∝',
[4187] Fix | Delete
'∞' => '∞',
[4188] Fix | Delete
'∠' => '∠',
[4189] Fix | Delete
'∧' => '∧',
[4190] Fix | Delete
'∨' => '∨',
[4191] Fix | Delete
'∩' => '∩',
[4192] Fix | Delete
'∪' => '∪',
[4193] Fix | Delete
'∫' => '∫',
[4194] Fix | Delete
'∴' => '∴',
[4195] Fix | Delete
'∼' => '∼',
[4196] Fix | Delete
'≅' => '≅',
[4197] Fix | Delete
'≈' => '≈',
[4198] Fix | Delete
'≠' => '≠',
[4199] Fix | Delete
'≡' => '≡',
[4200] Fix | Delete
'≤' => '≤',
[4201] Fix | Delete
'≥' => '≥',
[4202] Fix | Delete
'⊂' => '⊂',
[4203] Fix | Delete
'⊃' => '⊃',
[4204] Fix | Delete
'⊄' => '⊄',
[4205] Fix | Delete
'⊆' => '⊆',
[4206] Fix | Delete
'⊇' => '⊇',
[4207] Fix | Delete
'⊕' => '⊕',
[4208] Fix | Delete
'⊗' => '⊗',
[4209] Fix | Delete
'⊥' => '⊥',
[4210] Fix | Delete
'⋅' => '⋅',
[4211] Fix | Delete
'⌈' => '⌈',
[4212] Fix | Delete
'⌉' => '⌉',
[4213] Fix | Delete
'⌊' => '⌊',
[4214] Fix | Delete
'⌋' => '⌋',
[4215] Fix | Delete
'⟨' => '〈',
[4216] Fix | Delete
'⟩' => '〉',
[4217] Fix | Delete
'←' => '←',
[4218] Fix | Delete
'↑' => '↑',
[4219] Fix | Delete
'→' => '→',
[4220] Fix | Delete
'↓' => '↓',
[4221] Fix | Delete
'↔' => '↔',
[4222] Fix | Delete
'◊' => '◊',
[4223] Fix | Delete
'♠' => '♠',
[4224] Fix | Delete
'♣' => '♣',
[4225] Fix | Delete
'♥' => '♥',
[4226] Fix | Delete
'♦' => '♦',
[4227] Fix | Delete
);
[4228] Fix | Delete
[4229] Fix | Delete
return str_replace( array_keys( $to_ncr ), array_values( $to_ncr ), $text );
[4230] Fix | Delete
}
[4231] Fix | Delete
[4232] Fix | Delete
/**
[4233] Fix | Delete
* Formats text for the editor.
[4234] Fix | Delete
*
[4235] Fix | Delete
* Generally the browsers treat everything inside a textarea as text, but
[4236] Fix | Delete
* it is still a good idea to HTML entity encode `<`, `>` and `&` in the content.
[4237] Fix | Delete
*
[4238] Fix | Delete
* The filter {@see 'format_for_editor'} is applied here. If `$text` is empty the
[4239] Fix | Delete
* filter will be applied to an empty string.
[4240] Fix | Delete
*
[4241] Fix | Delete
* @since 4.3.0
[4242] Fix | Delete
*
[4243] Fix | Delete
* @see _WP_Editors::editor()
[4244] Fix | Delete
*
[4245] Fix | Delete
* @param string $text The text to be formatted.
[4246] Fix | Delete
* @param string $default_editor The default editor for the current user.
[4247] Fix | Delete
* It is usually either 'html' or 'tinymce'.
[4248] Fix | Delete
* @return string The formatted text after filter is applied.
[4249] Fix | Delete
*/
[4250] Fix | Delete
function format_for_editor( $text, $default_editor = null ) {
[4251] Fix | Delete
if ( $text ) {
[4252] Fix | Delete
$text = htmlspecialchars( $text, ENT_NOQUOTES, get_option( 'blog_charset' ) );
[4253] Fix | Delete
}
[4254] Fix | Delete
[4255] Fix | Delete
/**
[4256] Fix | Delete
* Filters the text after it is formatted for the editor.
[4257] Fix | Delete
*
[4258] Fix | Delete
* @since 4.3.0
[4259] Fix | Delete
*
[4260] Fix | Delete
* @param string $text The formatted text.
[4261] Fix | Delete
* @param string $default_editor The default editor for the current user.
[4262] Fix | Delete
* It is usually either 'html' or 'tinymce'.
[4263] Fix | Delete
*/
[4264] Fix | Delete
return apply_filters( 'format_for_editor', $text, $default_editor );
[4265] Fix | Delete
}
[4266] Fix | Delete
[4267] Fix | Delete
/**
[4268] Fix | Delete
* Perform a deep string replace operation to ensure the values in $search are no longer present
[4269] Fix | Delete
*
[4270] Fix | Delete
* Repeats the replacement operation until it no longer replaces anything so as to remove "nested" values
[4271] Fix | Delete
* e.g. $subject = '%0%0%0DDD', $search ='%0D', $result ='' rather than the '%0%0DD' that
[4272] Fix | Delete
* str_replace would return
[4273] Fix | Delete
*
[4274] Fix | Delete
* @since 2.8.1
[4275] Fix | Delete
* @access private
[4276] Fix | Delete
*
[4277] Fix | Delete
* @param string|array $search The value being searched for, otherwise known as the needle.
[4278] Fix | Delete
* An array may be used to designate multiple needles.
[4279] Fix | Delete
* @param string $subject The string being searched and replaced on, otherwise known as the haystack.
[4280] Fix | Delete
* @return string The string with the replaced values.
[4281] Fix | Delete
*/
[4282] Fix | Delete
function _deep_replace( $search, $subject ) {
[4283] Fix | Delete
$subject = (string) $subject;
[4284] Fix | Delete
[4285] Fix | Delete
$count = 1;
[4286] Fix | Delete
while ( $count ) {
[4287] Fix | Delete
$subject = str_replace( $search, '', $subject, $count );
[4288] Fix | Delete
}
[4289] Fix | Delete
[4290] Fix | Delete
return $subject;
[4291] Fix | Delete
}
[4292] Fix | Delete
[4293] Fix | Delete
/**
[4294] Fix | Delete
* Escapes data for use in a MySQL query.
[4295] Fix | Delete
*
[4296] Fix | Delete
* Usually you should prepare queries using wpdb::prepare().
[4297] Fix | Delete
* Sometimes, spot-escaping is required or useful. One example
[4298] Fix | Delete
* is preparing an array for use in an IN clause.
[4299] Fix | Delete
*
[4300] Fix | Delete
* NOTE: Since 4.8.3, '%' characters will be replaced with a placeholder string,
[4301] Fix | Delete
* this prevents certain SQLi attacks from taking place. This change in behaviour
[4302] Fix | Delete
* may cause issues for code that expects the return value of esc_sql() to be useable
[4303] Fix | Delete
* for other purposes.
[4304] Fix | Delete
*
[4305] Fix | Delete
* @since 2.8.0
[4306] Fix | Delete
*
[4307] Fix | Delete
* @global wpdb $wpdb WordPress database abstraction object.
[4308] Fix | Delete
*
[4309] Fix | Delete
* @param string|array $data Unescaped data
[4310] Fix | Delete
* @return string|array Escaped data
[4311] Fix | Delete
*/
[4312] Fix | Delete
function esc_sql( $data ) {
[4313] Fix | Delete
global $wpdb;
[4314] Fix | Delete
return $wpdb->_escape( $data );
[4315] Fix | Delete
}
[4316] Fix | Delete
[4317] Fix | Delete
/**
[4318] Fix | Delete
* Checks and cleans a URL.
[4319] Fix | Delete
*
[4320] Fix | Delete
* A number of characters are removed from the URL. If the URL is for displaying
[4321] Fix | Delete
* (the default behaviour) ampersands are also replaced. The {@see 'clean_url'} filter
[4322] Fix | Delete
* is applied to the returned cleaned URL.
[4323] Fix | Delete
*
[4324] Fix | Delete
* @since 2.8.0
[4325] Fix | Delete
*
[4326] Fix | Delete
* @param string $url The URL to be cleaned.
[4327] Fix | Delete
* @param string[] $protocols Optional. An array of acceptable protocols.
[4328] Fix | Delete
* Defaults to return value of wp_allowed_protocols().
[4329] Fix | Delete
* @param string $_context Private. Use esc_url_raw() for database usage.
[4330] Fix | Delete
* @return string The cleaned URL after the {@see 'clean_url'} filter is applied.
[4331] Fix | Delete
* An empty string is returned if `$url` specifies a protocol other than
[4332] Fix | Delete
* those in `$protocols`, or if `$url` contains an empty string.
[4333] Fix | Delete
*/
[4334] Fix | Delete
function esc_url( $url, $protocols = null, $_context = 'display' ) {
[4335] Fix | Delete
$original_url = $url;
[4336] Fix | Delete
[4337] Fix | Delete
if ( '' === $url ) {
[4338] Fix | Delete
return $url;
[4339] Fix | Delete
}
[4340] Fix | Delete
[4341] Fix | Delete
$url = str_replace( ' ', '%20', ltrim( $url ) );
[4342] Fix | Delete
$url = preg_replace( '|[^a-z0-9-~+_.?#=!&;,/:%@$\|*\'()\[\]\\x80-\\xff]|i', '', $url );
[4343] Fix | Delete
[4344] Fix | Delete
if ( '' === $url ) {
[4345] Fix | Delete
return $url;
[4346] Fix | Delete
}
[4347] Fix | Delete
[4348] Fix | Delete
if ( 0 !== stripos( $url, 'mailto:' ) ) {
[4349] Fix | Delete
$strip = array( '%0d', '%0a', '%0D', '%0A' );
[4350] Fix | Delete
$url = _deep_replace( $strip, $url );
[4351] Fix | Delete
}
[4352] Fix | Delete
[4353] Fix | Delete
$url = str_replace( ';//', '://', $url );
[4354] Fix | Delete
/*
[4355] Fix | Delete
* If the URL doesn't appear to contain a scheme, we presume
[4356] Fix | Delete
* it needs http:// prepended (unless it's a relative link
[4357] Fix | Delete
* starting with /, # or ?, or a PHP file).
[4358] Fix | Delete
*/
[4359] Fix | Delete
if ( strpos( $url, ':' ) === false && ! in_array( $url[0], array( '/', '#', '?' ), true ) &&
[4360] Fix | Delete
! preg_match( '/^[a-z0-9-]+?\.php/i', $url ) ) {
[4361] Fix | Delete
$url = 'http://' . $url;
[4362] Fix | Delete
}
[4363] Fix | Delete
[4364] Fix | Delete
// Replace ampersands and single quotes only when displaying.
[4365] Fix | Delete
if ( 'display' === $_context ) {
[4366] Fix | Delete
$url = wp_kses_normalize_entities( $url );
[4367] Fix | Delete
$url = str_replace( '&amp;', '&#038;', $url );
[4368] Fix | Delete
$url = str_replace( "'", '&#039;', $url );
[4369] Fix | Delete
}
[4370] Fix | Delete
[4371] Fix | Delete
if ( ( false !== strpos( $url, '[' ) ) || ( false !== strpos( $url, ']' ) ) ) {
[4372] Fix | Delete
[4373] Fix | Delete
$parsed = wp_parse_url( $url );
[4374] Fix | Delete
$front = '';
[4375] Fix | Delete
[4376] Fix | Delete
if ( isset( $parsed['scheme'] ) ) {
[4377] Fix | Delete
$front .= $parsed['scheme'] . '://';
[4378] Fix | Delete
} elseif ( '/' === $url[0] ) {
[4379] Fix | Delete
$front .= '//';
[4380] Fix | Delete
}
[4381] Fix | Delete
[4382] Fix | Delete
if ( isset( $parsed['user'] ) ) {
[4383] Fix | Delete
$front .= $parsed['user'];
[4384] Fix | Delete
}
[4385] Fix | Delete
[4386] Fix | Delete
if ( isset( $parsed['pass'] ) ) {
[4387] Fix | Delete
$front .= ':' . $parsed['pass'];
[4388] Fix | Delete
}
[4389] Fix | Delete
[4390] Fix | Delete
if ( isset( $parsed['user'] ) || isset( $parsed['pass'] ) ) {
[4391] Fix | Delete
$front .= '@';
[4392] Fix | Delete
}
[4393] Fix | Delete
[4394] Fix | Delete
if ( isset( $parsed['host'] ) ) {
[4395] Fix | Delete
$front .= $parsed['host'];
[4396] Fix | Delete
}
[4397] Fix | Delete
[4398] Fix | Delete
if ( isset( $parsed['port'] ) ) {
[4399] Fix | Delete
$front .= ':' . $parsed['port'];
[4400] Fix | Delete
}
[4401] Fix | Delete
[4402] Fix | Delete
$end_dirty = str_replace( $front, '', $url );
[4403] Fix | Delete
$end_clean = str_replace( array( '[', ']' ), array( '%5B', '%5D' ), $end_dirty );
[4404] Fix | Delete
$url = str_replace( $end_dirty, $end_clean, $url );
[4405] Fix | Delete
[4406] Fix | Delete
}
[4407] Fix | Delete
[4408] Fix | Delete
if ( '/' === $url[0] ) {
[4409] Fix | Delete
$good_protocol_url = $url;
[4410] Fix | Delete
} else {
[4411] Fix | Delete
if ( ! is_array( $protocols ) ) {
[4412] Fix | Delete
$protocols = wp_allowed_protocols();
[4413] Fix | Delete
}
[4414] Fix | Delete
$good_protocol_url = wp_kses_bad_protocol( $url, $protocols );
[4415] Fix | Delete
if ( strtolower( $good_protocol_url ) != strtolower( $url ) ) {
[4416] Fix | Delete
return '';
[4417] Fix | Delete
}
[4418] Fix | Delete
}
[4419] Fix | Delete
[4420] Fix | Delete
/**
[4421] Fix | Delete
* Filters a string cleaned and escaped for output as a URL.
[4422] Fix | Delete
*
[4423] Fix | Delete
* @since 2.3.0
[4424] Fix | Delete
*
[4425] Fix | Delete
* @param string $good_protocol_url The cleaned URL to be returned.
[4426] Fix | Delete
* @param string $original_url The URL prior to cleaning.
[4427] Fix | Delete
* @param string $_context If 'display', replace ampersands and single quotes only.
[4428] Fix | Delete
*/
[4429] Fix | Delete
return apply_filters( 'clean_url', $good_protocol_url, $original_url, $_context );
[4430] Fix | Delete
}
[4431] Fix | Delete
[4432] Fix | Delete
/**
[4433] Fix | Delete
* Performs esc_url() for database usage.
[4434] Fix | Delete
*
[4435] Fix | Delete
* @since 2.8.0
[4436] Fix | Delete
*
[4437] Fix | Delete
* @see esc_url()
[4438] Fix | Delete
*
[4439] Fix | Delete
* @param string $url The URL to be cleaned.
[4440] Fix | Delete
* @param string[] $protocols Optional. An array of acceptable protocols.
[4441] Fix | Delete
* Defaults to return value of wp_allowed_protocols().
[4442] Fix | Delete
* @return string The cleaned URL after esc_url() is run with the 'db' context.
[4443] Fix | Delete
*/
[4444] Fix | Delete
function esc_url_raw( $url, $protocols = null ) {
[4445] Fix | Delete
return esc_url( $url, $protocols, 'db' );
[4446] Fix | Delete
}
[4447] Fix | Delete
[4448] Fix | Delete
/**
[4449] Fix | Delete
* Convert entities, while preserving already-encoded entities.
[4450] Fix | Delete
*
[4451] Fix | Delete
* @link https://www.php.net/htmlentities Borrowed from the PHP Manual user notes.
[4452] Fix | Delete
*
[4453] Fix | Delete
* @since 1.2.2
[4454] Fix | Delete
*
[4455] Fix | Delete
* @param string $myHTML The text to be converted.
[4456] Fix | Delete
* @return string Converted text.
[4457] Fix | Delete
*/
[4458] Fix | Delete
function htmlentities2( $myHTML ) {
[4459] Fix | Delete
$translation_table = get_html_translation_table( HTML_ENTITIES, ENT_QUOTES );
[4460] Fix | Delete
$translation_table[ chr( 38 ) ] = '&';
[4461] Fix | Delete
return preg_replace( '/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,3};)/', '&amp;', strtr( $myHTML, $translation_table ) );
[4462] Fix | Delete
}
[4463] Fix | Delete
[4464] Fix | Delete
/**
[4465] Fix | Delete
* Escape single quotes, htmlspecialchar " < > &, and fix line endings.
[4466] Fix | Delete
*
[4467] Fix | Delete
* Escapes text strings for echoing in JS. It is intended to be used for inline JS
[4468] Fix | Delete
* (in a tag attribute, for example onclick="..."). Note that the strings have to
[4469] Fix | Delete
* be in single quotes. The {@see 'js_escape'} filter is also applied here.
[4470] Fix | Delete
*
[4471] Fix | Delete
* @since 2.8.0
[4472] Fix | Delete
*
[4473] Fix | Delete
* @param string $text The text to be escaped.
[4474] Fix | Delete
* @return string Escaped text.
[4475] Fix | Delete
*/
[4476] Fix | Delete
function esc_js( $text ) {
[4477] Fix | Delete
$safe_text = wp_check_invalid_utf8( $text );
[4478] Fix | Delete
$safe_text = _wp_specialchars( $safe_text, ENT_COMPAT );
[4479] Fix | Delete
$safe_text = preg_replace( '/&#(x)?0*(?(1)27|39);?/i', "'", stripslashes( $safe_text ) );
[4480] Fix | Delete
$safe_text = str_replace( "\r", '', $safe_text );
[4481] Fix | Delete
$safe_text = str_replace( "\n", '\\n', addslashes( $safe_text ) );
[4482] Fix | Delete
/**
[4483] Fix | Delete
* Filters a string cleaned and escaped for output in JavaScript.
[4484] Fix | Delete
*
[4485] Fix | Delete
* Text passed to esc_js() is stripped of invalid or special characters,
[4486] Fix | Delete
* and properly slashed for output.
[4487] Fix | Delete
*
[4488] Fix | Delete
* @since 2.0.6
[4489] Fix | Delete
*
[4490] Fix | Delete
* @param string $safe_text The text after it has been escaped.
[4491] Fix | Delete
* @param string $text The text prior to being escaped.
[4492] Fix | Delete
*/
[4493] Fix | Delete
return apply_filters( 'js_escape', $safe_text, $text );
[4494] Fix | Delete
}
[4495] Fix | Delete
[4496] Fix | Delete
/**
[4497] Fix | Delete
* Escaping for HTML blocks.
[4498] Fix | Delete
*
[4499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function