(.+?)<\/category>/','',$content);
-
- // Converts lone & characters into & (a.k.a. &)
- $content = preg_replace('/&([^#])(?![a-z1-4]{1,8};)/i', '&$1', $content);
-
- // Fix Word pasting
- $content = strtr($content, $wp_htmltranswinuni);
-
- // Just a little XHTML help
- $content = str_replace('
', '
', $content);
- $content = str_replace('
', '
', $content);
+ if ( strpos( $content, '' ) !== false ) {
+ $content = strtr( $content, $wp_htmltranswinuni );
+ }
return $content;
}
@@ -1493,8 +2169,8 @@
*
* @since 0.71
*
- * @param string $text Text to be balanced
- * @param bool $force If true, forces balancing, ignoring the value of the option. Default false.
+ * @param string $text Text to be balanced
+ * @param bool $force If true, forces balancing, ignoring the value of the option. Default false.
* @return string Balanced text
*/
function balanceTags( $text, $force = false ) {
@@ -1550,7 +2226,7 @@
if ( isset($regex[1][0]) && '/' == $regex[1][0] ) { // End Tag
$tag = strtolower(substr($regex[1],1));
// if too many closing tags
- if( $stacksize <= 0 ) {
+ if ( $stacksize <= 0 ) {
$tag = '';
// or close to be safe $tag = '/' . $tag;
}
@@ -1605,7 +2281,7 @@
// Attributes
$attributes = $regex[2];
- if( ! empty( $attributes ) && $attributes[0] != '>' )
+ if ( ! empty( $attributes ) && $attributes[0] != '>' )
$attributes = ' ' . $attributes;
$tag = '<' . $tag . $attributes . '>';
@@ -1640,25 +2316,28 @@
* Acts on text which is about to be edited.
*
* The $content is run through esc_textarea(), which uses htmlspecialchars()
- * to convert special characters to HTML entities. If $richedit is set to true,
- * it is simply a holder for the 'format_to_edit' filter.
+ * to convert special characters to HTML entities. If `$richedit` is set to true,
+ * it is simply a holder for the {@see 'format_to_edit'} filter.
*
* @since 0.71
- *
- * @param string $content The text about to be edited.
- * @param bool $richedit Whether the $content should not pass through htmlspecialchars(). Default false (meaning it will be passed).
+ * @since 4.4.0 The `$richedit` parameter was renamed to `$rich_text` for clarity.
+ *
+ * @param string $content The text about to be edited.
+ * @param bool $rich_text Optional. Whether `$content` should be considered rich text,
+ * in which case it would not be passed through esc_textarea().
+ * Default false.
* @return string The text after the filter (and possibly htmlspecialchars()) has been run.
*/
-function format_to_edit( $content, $richedit = false ) {
+function format_to_edit( $content, $rich_text = false ) {
/**
- * Filter the text to be formatted for editing.
+ * Filters the text to be formatted for editing.
*
* @since 1.2.0
*
* @param string $content The text, prior to formatting for editing.
*/
$content = apply_filters( 'format_to_edit', $content );
- if ( ! $richedit )
+ if ( ! $rich_text )
$content = esc_textarea( $content );
return $content;
}
@@ -1676,12 +2355,12 @@
*
* @since 0.71
*
- * @param mixed $number Number to append zeros to if not greater than threshold.
- * @param int $threshold Digit places number needs to be to not have zeros added.
+ * @param int $number Number to append zeros to if not greater than threshold.
+ * @param int $threshold Digit places number needs to be to not have zeros added.
* @return string Adds leading zeros to number if needed.
*/
-function zeroise($number, $threshold) {
- return sprintf('%0'.$threshold.'s', $number);
+function zeroise( $number, $threshold ) {
+ return sprintf( '%0' . $threshold . 's', $number );
}
/**
@@ -1692,7 +2371,7 @@
* @param string $string Value to which backslashes will be added.
* @return string String with backslashes inserted.
*/
-function backslashit($string) {
+function backslashit( $string ) {
if ( isset( $string[0] ) && $string[0] >= '0' && $string[0] <= '9' )
$string = '\\\\' . $string;
return addcslashes( $string, 'A..Za..z' );
@@ -1735,7 +2414,7 @@
* Adds slashes to escape strings.
*
* Slashes will first be removed if magic_quotes_gpc is set, see {@link
- * http://www.php.net/magic_quotes} for more details.
+ * https://secure.php.net/magic_quotes} for more details.
*
* @since 0.71
*
@@ -1750,55 +2429,63 @@
}
/**
- * Navigates through an array and removes slashes from the values.
- *
- * If an array is passed, the array_map() function causes a callback to pass the
- * value back to the function. The slashes from this value will removed.
+ * Navigates through an array, object, or scalar, and removes slashes from the values.
*
* @since 2.0.0
*
* @param mixed $value The value to be stripped.
* @return mixed Stripped value.
*/
-function stripslashes_deep($value) {
- if ( is_array($value) ) {
- $value = array_map('stripslashes_deep', $value);
- } elseif ( is_object($value) ) {
- $vars = get_object_vars( $value );
- foreach ($vars as $key=>$data) {
- $value->{$key} = stripslashes_deep( $data );
- }
- } elseif ( is_string( $value ) ) {
- $value = stripslashes($value);
- }
-
- return $value;
+function stripslashes_deep( $value ) {
+ return map_deep( $value, 'stripslashes_from_strings_only' );
+}
+
+/**
+ * Callback function for `stripslashes_deep()` which strips slashes from strings.
+ *
+ * @since 4.4.0
+ *
+ * @param mixed $value The array or string to be stripped.
+ * @return mixed $value The stripped value.
+ */
+function stripslashes_from_strings_only( $value ) {
+ return is_string( $value ) ? stripslashes( $value ) : $value;
}
/**
- * Navigates through an array and encodes the values to be used in a URL.
- *
+ * Navigates through an array, object, or scalar, and encodes the values to be used in a URL.
*
* @since 2.2.0
*
- * @param array|string $value The array or string to be encoded.
- * @return array|string $value The encoded array (or string from the callback).
+ * @param mixed $value The array or string to be encoded.
+ * @return mixed $value The encoded value.
*/
-function urlencode_deep($value) {
- $value = is_array($value) ? array_map('urlencode_deep', $value) : urlencode($value);
- return $value;
+function urlencode_deep( $value ) {
+ return map_deep( $value, 'urlencode' );
}
/**
- * Navigates through an array and raw encodes the values to be used in a URL.
+ * Navigates through an array, object, or scalar, and raw-encodes the values to be used in a URL.
*
* @since 3.4.0
*
- * @param array|string $value The array or string to be encoded.
- * @return array|string $value The encoded array (or string from the callback).
+ * @param mixed $value The array or string to be encoded.
+ * @return mixed $value The encoded value.
*/
function rawurlencode_deep( $value ) {
- return is_array( $value ) ? array_map( 'rawurlencode_deep', $value ) : rawurlencode( $value );
+ return map_deep( $value, 'rawurlencode' );
+}
+
+/**
+ * Navigates through an array, object, or scalar, and decodes URL-encoded values
+ *
+ * @since 4.4.0
+ *
+ * @param mixed $value The array or string to be decoded.
+ * @return mixed $value The decoded value.
+ */
+function urldecode_deep( $value ) {
+ return map_deep( $value, 'urldecode' );
}
/**
@@ -1807,7 +2494,7 @@
* @since 0.71
*
* @param string $email_address Email address.
- * @param int $hex_encoding Optional. Set to 1 to enable hex encoding.
+ * @param int $hex_encoding Optional. Set to 1 to enable hex encoding.
* @return string Converted email address.
*/
function antispambot( $email_address, $hex_encoding = 0 ) {
@@ -1823,16 +2510,13 @@
}
}
- $email_no_spam_address = str_replace( '@', '@', $email_no_spam_address );
-
- return $email_no_spam_address;
+ return str_replace( '@', '@', $email_no_spam_address );
}
/**
* Callback to convert URI match to HTML A element.
*
- * This function was backported from 2.5.0 to 2.3.2. Regex callback for {@link
- * make_clickable()}.
+ * This function was backported from 2.5.0 to 2.3.2. Regex callback for make_clickable().
*
* @since 2.3.2
* @access private
@@ -1840,7 +2524,7 @@
* @param array $matches Single Regex Match.
* @return string HTML A element with URI address.
*/
-function _make_url_clickable_cb($matches) {
+function _make_url_clickable_cb( $matches ) {
$url = $matches[2];
if ( ')' == $matches[3] && strpos( $url, '(' ) ) {
@@ -1868,8 +2552,7 @@
/**
* Callback to convert URL match to HTML A element.
*
- * This function was backported from 2.5.0 to 2.3.2. Regex callback for {@link
- * make_clickable()}.
+ * This function was backported from 2.5.0 to 2.3.2. Regex callback for make_clickable().
*
* @since 2.3.2
* @access private
@@ -1877,27 +2560,28 @@
* @param array $matches Single Regex Match.
* @return string HTML A element with URL address.
*/
-function _make_web_ftp_clickable_cb($matches) {
+function _make_web_ftp_clickable_cb( $matches ) {
$ret = '';
$dest = $matches[2];
$dest = 'http://' . $dest;
- $dest = esc_url($dest);
- if ( empty($dest) )
- return $matches[0];
// removed trailing [.,;:)] from URL
if ( in_array( substr($dest, -1), array('.', ',', ';', ':', ')') ) === true ) {
$ret = substr($dest, -1);
$dest = substr($dest, 0, strlen($dest)-1);
}
+
+ $dest = esc_url($dest);
+ if ( empty($dest) )
+ return $matches[0];
+
return $matches[1] . "$dest$ret";
}
/**
* Callback to convert email address match to HTML A element.
*
- * This function was backported from 2.5.0 to 2.3.2. Regex callback for {@link
- * make_clickable()}.
+ * This function was backported from 2.5.0 to 2.3.2. Regex callback for make_clickable().
*
* @since 2.3.2
* @access private
@@ -1905,7 +2589,7 @@
* @param array $matches Single Regex Match.
* @return string HTML A element with email address.
*/
-function _make_email_clickable_cb($matches) {
+function _make_email_clickable_cb( $matches ) {
$email = $matches[2] . '@' . $matches[3];
return $matches[1] . "$email";
}
@@ -1927,9 +2611,9 @@
$nested_code_pre = 0; // Keep track of how many levels link is nested inside or
foreach ( $textarr as $piece ) {
- if ( preg_match( '|^]|i', $piece ) || preg_match( '|^]|i', $piece ) )
+ if ( preg_match( '|^]|i', $piece ) || preg_match( '|^]|i', $piece ) || preg_match( '|^' === strtolower( $piece ) || '' === strtolower( $piece ) ) )
$nested_code_pre--;
if ( $nested_code_pre || empty( $piece ) || ( $piece[0] === '<' && ! preg_match( '|^<\s*[\w]{1,20}+://|', $piece ) ) ) {
@@ -1976,8 +2660,7 @@
}
// Cleanup of accidental links within links
- $r = preg_replace( '#(]+?>|>))]+?>([^>]+?)#i', "$1$3", $r );
- return $r;
+ return preg_replace( '#(]+?>|>))]+?>([^>]+?)#i', "$1$3", $r );
}
/**
@@ -2006,7 +2689,7 @@
* @access private
*
* @param string $string The string to split.
- * @param int $goal The desired chunk length.
+ * @param int $goal The desired chunk length.
* @return array Numeric array of chunks.
*/
function _split_str_by_whitespace( $string, $goal ) {
@@ -2048,8 +2731,7 @@
// This is a pre save filter, so text is already escaped.
$text = stripslashes($text);
$text = preg_replace_callback('||i', 'wp_rel_nofollow_callback', $text);
- $text = wp_slash($text);
- return $text;
+ return wp_slash( $text );
}
/**
@@ -2065,19 +2747,43 @@
*/
function wp_rel_nofollow_callback( $matches ) {
$text = $matches[1];
- $text = str_replace(array(' rel="nofollow"', " rel='nofollow'"), '', $text);
- return "";
+ $atts = shortcode_parse_atts( $matches[1] );
+ $rel = 'nofollow';
+
+ if ( preg_match( '%href=["\'](' . preg_quote( set_url_scheme( home_url(), 'http' ) ) . ')%i', $text ) ||
+ preg_match( '%href=["\'](' . preg_quote( set_url_scheme( home_url(), 'https' ) ) . ')%i', $text )
+ ) {
+ return "";
+ }
+
+ if ( ! empty( $atts['rel'] ) ) {
+ $parts = array_map( 'trim', explode( ' ', $atts['rel'] ) );
+ if ( false === array_search( 'nofollow', $parts ) ) {
+ $parts[] = 'nofollow';
+ }
+ $rel = implode( ' ', $parts );
+ unset( $atts['rel'] );
+
+ $html = '';
+ foreach ( $atts as $name => $value ) {
+ $html .= "{$name}=\"$value\" ";
+ }
+ $text = trim( $html );
+ }
+ return "";
}
/**
* Convert one smiley code to the icon graphic file equivalent.
*
- * Callback handler for {@link convert_smilies()}.
+ * Callback handler for convert_smilies().
+ *
* Looks up one smiley code in the $wpsmiliestrans global array and returns an
* `
` string for that smiley.
*
+ * @since 2.8.0
+ *
* @global array $wpsmiliestrans
- * @since 2.8.0
*
* @param array $matches Single match. Smiley code to convert to image.
* @return string Image string for smiley.
@@ -2101,7 +2807,7 @@
}
/**
- * Filter the Smiley image URL before it's used in the image element.
+ * Filters the Smiley image URL before it's used in the image element.
*
* @since 2.9.0
*
@@ -2121,7 +2827,8 @@
* used in the function isn't empty.
*
* @since 0.71
- * @uses $wp_smiliessearch
+ *
+ * @global string|array $wp_smiliessearch
*
* @param string $text Content to convert smilies from text.
* @return string Converted content with text smilies replaced with images.
@@ -2172,18 +2879,18 @@
*
* @since 0.71
*
- * @param string $email Email address to verify.
- * @param boolean $deprecated Deprecated.
+ * @param string $email Email address to verify.
+ * @param bool $deprecated Deprecated.
* @return string|bool Either false or the valid email address.
*/
function is_email( $email, $deprecated = false ) {
if ( ! empty( $deprecated ) )
- _deprecated_argument( __FUNCTION__, '3.0' );
+ _deprecated_argument( __FUNCTION__, '3.0.0' );
// Test for the minimum length the email can be
- if ( strlen( $email ) < 3 ) {
+ if ( strlen( $email ) < 6 ) {
/**
- * Filter whether an email address is valid.
+ * Filters whether an email address is valid.
*
* This filter is evaluated under several different contexts, such as 'email_too_short',
* 'email_no_at', 'local_invalid_chars', 'domain_period_sequence', 'domain_period_limits',
@@ -2193,7 +2900,6 @@
*
* @param bool $is_email Whether the email address has passed the is_email() checks. Default false.
* @param string $email The email address being checked.
- * @param string $message An explanatory message to the user.
* @param string $context Context under which the email was tested.
*/
return apply_filters( 'is_email', false, $email, 'email_too_short' );
@@ -2265,14 +2971,13 @@
* @param string $string Subject line
* @return string Converted string to ASCII
*/
-function wp_iso_descrambler($string) {
+function wp_iso_descrambler( $string ) {
/* this may only work with iso-8859-1, I'm afraid */
if (!preg_match('#\=\?(.+)\?Q\?(.+)\?\=#i', $string, $matches)) {
return $string;
} else {
$subject = str_replace('_', ' ', $matches[2]);
- $subject = preg_replace_callback('#\=([0-9a-f]{2})#i', '_wp_iso_convert', $subject);
- return $subject;
+ return preg_replace_callback( '#\=([0-9a-f]{2})#i', '_wp_iso_convert', $subject );
}
}
@@ -2307,13 +3012,19 @@
$tz = get_option( 'timezone_string' );
if ( $tz ) {
$datetime = date_create( $string, new DateTimeZone( $tz ) );
- if ( ! $datetime )
+ if ( ! $datetime ) {
return gmdate( $format, 0 );
+ }
$datetime->setTimezone( new DateTimeZone( 'UTC' ) );
$string_gmt = $datetime->format( $format );
} else {
- if ( ! preg_match( '#([0-9]{1,4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})#', $string, $matches ) )
- return gmdate( $format, 0 );
+ if ( ! preg_match( '#([0-9]{1,4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})#', $string, $matches ) ) {
+ $datetime = strtotime( $string );
+ if ( false === $datetime ) {
+ return gmdate( $format, 0 );
+ }
+ return gmdate( $format, $datetime );
+ }
$string_time = gmmktime( $matches[4], $matches[5], $matches[6], $matches[2], $matches[3], $matches[1] );
$string_gmt = gmdate( $format, $string_time - get_option( 'gmt_offset' ) * HOUR_IN_SECONDS );
}
@@ -2359,7 +3070,7 @@
* @param string $timezone Either 'Z' for 0 offset or '±hhmm'.
* @return int|float The offset in seconds.
*/
-function iso8601_timezone_to_offset($timezone) {
+function iso8601_timezone_to_offset( $timezone ) {
// $timezone is either 'Z' or '[+|-]hhmm'
if ($timezone == 'Z') {
$offset = 0;
@@ -2377,11 +3088,11 @@
*
* @since 1.5.0
*
- * @param string $date_string Date and time in ISO 8601 format {@link http://en.wikipedia.org/wiki/ISO_8601}.
- * @param string $timezone Optional. If set to GMT returns the time minus gmt_offset. Default is 'user'.
+ * @param string $date_string Date and time in ISO 8601 format {@link https://en.wikipedia.org/wiki/ISO_8601}.
+ * @param string $timezone Optional. If set to GMT returns the time minus gmt_offset. Default is 'user'.
* @return string The date and time in MySQL DateTime format - Y-m-d H:i:s.
*/
-function iso8601_to_datetime($date_string, $timezone = 'user') {
+function iso8601_to_datetime( $date_string, $timezone = 'user' ) {
$timezone = strtolower($timezone);
if ($timezone == 'gmt') {
@@ -2405,23 +3116,6 @@
}
/**
- * Adds a element attributes to open links in new windows.
- *
- * Comment text in popup windows should be filtered through this. Right now it's
- * a moderately dumb function, ideally it would detect whether a target or rel
- * attribute was already there and adjust its actions accordingly.
- *
- * @since 0.71
- *
- * @param string $text Content to replace links to open in a new window.
- * @return string Content that has filtered links.
- */
-function popuplinks($text) {
- $text = preg_replace('//i', "", $text);
- return $text;
-}
-
-/**
* Strips out all characters that are not allowable in an email.
*
* @since 1.5.0
@@ -2431,9 +3125,9 @@
*/
function sanitize_email( $email ) {
// Test for the minimum length the email can be
- if ( strlen( $email ) < 3 ) {
+ if ( strlen( $email ) < 6 ) {
/**
- * Filter a sanitized email address.
+ * Filters a sanitized email address.
*
* This filter is evaluated under several contexts, including 'email_too_short',
* 'email_no_at', 'local_invalid_chars', 'domain_period_sequence', 'domain_period_limits',
@@ -2532,7 +3226,7 @@
* @since 1.5.0
*
* @param int $from Unix timestamp from which the difference begins.
- * @param int $to Optional. Unix timestamp to end the time difference. Default becomes time() if not set.
+ * @param int $to Optional. Unix timestamp to end the time difference. Default becomes time() if not set.
* @return string Human readable time difference.
*/
function human_time_diff( $from, $to = '' ) {
@@ -2546,37 +3240,42 @@
$mins = round( $diff / MINUTE_IN_SECONDS );
if ( $mins <= 1 )
$mins = 1;
- /* translators: min=minute */
+ /* translators: Time difference between two dates, in minutes (min=minute). 1: Number of minutes */
$since = sprintf( _n( '%s min', '%s mins', $mins ), $mins );
} elseif ( $diff < DAY_IN_SECONDS && $diff >= HOUR_IN_SECONDS ) {
$hours = round( $diff / HOUR_IN_SECONDS );
if ( $hours <= 1 )
$hours = 1;
+ /* translators: Time difference between two dates, in hours. 1: Number of hours */
$since = sprintf( _n( '%s hour', '%s hours', $hours ), $hours );
} elseif ( $diff < WEEK_IN_SECONDS && $diff >= DAY_IN_SECONDS ) {
$days = round( $diff / DAY_IN_SECONDS );
if ( $days <= 1 )
$days = 1;
+ /* translators: Time difference between two dates, in days. 1: Number of days */
$since = sprintf( _n( '%s day', '%s days', $days ), $days );
- } elseif ( $diff < 30 * DAY_IN_SECONDS && $diff >= WEEK_IN_SECONDS ) {
+ } elseif ( $diff < MONTH_IN_SECONDS && $diff >= WEEK_IN_SECONDS ) {
$weeks = round( $diff / WEEK_IN_SECONDS );
if ( $weeks <= 1 )
$weeks = 1;
+ /* translators: Time difference between two dates, in weeks. 1: Number of weeks */
$since = sprintf( _n( '%s week', '%s weeks', $weeks ), $weeks );
- } elseif ( $diff < YEAR_IN_SECONDS && $diff >= 30 * DAY_IN_SECONDS ) {
- $months = round( $diff / ( 30 * DAY_IN_SECONDS ) );
+ } elseif ( $diff < YEAR_IN_SECONDS && $diff >= MONTH_IN_SECONDS ) {
+ $months = round( $diff / MONTH_IN_SECONDS );
if ( $months <= 1 )
$months = 1;
+ /* translators: Time difference between two dates, in months. 1: Number of months */
$since = sprintf( _n( '%s month', '%s months', $months ), $months );
} elseif ( $diff >= YEAR_IN_SECONDS ) {
$years = round( $diff / YEAR_IN_SECONDS );
if ( $years <= 1 )
$years = 1;
+ /* translators: Time difference between two dates, in years. 1: Number of years */
$since = sprintf( _n( '%s year', '%s years', $years ), $years );
}
/**
- * Filter the human readable difference between two timestamps.
+ * Filters the human readable difference between two timestamps.
*
* @since 4.0.0
*
@@ -2595,15 +3294,15 @@
* that, then the string ' […]' will be appended to the excerpt. If the string
* is less than 55 words, then the content will be returned as is.
*
- * The 55 word limit can be modified by plugins/themes using the excerpt_length filter
- * The ' […]' string can be modified by plugins/themes using the excerpt_more filter
+ * The 55 word limit can be modified by plugins/themes using the {@see 'excerpt_length'} filter
+ * The ' […]' string can be modified by plugins/themes using the {@see 'excerpt_more'} filter
*
* @since 1.5.0
*
* @param string $text Optional. The excerpt. If set to empty, an excerpt is generated.
* @return string The excerpt.
*/
-function wp_trim_excerpt($text = '') {
+function wp_trim_excerpt( $text = '' ) {
$raw_excerpt = $text;
if ( '' == $text ) {
$text = get_the_content('');
@@ -2615,7 +3314,7 @@
$text = str_replace(']]>', ']]>', $text);
/**
- * Filter the number of words in an excerpt.
+ * Filters the number of words in an excerpt.
*
* @since 2.7.0
*
@@ -2623,7 +3322,7 @@
*/
$excerpt_length = apply_filters( 'excerpt_length', 55 );
/**
- * Filter the string in the "more" link displayed after a trimmed excerpt.
+ * Filters the string in the "more" link displayed after a trimmed excerpt.
*
* @since 2.9.0
*
@@ -2633,7 +3332,7 @@
$text = wp_trim_words( $text, $excerpt_length, $excerpt_more );
}
/**
- * Filter the trimmed excerpt string.
+ * Filters the trimmed excerpt string.
*
* @since 2.8.0
*
@@ -2652,19 +3351,25 @@
*
* @since 3.3.0
*
- * @param string $text Text to trim.
- * @param int $num_words Number of words. Default 55.
- * @param string $more Optional. What to append if $text needs to be trimmed. Default '…'.
+ * @param string $text Text to trim.
+ * @param int $num_words Number of words. Default 55.
+ * @param string $more Optional. What to append if $text needs to be trimmed. Default '…'.
* @return string Trimmed text.
*/
function wp_trim_words( $text, $num_words = 55, $more = null ) {
- if ( null === $more )
+ if ( null === $more ) {
$more = __( '…' );
+ }
+
$original_text = $text;
$text = wp_strip_all_tags( $text );
- /* translators: If your word count is based on single characters (East Asian characters),
- enter 'characters'. Otherwise, enter 'words'. Do not translate into your own language. */
- if ( 'characters' == _x( 'words', 'word count: words or characters?' ) && preg_match( '/^utf\-?8$/i', get_option( 'blog_charset' ) ) ) {
+
+ /*
+ * translators: If your word count is based on single characters (e.g. East Asian characters),
+ * enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'.
+ * Do not translate into your own language.
+ */
+ if ( strpos( _x( 'words', 'Word count type. Do not translate!' ), 'characters' ) === 0 && preg_match( '/^utf\-?8$/i', get_option( 'blog_charset' ) ) ) {
$text = trim( preg_replace( "/[\n\r\t ]+/", ' ', $text ), ' ' );
preg_match_all( '/./u', $text, $words_array );
$words_array = array_slice( $words_array[0], 0, $num_words + 1 );
@@ -2673,6 +3378,7 @@
$words_array = preg_split( "/[\n\r\t ]+/", $text, $num_words + 1, PREG_SPLIT_NO_EMPTY );
$sep = ' ';
}
+
if ( count( $words_array ) > $num_words ) {
array_pop( $words_array );
$text = implode( $sep, $words_array );
@@ -2680,13 +3386,14 @@
} else {
$text = implode( $sep, $words_array );
}
+
/**
- * Filter the text content after words have been trimmed.
+ * Filters the text content after words have been trimmed.
*
* @since 3.3.0
*
* @param string $text The trimmed text.
- * @param int $num_words The number of words to trim the text to. Default 5.
+ * @param int $num_words The number of words to trim the text to. Default 55.
* @param string $more An optional string to append to the end of the trimmed text, e.g. ….
* @param string $original_text The text before it was trimmed.
*/
@@ -2701,10 +3408,10 @@
* @param string $text The text within which entities will be converted.
* @return string Text with converted entities.
*/
-function ent2ncr($text) {
+function ent2ncr( $text ) {
/**
- * Filter text before named entities are converted into numbered entities.
+ * Filters text before named entities are converted into numbered entities.
*
* A non-null string must be returned for the filter to be evaluated.
*
@@ -2714,7 +3421,7 @@
* @param string $text The text prior to entity conversion.
*/
$filtered = apply_filters( 'pre_ent2ncr', null, $text );
- if( null !== $filtered )
+ if ( null !== $filtered )
return $filtered;
$to_ncr = array(
@@ -2980,66 +3687,38 @@
}
/**
- * Formats text for the rich text editor.
- *
- * The filter 'richedit_pre' is applied here. If $text is empty the filter will
- * be applied to an empty string.
- *
- * @since 2.0.0
- *
- * @param string $text The text to be formatted.
+ * Formats text for the editor.
+ *
+ * Generally the browsers treat everything inside a textarea as text, but
+ * it is still a good idea to HTML entity encode `<`, `>` and `&` in the content.
+ *
+ * The filter {@see 'format_for_editor'} is applied here. If `$text` is empty the
+ * filter will be applied to an empty string.
+ *
+ * @since 4.3.0
+ *
+ * @see _WP_Editors::editor()
+ *
+ * @param string $text The text to be formatted.
+ * @param string $default_editor The default editor for the current user.
+ * It is usually either 'html' or 'tinymce'.
* @return string The formatted text after filter is applied.
*/
-function wp_richedit_pre($text) {
- if ( empty( $text ) ) {
- /**
- * Filter text returned for the rich text editor.
- *
- * This filter is first evaluated, and the value returned, if an empty string
- * is passed to wp_richedit_pre(). If an empty string is passed, it results
- * in a break tag and line feed.
- *
- * If a non-empty string is passed, the filter is evaluated on the wp_richedit_pre()
- * return after being formatted.
- *
- * @since 2.0.0
- *
- * @param string $output Text for the rich text editor.
- */
- return apply_filters( 'richedit_pre', '' );
+function format_for_editor( $text, $default_editor = null ) {
+ if ( $text ) {
+ $text = htmlspecialchars( $text, ENT_NOQUOTES, get_option( 'blog_charset' ) );
}
- $output = convert_chars($text);
- $output = wpautop($output);
- $output = htmlspecialchars($output, ENT_NOQUOTES, get_option( 'blog_charset' ) );
-
- /** This filter is documented in wp-includes/formatting.php */
- return apply_filters( 'richedit_pre', $output );
-}
-
-/**
- * Formats text for the HTML editor.
- *
- * Unless $output is empty it will pass through htmlspecialchars before the
- * 'htmledit_pre' filter is applied.
- *
- * @since 2.5.0
- *
- * @param string $output The text to be formatted.
- * @return string Formatted text after filter applied.
- */
-function wp_htmledit_pre($output) {
- if ( !empty($output) )
- $output = htmlspecialchars($output, ENT_NOQUOTES, get_option( 'blog_charset' ) ); // convert only < > &
-
/**
- * Filter the text before it is formatted for the HTML editor.
+ * Filters the text after it is formatted for the editor.
*
- * @since 2.5.0
+ * @since 4.3.0
*
- * @param string $output The HTML-formatted text.
+ * @param string $text The formatted text.
+ * @param string $default_editor The default editor for the current user.
+ * It is usually either 'html' or 'tinymce'.
*/
- return apply_filters( 'htmledit_pre', $output );
+ return apply_filters( 'format_for_editor', $text, $default_editor );
}
/**
@@ -3052,8 +3731,9 @@
* @since 2.8.1
* @access private
*
- * @param string|array $search The value being searched for, otherwise known as the needle. An array may be used to designate multiple needles.
- * @param string $subject The string being searched and replaced on, otherwise known as the haystack.
+ * @param string|array $search The value being searched for, otherwise known as the needle.
+ * An array may be used to designate multiple needles.
+ * @param string $subject The string being searched and replaced on, otherwise known as the haystack.
* @return string The string with the replaced svalues.
*/
function _deep_replace( $search, $subject ) {
@@ -3074,7 +3754,15 @@
* Sometimes, spot-escaping is required or useful. One example
* is preparing an array for use in an IN clause.
*
+ * NOTE: Since 4.8.3, '%' characters will be replaced with a placeholder string,
+ * this prevents certain SQLi attacks from taking place. This change in behaviour
+ * may cause issues for code that expects the return value of esc_sql() to be useable
+ * for other purposes.
+ *
* @since 2.8.0
+ *
+ * @global wpdb $wpdb WordPress database abstraction object.
+ *
* @param string|array $data Unescaped data
* @return string|array Escaped data
*/
@@ -3087,28 +3775,38 @@
* Checks and cleans a URL.
*
* A number of characters are removed from the URL. If the URL is for displaying
- * (the default behaviour) ampersands are also replaced. The 'clean_url' filter
+ * (the default behaviour) ampersands are also replaced. The {@see 'clean_url'} filter
* is applied to the returned cleaned URL.
*
* @since 2.8.0
*
- * @param string $url The URL to be cleaned.
- * @param array $protocols Optional. An array of acceptable protocols.
- * Defaults to 'http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet', 'mms', 'rtsp', 'svn' if not set.
- * @param string $_context Private. Use esc_url_raw() for database usage.
- * @return string The cleaned $url after the 'clean_url' filter is applied.
+ * @param string $url The URL to be cleaned.
+ * @param array $protocols Optional. An array of acceptable protocols.
+ * Defaults to return value of wp_allowed_protocols()
+ * @param string $_context Private. Use esc_url_raw() for database usage.
+ * @return string The cleaned $url after the {@see 'clean_url'} filter is applied.
*/
function esc_url( $url, $protocols = null, $_context = 'display' ) {
$original_url = $url;
if ( '' == $url )
return $url;
- $url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%@$\|*\'()\\x80-\\xff]|i', '', $url);
- $strip = array('%0d', '%0a', '%0D', '%0A');
- $url = _deep_replace($strip, $url);
+
+ $url = str_replace( ' ', '%20', $url );
+ $url = preg_replace('|[^a-z0-9-~+_.?#=!&;,/:%@$\|*\'()\[\]\\x80-\\xff]|i', '', $url);
+
+ if ( '' === $url ) {
+ return $url;
+ }
+
+ if ( 0 !== stripos( $url, 'mailto:' ) ) {
+ $strip = array('%0d', '%0a', '%0D', '%0A');
+ $url = _deep_replace($strip, $url);
+ }
+
$url = str_replace(';//', '://', $url);
/* If the URL doesn't appear to contain a scheme, we
- * presume it needs http:// appended (unless a relative
+ * presume it needs http:// prepended (unless a relative
* link starting with /, # or ? or a php file).
*/
if ( strpos($url, ':') === false && ! in_array( $url[0], array( '/', '#', '?' ) ) &&
@@ -3122,6 +3820,43 @@
$url = str_replace( "'", ''', $url );
}
+ if ( ( false !== strpos( $url, '[' ) ) || ( false !== strpos( $url, ']' ) ) ) {
+
+ $parsed = wp_parse_url( $url );
+ $front = '';
+
+ if ( isset( $parsed['scheme'] ) ) {
+ $front .= $parsed['scheme'] . '://';
+ } elseif ( '/' === $url[0] ) {
+ $front .= '//';
+ }
+
+ if ( isset( $parsed['user'] ) ) {
+ $front .= $parsed['user'];
+ }
+
+ if ( isset( $parsed['pass'] ) ) {
+ $front .= ':' . $parsed['pass'];
+ }
+
+ if ( isset( $parsed['user'] ) || isset( $parsed['pass'] ) ) {
+ $front .= '@';
+ }
+
+ if ( isset( $parsed['host'] ) ) {
+ $front .= $parsed['host'];
+ }
+
+ if ( isset( $parsed['port'] ) ) {
+ $front .= ':' . $parsed['port'];
+ }
+
+ $end_dirty = str_replace( $front, '', $url );
+ $end_clean = str_replace( array( '[', ']' ), array( '%5B', '%5D' ), $end_dirty );
+ $url = str_replace( $end_dirty, $end_clean, $url );
+
+ }
+
if ( '/' === $url[0] ) {
$good_protocol_url = $url;
} else {
@@ -3133,7 +3868,7 @@
}
/**
- * Filter a string cleaned and escaped for output as a URL.
+ * Filters a string cleaned and escaped for output as a URL.
*
* @since 2.3.0
*
@@ -3149,8 +3884,8 @@
*
* @since 2.8.0
*
- * @param string $url The URL to be cleaned.
- * @param array $protocols An array of acceptable protocols.
+ * @param string $url The URL to be cleaned.
+ * @param array $protocols An array of acceptable protocols.
* @return string The cleaned URL.
*/
function esc_url_raw( $url, $protocols = null ) {
@@ -3160,14 +3895,14 @@
/**
* Convert entities, while preserving already-encoded entities.
*
- * @link http://www.php.net/htmlentities Borrowed from the PHP Manual user notes.
+ * @link https://secure.php.net/htmlentities Borrowed from the PHP Manual user notes.
*
* @since 1.2.2
*
* @param string $myHTML The text to be converted.
* @return string Converted text.
*/
-function htmlentities2($myHTML) {
+function htmlentities2( $myHTML ) {
$translation_table = get_html_translation_table( HTML_ENTITIES, ENT_QUOTES );
$translation_table[chr(38)] = '&';
return preg_replace( "/&(?![A-Za-z]{0,4}\w{2,3};|#[0-9]{2,3};)/", "&", strtr($myHTML, $translation_table) );
@@ -3178,7 +3913,7 @@
*
* Escapes text strings for echoing in JS. It is intended to be used for inline JS
* (in a tag attribute, for example onclick="..."). Note that the strings have to
- * be in single quotes. The filter 'js_escape' is also applied here.
+ * be in single quotes. The {@see 'js_escape'} filter is also applied here.
*
* @since 2.8.0
*
@@ -3192,7 +3927,7 @@
$safe_text = str_replace( "\r", '', $safe_text );
$safe_text = str_replace( "\n", '\\n', addslashes( $safe_text ) );
/**
- * Filter a string cleaned and escaped for output in JavaScript.
+ * Filters a string cleaned and escaped for output in JavaScript.
*
* Text passed to esc_js() is stripped of invalid or special characters,
* and properly slashed for output.
@@ -3217,7 +3952,7 @@
$safe_text = wp_check_invalid_utf8( $text );
$safe_text = _wp_specialchars( $safe_text, ENT_QUOTES );
/**
- * Filter a string cleaned and escaped for output in HTML.
+ * Filters a string cleaned and escaped for output in HTML.
*
* Text passed to esc_html() is stripped of invalid or special characters
* before output.
@@ -3242,7 +3977,7 @@
$safe_text = wp_check_invalid_utf8( $text );
$safe_text = _wp_specialchars( $safe_text, ENT_QUOTES );
/**
- * Filter a string cleaned and escaped for output in an HTML attribute.
+ * Filters a string cleaned and escaped for output in an HTML attribute.
*
* Text passed to esc_attr() is stripped of invalid or special characters
* before output.
@@ -3266,7 +4001,7 @@
function esc_textarea( $text ) {
$safe_text = htmlspecialchars( $text, ENT_QUOTES, get_option( 'blog_charset' ) );
/**
- * Filter a string cleaned and escaped for output in a textarea element.
+ * Filters a string cleaned and escaped for output in a textarea element.
*
* @since 3.1.0
*
@@ -3284,10 +4019,10 @@
* @param string $tag_name
* @return string
*/
-function tag_escape($tag_name) {
+function tag_escape( $tag_name ) {
$safe_tag = strtolower( preg_replace('/[^a-zA-Z0-9_:]/', '', $tag_name) );
/**
- * Filter a string cleaned and escaped for output as an HTML tag.
+ * Filters a string cleaned and escaped for output as an HTML tag.
*
* @since 2.8.0
*
@@ -3310,7 +4045,7 @@
* @return string Absolute path.
*/
function wp_make_link_relative( $link ) {
- return preg_replace( '|^(https?:)?//[^/]+(/.*)|i', '$2', $link );
+ return preg_replace( '|^(https?:)?//[^/]+(/?.*)|i', '$2', $link );
}
/**
@@ -3321,22 +4056,29 @@
*
* @since 2.0.5
*
+ * @global wpdb $wpdb WordPress database abstraction object.
+ *
* @param string $option The name of the option.
- * @param string $value The unsanitised value.
+ * @param string $value The unsanitised value.
* @return string Sanitized value.
*/
-function sanitize_option($option, $value) {
+function sanitize_option( $option, $value ) {
global $wpdb;
+ $original_value = $value;
+ $error = '';
+
switch ( $option ) {
case 'admin_email' :
case 'new_admin_email' :
$value = $wpdb->strip_invalid_text_for_column( $wpdb->options, 'option_value', $value );
- $value = sanitize_email( $value );
- if ( ! is_email( $value ) ) {
- $value = get_option( $option ); // Resets option to stored value in the case of failed sanitization
- if ( function_exists( 'add_settings_error' ) )
- add_settings_error( $option, 'invalid_admin_email', __( 'The email address entered did not appear to be a valid email address. Please enter a valid email address.' ) );
+ if ( is_wp_error( $value ) ) {
+ $error = $value->get_error_message();
+ } else {
+ $value = sanitize_email( $value );
+ if ( ! is_email( $value ) ) {
+ $error = __( 'The email address entered did not appear to be a valid email address. Please enter a valid email address.' );
+ }
}
break;
@@ -3344,6 +4086,8 @@
case 'thumbnail_size_h':
case 'medium_size_w':
case 'medium_size_h':
+ case 'medium_large_size_w':
+ case 'medium_large_size_h':
case 'large_size_w':
case 'large_size_h':
case 'mailserver_port':
@@ -3359,6 +4103,7 @@
case 'thread_comments_depth':
case 'users_can_register':
case 'start_of_week':
+ case 'site_icon':
$value = absint( $value );
break;
@@ -3381,8 +4126,15 @@
case 'blogdescription':
case 'blogname':
$value = $wpdb->strip_invalid_text_for_column( $wpdb->options, 'option_value', $value );
- $value = wp_kses_post( $value );
- $value = esc_html( $value );
+ if ( $value !== $original_value ) {
+ $value = $wpdb->strip_invalid_text_for_column( $wpdb->options, 'option_value', wp_encode_emoji( $original_value ) );
+ }
+
+ if ( is_wp_error( $value ) ) {
+ $error = $value->get_error_message();
+ } else {
+ $value = esc_html( $value );
+ }
break;
case 'blog_charset':
@@ -3404,8 +4156,12 @@
case 'mailserver_pass':
case 'upload_path':
$value = $wpdb->strip_invalid_text_for_column( $wpdb->options, 'option_value', $value );
- $value = strip_tags( $value );
- $value = wp_kses_data( $value );
+ if ( is_wp_error( $value ) ) {
+ $error = $value->get_error_message();
+ } else {
+ $value = strip_tags( $value );
+ $value = wp_kses_data( $value );
+ }
break;
case 'ping_sites':
@@ -3421,23 +4177,27 @@
case 'siteurl':
$value = $wpdb->strip_invalid_text_for_column( $wpdb->options, 'option_value', $value );
- if ( (bool)preg_match( '#http(s?)://(.+)#i', $value) ) {
- $value = esc_url_raw($value);
+ if ( is_wp_error( $value ) ) {
+ $error = $value->get_error_message();
} else {
- $value = get_option( $option ); // Resets option to stored value in the case of failed sanitization
- if ( function_exists('add_settings_error') )
- add_settings_error('siteurl', 'invalid_siteurl', __('The WordPress address you entered did not appear to be a valid URL. Please enter a valid URL.'));
+ if ( preg_match( '#http(s?)://(.+)#i', $value ) ) {
+ $value = esc_url_raw( $value );
+ } else {
+ $error = __( 'The WordPress address you entered did not appear to be a valid URL. Please enter a valid URL.' );
+ }
}
break;
case 'home':
$value = $wpdb->strip_invalid_text_for_column( $wpdb->options, 'option_value', $value );
- if ( (bool)preg_match( '#http(s?)://(.+)#i', $value) ) {
- $value = esc_url_raw($value);
+ if ( is_wp_error( $value ) ) {
+ $error = $value->get_error_message();
} else {
- $value = get_option( $option ); // Resets option to stored value in the case of failed sanitization
- if ( function_exists('add_settings_error') )
- add_settings_error('home', 'invalid_home', __('The Site address you entered did not appear to be a valid URL. Please enter a valid URL.'));
+ if ( preg_match( '#http(s?)://(.+)#i', $value ) ) {
+ $value = esc_url_raw( $value );
+ } else {
+ $error = __( 'The Site address you entered did not appear to be a valid URL. Please enter a valid URL.' );
+ }
}
break;
@@ -3453,38 +4213,45 @@
case 'illegal_names':
$value = $wpdb->strip_invalid_text_for_column( $wpdb->options, 'option_value', $value );
- if ( ! is_array( $value ) )
- $value = explode( ' ', $value );
-
- $value = array_values( array_filter( array_map( 'trim', $value ) ) );
-
- if ( ! $value )
- $value = '';
+ if ( is_wp_error( $value ) ) {
+ $error = $value->get_error_message();
+ } else {
+ if ( ! is_array( $value ) )
+ $value = explode( ' ', $value );
+
+ $value = array_values( array_filter( array_map( 'trim', $value ) ) );
+
+ if ( ! $value )
+ $value = '';
+ }
break;
case 'limited_email_domains':
case 'banned_email_domains':
$value = $wpdb->strip_invalid_text_for_column( $wpdb->options, 'option_value', $value );
- if ( ! is_array( $value ) )
- $value = explode( "\n", $value );
-
- $domains = array_values( array_filter( array_map( 'trim', $value ) ) );
- $value = array();
-
- foreach ( $domains as $domain ) {
- if ( ! preg_match( '/(--|\.\.)/', $domain ) && preg_match( '|^([a-zA-Z0-9-\.])+$|', $domain ) )
- $value[] = $domain;
+ if ( is_wp_error( $value ) ) {
+ $error = $value->get_error_message();
+ } else {
+ if ( ! is_array( $value ) )
+ $value = explode( "\n", $value );
+
+ $domains = array_values( array_filter( array_map( 'trim', $value ) ) );
+ $value = array();
+
+ foreach ( $domains as $domain ) {
+ if ( ! preg_match( '/(--|\.\.)/', $domain ) && preg_match( '|^([a-zA-Z0-9-\.])+$|', $domain ) ) {
+ $value[] = $domain;
+ }
+ }
+ if ( ! $value )
+ $value = '';
}
- if ( ! $value )
- $value = '';
break;
case 'timezone_string':
$allowed_zones = timezone_identifiers_list();
if ( ! in_array( $value, $allowed_zones ) && ! empty( $value ) ) {
- $value = get_option( $option ); // Resets option to stored value in the case of failed sanitization
- if ( function_exists('add_settings_error') )
- add_settings_error('timezone_string', 'invalid_timezone_string', __('The timezone you have entered is not valid. Please select a valid timezone.') );
+ $error = __( 'The timezone you have entered is not valid. Please select a valid timezone.' );
}
break;
@@ -3492,8 +4259,20 @@
case 'category_base':
case 'tag_base':
$value = $wpdb->strip_invalid_text_for_column( $wpdb->options, 'option_value', $value );
- $value = esc_url_raw( $value );
- $value = str_replace( 'http://', '', $value );
+ if ( is_wp_error( $value ) ) {
+ $error = $value->get_error_message();
+ } else {
+ $value = esc_url_raw( $value );
+ $value = str_replace( 'http://', '', $value );
+ }
+
+ if ( 'permalink_structure' === $option && '' !== $value && ! preg_match( '/%[^\/%]+%/', $value ) ) {
+ $error = sprintf(
+ /* translators: %s: Codex URL */
+ __( 'A structure tag is required when using custom permalinks. Learn more' ),
+ __( 'https://codex.wordpress.org/Using_Permalinks#Choosing_your_permalink_structure' )
+ );
+ }
break;
case 'default_role' :
@@ -3504,22 +4283,61 @@
case 'moderation_keys':
case 'blacklist_keys':
$value = $wpdb->strip_invalid_text_for_column( $wpdb->options, 'option_value', $value );
- $value = explode( "\n", $value );
- $value = array_filter( array_map( 'trim', $value ) );
- $value = array_unique( $value );
- $value = implode( "\n", $value );
+ if ( is_wp_error( $value ) ) {
+ $error = $value->get_error_message();
+ } else {
+ $value = explode( "\n", $value );
+ $value = array_filter( array_map( 'trim', $value ) );
+ $value = array_unique( $value );
+ $value = implode( "\n", $value );
+ }
break;
}
+ if ( ! empty( $error ) ) {
+ $value = get_option( $option );
+ if ( function_exists( 'add_settings_error' ) ) {
+ add_settings_error( $option, "invalid_{$option}", $error );
+ }
+ }
+
/**
- * Filter an option value following sanitization.
+ * Filters an option value following sanitization.
*
* @since 2.3.0
+ * @since 4.3.0 Added the `$original_value` parameter.
*
- * @param string $value The sanitized option value.
- * @param string $option The option name.
+ * @param string $value The sanitized option value.
+ * @param string $option The option name.
+ * @param string $original_value The original value passed to the function.
*/
- $value = apply_filters( "sanitize_option_{$option}", $value, $option );
+ return apply_filters( "sanitize_option_{$option}", $value, $option, $original_value );
+}
+
+/**
+ * Maps a function to all non-iterable elements of an array or an object.
+ *
+ * This is similar to `array_walk_recursive()` but acts upon objects too.
+ *
+ * @since 4.4.0
+ *
+ * @param mixed $value The array, object, or scalar.
+ * @param callable $callback The function to map onto $value.
+ * @return mixed The value with the callback applied to all non-arrays and non-objects inside it.
+ */
+function map_deep( $value, $callback ) {
+ if ( is_array( $value ) ) {
+ foreach ( $value as $index => $item ) {
+ $value[ $index ] = map_deep( $item, $callback );
+ }
+ } elseif ( is_object( $value ) ) {
+ $object_vars = get_object_vars( $value );
+ foreach ( $object_vars as $property_name => $property_value ) {
+ $value->$property_name = map_deep( $property_value, $callback );
+ }
+ } else {
+ $value = call_user_func( $callback, $value );
+ }
return $value;
}
@@ -3527,20 +4345,20 @@
/**
* Parses a string into variables to be stored in an array.
*
- * Uses {@link http://www.php.net/parse_str parse_str()} and stripslashes if
- * {@link http://www.php.net/magic_quotes magic_quotes_gpc} is on.
+ * Uses {@link https://secure.php.net/parse_str parse_str()} and stripslashes if
+ * {@link https://secure.php.net/magic_quotes magic_quotes_gpc} is on.
*
* @since 2.2.1
*
* @param string $string The string to be parsed.
- * @param array $array Variables will be stored in this array.
+ * @param array $array Variables will be stored in this array.
*/
function wp_parse_str( $string, &$array ) {
parse_str( $string, $array );
if ( get_magic_quotes_gpc() )
$array = stripslashes_deep( $array );
/**
- * Filter the array of variables derived from a parsed string.
+ * Filters the array of variables derived from a parsed string.
*
* @since 2.3.0
*
@@ -3581,9 +4399,9 @@
* WordPress implementation of PHP sprintf() with filters.
*
* @since 2.5.0
- * @link http://www.php.net/sprintf
- *
- * @param string $pattern The string which formatted args are inserted.
+ * @link https://secure.php.net/sprintf
+ *
+ * @param string $pattern The string which formatted args are inserted.
* @param mixed $args ,... Arguments to be formatted into the $pattern string.
* @return string The formatted string.
*/
@@ -3625,7 +4443,7 @@
}
/**
- * Filter a fragment from the pattern passed to wp_sprintf().
+ * Filters a fragment from the pattern passed to wp_sprintf().
*
* If the fragment is unchanged, then sprintf() will be run on the fragment.
*
@@ -3658,10 +4476,10 @@
* @since 2.5.0
*
* @param string $pattern Content containing '%l' at the beginning.
- * @param array $args List items to prepend to the content and replace '%l'.
+ * @param array $args List items to prepend to the content and replace '%l'.
* @return string Localized list items and rest of the content.
*/
-function wp_sprintf_l($pattern, $args) {
+function wp_sprintf_l( $pattern, $args ) {
// Not a match
if ( substr($pattern, 0, 2) != '%l' )
return $pattern;
@@ -3671,7 +4489,7 @@
return '';
/**
- * Filter the translated delimiters used by wp_sprintf_l().
+ * Filters the translated delimiters used by wp_sprintf_l().
* Placeholders (%s) are included to assist translators and then
* removed before the array of strings reaches the filter.
*
@@ -3716,9 +4534,9 @@
*
* @since 2.5.0
*
- * @param string $str String to get the excerpt from.
- * @param integer $count Maximum number of characters to take.
- * @param string $more Optional. What to append if $str needs to be trimmed. Defaults to empty string.
+ * @param string $str String to get the excerpt from.
+ * @param int $count Maximum number of characters to take.
+ * @param string $more Optional. What to append if $str needs to be trimmed. Defaults to empty string.
* @return string The excerpt.
*/
function wp_html_excerpt( $str, $count, $more = null ) {
@@ -3741,9 +4559,11 @@
*
* @since 2.7.0
*
+ * @global string $_links_add_base
+ *
* @param string $content String to search for links in.
- * @param string $base The base URL to prefix to links.
- * @param array $attrs The attributes which should be processed.
+ * @param string $base The base URL to prefix to links.
+ * @param array $attrs The attributes which should be processed.
* @return string The processed content.
*/
function links_add_base_url( $content, $base, $attrs = array('src', 'href') ) {
@@ -3759,16 +4579,18 @@
* @since 2.7.0
* @access private
*
+ * @global string $_links_add_base
+ *
* @param string $m The matched link.
* @return string The processed link.
*/
-function _links_add_base($m) {
+function _links_add_base( $m ) {
global $_links_add_base;
//1 = attribute name 2 = quotation mark 3 = URL
return $m[1] . '=' . $m[2] .
( preg_match( '#^(\w{1,20}):#', $m[3], $protocol ) && in_array( $protocol[1], wp_allowed_protocols() ) ?
$m[3] :
- WP_HTTP::make_absolute_url( $m[3], $_links_add_base )
+ WP_Http::make_absolute_url( $m[3], $_links_add_base )
)
. $m[2];
}
@@ -3783,9 +4605,11 @@
*
* @since 2.7.0
*
+ * @global string $_links_add_target
+ *
* @param string $content String to search for links in.
- * @param string $target The Target to add to the links.
- * @param array $tags An array of tags to apply to.
+ * @param string $target The Target to add to the links.
+ * @param array $tags An array of tags to apply to.
* @return string The processed content.
*/
function links_add_target( $content, $target = '_blank', $tags = array('a') ) {
@@ -3801,6 +4625,8 @@
* @since 2.7.0
* @access private
*
+ * @global string $_links_add_target
+ *
* @param string $m The matched link.
* @return string The processed link.
*/
@@ -3835,8 +4661,8 @@
*
* @since 2.9.0
*
- * @param string $string String containing HTML tags
- * @param bool $remove_breaks optional Whether to remove left over line breaks and white space chars
+ * @param string $string String containing HTML tags
+ * @param bool $remove_breaks Optional. Whether to remove left over line breaks and white space chars
* @return string The processed string.
*/
function wp_strip_all_tags($string, $remove_breaks = false) {
@@ -3850,30 +4676,93 @@
}
/**
- * Sanitize a string from user input or from the db
- *
- * check for invalid UTF-8,
- * Convert single < characters to entity,
- * strip all tags,
- * remove line breaks, tabs and extra white space,
- * strip octets.
+ * Sanitizes a string from user input or from the database.
+ *
+ * - Checks for invalid UTF-8,
+ * - Converts single `<` characters to entities
+ * - Strips all tags
+ * - Removes line breaks, tabs, and extra whitespace
+ * - Strips octets
*
* @since 2.9.0
*
- * @param string $str
- * @return string
+ * @see sanitize_textarea_field()
+ * @see wp_check_invalid_utf8()
+ * @see wp_strip_all_tags()
+ *
+ * @param string $str String to sanitize.
+ * @return string Sanitized string.
*/
-function sanitize_text_field($str) {
+function sanitize_text_field( $str ) {
+ $filtered = _sanitize_text_fields( $str, false );
+
+ /**
+ * Filters a sanitized text field string.
+ *
+ * @since 2.9.0
+ *
+ * @param string $filtered The sanitized string.
+ * @param string $str The string prior to being sanitized.
+ */
+ return apply_filters( 'sanitize_text_field', $filtered, $str );
+}
+
+/**
+ * Sanitizes a multiline string from user input or from the database.
+ *
+ * The function is like sanitize_text_field(), but preserves
+ * new lines (\n) and other whitespace, which are legitimate
+ * input in textarea elements.
+ *
+ * @see sanitize_text_field()
+ *
+ * @since 4.7.0
+ *
+ * @param string $str String to sanitize.
+ * @return string Sanitized string.
+ */
+function sanitize_textarea_field( $str ) {
+ $filtered = _sanitize_text_fields( $str, true );
+
+ /**
+ * Filters a sanitized textarea field string.
+ *
+ * @since 4.7.0
+ *
+ * @param string $filtered The sanitized string.
+ * @param string $str The string prior to being sanitized.
+ */
+ return apply_filters( 'sanitize_textarea_field', $filtered, $str );
+}
+
+/**
+ * Internal helper function to sanitize a string from user input or from the db
+ *
+ * @since 4.7.0
+ * @access private
+ *
+ * @param string $str String to sanitize.
+ * @param bool $keep_newlines optional Whether to keep newlines. Default: false.
+ * @return string Sanitized string.
+ */
+function _sanitize_text_fields( $str, $keep_newlines = false ) {
$filtered = wp_check_invalid_utf8( $str );
if ( strpos($filtered, '<') !== false ) {
$filtered = wp_pre_kses_less_than( $filtered );
// This will strip extra whitespace for us.
- $filtered = wp_strip_all_tags( $filtered, true );
- } else {
- $filtered = trim( preg_replace('/[\r\n\t ]+/', ' ', $filtered) );
+ $filtered = wp_strip_all_tags( $filtered, false );
+
+ // Use html entities in a special case to make sure no later
+ // newline stripping stage could lead to a functional tag
+ $filtered = str_replace("<\n", "<\n", $filtered);
}
+ if ( ! $keep_newlines ) {
+ $filtered = preg_replace( '/[\r\n\t ]+/', ' ', $filtered );
+ }
+ $filtered = trim( $filtered );
+
$found = false;
while ( preg_match('/%[a-f0-9]{2}/i', $filtered, $match) ) {
$filtered = str_replace($match[0], '', $filtered);
@@ -3885,15 +4774,7 @@
$filtered = trim( preg_replace('/ +/', ' ', $filtered) );
}
- /**
- * Filter a sanitized text field string.
- *
- * @since 2.9.0
- *
- * @param string $filtered The sanitized string.
- * @param string $str The string prior to being sanitized.
- */
- return apply_filters( 'sanitize_text_field', $filtered, $str );
+ return $filtered;
}
/**
@@ -3901,7 +4782,7 @@
*
* @since 3.1.0
*
- * @param string $path A path.
+ * @param string $path A path.
* @param string $suffix If the filename ends in suffix this will also be cut off.
* @return string
*/
@@ -3915,6 +4796,11 @@
* Violating our coding standards for a good function name.
*
* @since 3.0.0
+ *
+ * @staticvar string|false $dblq
+ *
+ * @param string $text The text to be modified.
+ * @return string The modified text.
*/
function capital_P_dangit( $text ) {
// Simple replacement for titles
@@ -3923,13 +4809,13 @@
return str_replace( 'Wordpress', 'WordPress', $text );
// Still here? Use the more judicious replacement
static $dblq = false;
- if ( false === $dblq )
+ if ( false === $dblq ) {
$dblq = _x( '“', 'opening curly double quote' );
+ }
return str_replace(
array( ' Wordpress', '‘Wordpress', $dblq . 'Wordpress', '>Wordpress', '(Wordpress' ),
array( ' WordPress', '‘WordPress', $dblq . 'WordPress', '>WordPress', '(WordPress' ),
$text );
-
}
/**
@@ -3943,7 +4829,7 @@
function sanitize_mime_type( $mime_type ) {
$sani_mime_type = preg_replace( '/[^-+*.a-zA-Z0-9\/]/', '', $mime_type );
/**
- * Filter a mime type following sanitization.
+ * Filters a mime type following sanitization.
*
* @since 3.1.3
*
@@ -3970,7 +4856,7 @@
$urls_to_ping = array_map( 'esc_url_raw', $urls_to_ping );
$urls_to_ping = implode( "\n", $urls_to_ping );
/**
- * Filter a list of trackback URLs following sanitization.
+ * Filters a list of trackback URLs following sanitization.
*
* The string returned here consists of a space or carriage return-delimited list
* of trackback URLs.
@@ -4031,7 +4917,7 @@
* @since 3.6.0
*
* @param string $content A string which might contain a URL.
- * @return string The found URL.
+ * @return string|false The found URL.
*/
function get_url_in_content( $content ) {
if ( empty( $content ) ) {
@@ -4054,14 +4940,16 @@
*
* @since 4.0.0
*
+ * @staticvar string $spaces
+ *
* @return string The spaces regexp.
*/
function wp_spaces_regexp() {
- static $spaces;
+ static $spaces = '';
if ( empty( $spaces ) ) {
/**
- * Filter the regexp for common whitespace characters.
+ * Filters the regexp for common whitespace characters.
*
* This string is substituted for the \s sequence as needed in regular
* expressions. For websites not written in English, different characters
@@ -4082,6 +4970,8 @@
* Print the important emoji-related styles.
*
* @since 4.2.0
+ *
+ * @staticvar bool $printed
*/
function print_emoji_styles() {
static $printed = false;
@@ -4109,8 +4999,13 @@
apply_filters( 'emoji_url', set_url_scheme( '//s.w.org/images/core/emoji/72x72/' ) ),
+ 'baseUrl' => apply_filters( 'emoji_url', 'https://s.w.org/images/core/emoji/11/72x72/' ),
/**
- * Filter the extension of the emoji files.
+ * Filters the extension of the emoji png files.
*
* @since 4.2.0
*
- * @param string The emoji extension. Default .png.
+ * @param string The emoji extension for png files. Default .png.
*/
'ext' => apply_filters( 'emoji_ext', '.png' ),
+
+ /**
+ * Filters the URL where emoji SVG images are hosted.
+ *
+ * @since 4.6.0
+ *
+ * @param string The emoji base URL for svg images.
+ */
+ 'svgUrl' => apply_filters( 'emoji_svg_url', 'https://s.w.org/images/core/emoji/11/svg/' ),
+
+ /**
+ * Filters the extension of the emoji SVG files.
+ *
+ * @since 4.6.0
+ *
+ * @param string The emoji extension for svg files. Default .svg.
+ */
+ 'svgExt' => apply_filters( 'emoji_svg_ext', '.svg' ),
);
- $version = 'ver=' . $wp_version;
+ $version = 'ver=' . get_bloginfo( 'version' );
if ( SCRIPT_DEBUG ) {
$settings['source'] = array(
@@ -4174,17 +5098,14 @@
?>
0 && '<' != $content[0] ) {
- $matches = array();
- if ( preg_match_all( '/(DZ(e[6-9a-f]|f[0-9a-f]);){2}/', $content, $matches ) ) {
- if ( ! empty( $matches[0] ) ) {
- foreach ( $matches[0] as $flag ) {
- $chars = str_replace( array( '', ';'), '', $flag );
-
- list( $char1, $char2 ) = str_split( $chars, 5 );
- $entity = sprintf( '
', $cdn_url . $char1 . '-' . $char2 . $ext, html_entity_decode( $flag ) );
-
- $content = str_replace( $flag, $entity, $content );
- }
+ if ( '' == $ignore_block_element && strlen( $content ) > 0 && '<' != $content[0] && false !== strpos( $content, '' ) ) {
+ foreach ( $possible_emoji as $emojum => $emoji_char ) {
+ if ( false === strpos( $content, $emojum ) ) {
+ continue;
}
- }
-
- // Loosely match the Emoji Unicode range.
- $regex = '/([2-3][0-9a-f]{3};|[1-6][0-9a-f]{2};)/';
-
- $matches = array();
- if ( preg_match_all( $regex, $content, $matches ) ) {
- if ( ! empty( $matches[1] ) ) {
- foreach ( $matches[1] as $emoji ) {
- $char = str_replace( array( '', ';'), '', $emoji );
- $entity = sprintf( '
', $cdn_url . $char . $ext, html_entity_decode( $emoji ) );
-
- $content = str_replace( $emoji, $entity, $content );
- }
- }
+
+ $file = str_replace( ';', '-', $emojum );
+ $file = str_replace( array( '', ';'), '', $file );
+
+ $entity = sprintf( '
', $cdn_url . $file . $ext, $emoji_char );
+
+ $content = str_replace( $emojum, $entity, $content );
}
}
@@ -4306,6 +5224,9 @@
$output .= $content;
}
+ // Finally, remove any stray U+FE0F characters
+ $output = str_replace( '️', '', $output );
+
return $output;
}
@@ -4375,3 +5296,115 @@
return $mail;
}
+
+/**
+ * Returns a arrays of emoji data.
+ *
+ * These arrays automatically built from the regex in twemoji.js - if they need to be updated,
+ * you should update the regex there, then run the `grunt precommit:emoji` job.
+ *
+ * @since 4.9.0
+ * @access private
+ *
+ * @param string $type Optional. Which array type to return. Accepts 'partials' or 'entities', default 'entities'.
+ * @return array An array to match all emoji that WordPress recognises.
+ */
+function _wp_emoji_list( $type = 'entities' ) {
+ // Do not remove the START/END comments - they're used to find where to insert the arrays.
+
+ // START: emoji arrays
+ $entities = array('👩❤️💋👩','👩❤️💋👨','👨❤️💋👨','🏴','🏴','🏴','👩👩👧👦','👨👨👦👦','👩👩👦👦','👨👨👧👦','👨👨👧👧','👨👩👧👧','👨👩👦👦','👩👩👧👧','👨👩👧👦','👨❤️👨','👩❤️👨','👩❤️👩','👩👩👦','👩👦👦','👩👧👦','👩👧👧','👨👨👦','👨👩👧','👨👧👧','👨👧👦','👩👩👧','👨👩👦','👨👨👧','👨👦👦','🤵🏿♀️','🏋🏻♂️','🏋🏼♀️','🏋🏼♂️','🏋🏽♀️','🏋🏽♂️','🏋🏾♀️','🏋🏾♂️','🏋🏿♀️','🏋🏿♂️','🏌🏻♀️','🏌🏻♂️','🏌🏼♀️','🏌🏼♂️','🏌🏽♀️','🏌🏽♂️','🏌🏾♀️','🏌🏾♂️','🏌🏿♀️','🏌🏿♂️','💂🏻♀️','🏃🏼♀️','🏃🏼♂️','🧝🏿♂️','🧝🏿♀️','🧝🏾♂️','🧝🏾♀️','🧝🏽♂️','🧝🏽♀️','🧝🏼♂️','🧝🏼♀️','🧝🏻♂️','🧝🏻♀️','🧜🏿♂️','🧜🏿♀️','🧜🏾♂️','🧜🏾♀️','🧜🏽♂️','🧜🏽♀️','🧜🏼♂️','🧜🏼♀️','👨🏻⚕️','👨🏻⚖️','👨🏻✈️','🧜🏻♂️','🧜🏻♀️','🧛🏿♂️','🧛🏿♀️','🧛🏾♂️','🧛🏾♀️','🧛🏽♂️','🧛🏽♀️','🧛🏼♂️','🧛🏼♀️','🧛🏻♂️','🧛🏻♀️','🧚🏿♂️','🧚🏿♀️','🧚🏾♂️','🧚🏾♀️','🧚🏽♂️','👨🏼⚕️','👨🏼⚖️','👨🏼✈️','🧚🏽♀️','🧚🏼♂️','🧚🏼♀️','🧚🏻♂️','🧚🏻♀️','🧙🏿♂️','🧙🏿♀️','🧙🏾♂️','🧙🏾♀️','🧙🏽♂️','🧙🏽♀️','🧙🏼♂️','🧙🏼♀️','🧙🏻♂️','🧙🏻♀️','🧘🏿♂️','🧘🏿♀️','👨🏽⚕️','👨🏽⚖️','👨🏽✈️','🧘🏾♂️','🧘🏾♀️','🧘🏽♂️','🧘🏽♀️','🧘🏼♂️','🧘🏼♀️','🧘🏻♂️','🧘🏻♀️','🧗🏿♂️','🧗🏿♀️','🧗🏾♂️','🧗🏾♀️','🧗🏽♂️','🧗🏽♀️','🧗🏼♂️','🧗🏼♀️','🧗🏻♂️','👨🏾⚕️','👨🏾⚖️','👨🏾✈️','🧗🏻♀️','🧖🏿♂️','🧖🏿♀️','🧖🏾♂️','🧖🏾♀️','🧖🏽♂️','🧖🏽♀️','🧖🏼♂️','🧖🏼♀️','🧖🏻♂️','🧖🏻♀️','🦹🏿♂️','🦹🏿♀️','🦹🏾♂️','🦹🏾♀️','🦹🏽♂️','🦹🏽♀️','👨🏿⚕️','👨🏿⚖️','👨🏿✈️','🦹🏼♂️','🦹🏼♀️','🦹🏻♂️','🦹🏻♀️','🦸🏿♂️','🦸🏿♀️','🦸🏾♂️','🏃🏽♀️','🦸🏾♀️','🏃🏽♂️','🏃🏾♀️','🦸🏽♂️','🏃🏾♂️','🏃🏿♀️','🏃🏿♂️','🏄🏻♀️','🏄🏻♂️','🏄🏼♀️','🏄🏼♂️','🏄🏽♀️','🏄🏽♂️','🏄🏾♀️','🦸🏽♀️','🦸🏼♂️','🦸🏼♀️','🦸🏻♂️','🦸🏻♀️','🤾🏿♂️','🤾🏿♀️','🤾🏾♂️','🤾🏾♀️','🤾🏽♂️','🤾🏽♀️','🤾🏼♂️','🤾🏼♀️','🏄🏾♂️','🏄🏿♀️','🤾🏻♂️','🤾🏻♀️','🤽🏿♂️','🤽🏿♀️','🤽🏾♂️','🤽🏾♀️','🤽🏽♂️','🤽🏽♀️','🤽🏼♂️','🤽🏼♀️','🤽🏻♂️','🤽🏻♀️','🤹🏿♂️','🤹🏿♀️','🤹🏾♂️','🤹🏾♀️','🤹🏽♂️','👩🏻⚕️','👩🏻⚖️','👩🏻✈️','🤹🏽♀️','🤹🏼♂️','🤹🏼♀️','🤹🏻♂️','🤹🏻♀️','🤸🏿♂️','🤸🏿♀️','🤸🏾♂️','🤸🏾♀️','🤸🏽♂️','🤸🏽♀️','🤸🏼♂️','🤸🏼♀️','🤸🏻♂️','🤸🏻♀️','🤷🏿♂️','🤷🏿♀️','👩🏼⚕️','👩🏼⚖️','👩🏼✈️','🤷🏾♂️','🤷🏾♀️','🤷🏽♂️','🤷🏽♀️','🤷🏼♂️','🤷🏼♀️','🤷🏻♂️','🤷🏻♀️','🤵🏿♂️','🏃🏻♂️','🤵🏾♂️','🤵🏾♀️','🤵🏽♂️','🤵🏽♀️','🤵🏼♂️','🤵🏼♀️','🤵🏻♂️','👩🏽⚕️','👩🏽⚖️','👩🏽✈️','🤵🏻♀️','🤦🏿♂️','🤦🏿♀️','🤦🏾♂️','🤦🏾♀️','🤦🏽♂️','🤦🏽♀️','🤦🏼♂️','🤦🏼♀️','🤦🏻♂️','🤦🏻♀️','🚶🏿♂️','🚶🏿♀️','🚶🏾♂️','🚶🏾♀️','🚶🏽♂️','🚶🏽♀️','👩🏾⚕️','👩🏾⚖️','👩🏾✈️','🚶🏼♂️','🚶🏼♀️','🚶🏻♂️','🚶🏻♀️','🚵🏿♂️','🚵🏿♀️','🚵🏾♂️','🚵🏾♀️','🚵🏽♂️','🚵🏽♀️','🚵🏼♂️','🚵🏼♀️','🚵🏻♂️','🚵🏻♀️','🚴🏿♂️','🚴🏿♀️','🚴🏾♂️','👩🏿⚕️','👩🏿⚖️','👩🏿✈️','🚴🏾♀️','🚴🏽♂️','🚴🏽♀️','🚴🏼♂️','🚴🏼♀️','🚴🏻♂️','🚴🏻♀️','🏄🏿♂️','🚣🏿♂️','🏊🏻♀️','🏊🏻♂️','🚣🏿♀️','🏊🏼♀️','🏊🏼♂️','🏊🏽♀️','🏊🏽♂️','🏊🏾♀️','🚣🏾♂️','🚣🏾♀️','🚣🏽♂️','🚣🏽♀️','🚣🏼♂️','🚣🏼♀️','🚣🏻♂️','🚣🏻♀️','🙎🏿♂️','🙎🏿♀️','🙎🏾♂️','🙎🏾♀️','🙎🏽♂️','🏊🏾♂️','🏊🏿♀️','🏊🏿♂️','🏋🏻♀️','👮🏻♀️','👮🏻♂️','👮🏼♀️','👮🏼♂️','👮🏽♀️','👮🏽♂️','👮🏾♀️','👮🏾♂️','👮🏿♀️','👮🏿♂️','🙎🏽♀️','🙎🏼♂️','🙎🏼♀️','🙎🏻♂️','👱🏻♀️','👱🏻♂️','👱🏼♀️','👱🏼♂️','👱🏽♀️','👱🏽♂️','👱🏾♀️','👱🏾♂️','👱🏿♀️','👱🏿♂️','🙎🏻♀️','🙍🏿♂️','👳🏻♀️','👳🏻♂️','👳🏼♀️','👳🏼♂️','👳🏽♀️','👳🏽♂️','👳🏾♀️','👳🏾♂️','👳🏿♀️','👳🏿♂️','🙍🏿♀️','🙍🏾♂️','👷🏻♀️','👷🏻♂️','👷🏼♀️','👷🏼♂️','👷🏽♀️','👷🏽♂️','👷🏾♀️','👷🏾♂️','👷🏿♀️','👷🏿♂️','🙍🏾♀️','🙍🏽♂️','💁🏻♀️','💁🏻♂️','💁🏼♀️','💁🏼♂️','💁🏽♀️','💁🏽♂️','💁🏾♀️','💁🏾♂️','💁🏿♀️','💁🏿♂️','🙍🏽♀️','🙍🏼♂️','🏃🏻♀️','💂🏻♂️','💂🏼♀️','💂🏼♂️','💂🏽♀️','💂🏽♂️','💂🏾♀️','💂🏾♂️','💂🏿♀️','💂🏿♂️','🙍🏼♀️','🙍🏻♂️','💆🏻♀️','💆🏻♂️','💆🏼♀️','💆🏼♂️','💆🏽♀️','💆🏽♂️','💆🏾♀️','💆🏾♂️','💆🏿♀️','💆🏿♂️','🙍🏻♀️','🙋🏿♂️','💇🏻♀️','💇🏻♂️','💇🏼♀️','💇🏼♂️','💇🏽♀️','💇🏽♂️','💇🏾♀️','💇🏾♂️','💇🏿♀️','💇🏿♂️','🙋🏿♀️','🙋🏾♂️','🕴🏻♀️','🕴🏻♂️','🕴🏼♀️','🕴🏼♂️','🕴🏽♀️','🕴🏽♂️','🕴🏾♀️','🕴🏾♂️','🕴🏿♀️','🕴🏿♂️','🕵🏻♀️','🕵🏻♂️','🕵🏼♀️','🕵🏼♂️','🕵🏽♀️','🕵🏽♂️','🕵🏾♀️','🕵🏾♂️','🕵🏿♀️','🕵🏿♂️','🙅🏻♀️','🙅🏻♂️','🙅🏼♀️','🙅🏼♂️','🙅🏽♀️','🙅🏽♂️','🙅🏾♀️','🙅🏾♂️','🙅🏿♀️','🙅🏿♂️','🙋🏾♀️','🙋🏽♂️','🙆🏻♀️','🙆🏻♂️','🙆🏼♀️','🙆🏼♂️','🙆🏽♀️','🙆🏽♂️','🙆🏾♀️','🙆🏾♂️','🙆🏿♀️','🙆🏿♂️','🙋🏽♀️','🙋🏼♂️','🙇🏻♀️','🙇🏻♂️','🙇🏼♀️','🙇🏼♂️','🙇🏽♀️','🙇🏽♂️','🙇🏾♀️','🙇🏾♂️','🙇🏿♀️','🙇🏿♂️','🙋🏼♀️','🙋🏻♂️','🙋🏻♀️','🕴️♀️','🕴️♂️','🏋️♀️','🏋️♂️','⛹🏾♀️','🏌️♀️','🏌️♂️','⛹🏻♂️','⛹🏻♀️','⛹🏾♂️','⛹🏿♀️','⛹🏿♂️','🕵️♀️','🕵️♂️','⛹🏽♀️','⛹🏽♂️','⛹🏼♀️','⛹🏼♂️','⛹️♀️','⛹️♂️','👩🏻🎨','👨🏻🌾','👨🏻🍳','👨🏻🎓','👨🏻🎤','👨🏻🎨','👨🏻🏫','👨🏻🏭','👨🏻💻','👨🏻💼','👨🏻🔧','👨🏻🔬','👨🏻🚀','👨🏻🚒','👨🏻🦰','👨🏻🦱','👨🏻🦲','👨🏻🦳','👨🏼🌾','👨🏼🍳','👨🏼🎓','👨🏼🎤','👨🏼🎨','👨🏼🏫','👨🏼🏭','👨🏼💻','👨🏼💼','👨🏼🔧','👨🏼🔬','👨🏼🚀','👨🏼🚒','👨🏼🦰','👨🏼🦱','👨🏼🦲','👨🏼🦳','👨🏽🌾','👨🏽🍳','👨🏽🎓','👨🏽🎤','👨🏽🎨','👨🏽🏫','👨🏽🏭','👨🏽💻','👨🏽💼','👨🏽🔧','👨🏽🔬','👨🏽🚀','👨🏽🚒','👨🏽🦰','👨🏽🦱','👨🏽🦲','👩🏿🦳','👩🏿🦲','👩🏿🦱','👨🏽🦳','👨🏾🌾','👩🏿🦰','👩🏿🚒','👩🏿🚀','👩🏿🔬','👩🏿🔧','👩🏿💼','👩🏿💻','👩🏿🏭','👩🏿🏫','👩🏿🎨','👨🏾🍳','👨🏾🎓','👩🏿🎤','👩🏿🎓','👩🏿🍳','👩🏿🌾','👩🏾🦳','👩🏾🦲','👩🏾🦱','👩🏾🦰','👩🏾🚒','👩🏾🚀','👨🏾🎤','👨🏾🎨','👩🏾🔬','👩🏾🔧','👩🏾💼','👩🏾💻','👩🏾🏭','👩🏾🏫','👩🏾🎨','👩🏾🎤','👩🏾🎓','👩🏾🍳','👨🏾🏫','👨🏾🏭','👩🏾🌾','👩🏽🦳','👩🏽🦲','👩🏽🦱','👩🏽🦰','👩🏽🚒','👩🏽🚀','👩🏽🔬','👩🏽🔧','👩🏽💼','👨🏾💻','👨🏾💼','👩🏽💻','👩🏽🏭','👩🏽🏫','👩🏽🎨','👩🏽🎤','👩🏽🎓','👩🏽🍳','👩🏽🌾','👩🏼🦳','👩🏼🦲','👨🏾🔧','👨🏾🔬','👩🏼🦱','👩🏼🦰','👩🏼🚒','👩🏼🚀','👩🏼🔬','👩🏼🔧','👩🏼💼','👩🏼💻','👩🏼🏭','👩🏼🏫','👨🏾🚀','👨🏾🚒','👩🏼🎨','👩🏼🎤','👩🏼🎓','👩🏼🍳','👩🏼🌾','👩🏻🦳','👩🏻🦲','👩🏻🦱','👩🏻🦰','👩🏻🚒','👨🏾🦰','👨🏾🦱','👨🏾🦲','👨🏾🦳','👩🏻🚀','👩🏻🔬','👩🏻🔧','👩🏻💼','👩🏻💻','👩🏻🏭','👩🏻🏫','👨🏿🌾','👩🏻🎤','👩🏻🎓','👨🏿🍳','👨🏿🎓','👩🏻🍳','👩🏻🌾','👨🏿🎤','👨🏿🎨','👨🏿🏫','👨🏿🏭','👨🏿💻','👨🏿💼','👨🏿🔧','👨🏿🔬','👨🏿🚀','👨🏿🚒','👨🏿🦰','👨🏿🦱','👨🏿🦲','👨🏿🦳','🏳️🌈','👩⚖️','🦸♂️','🤾♂️','🤾♀️','🦹♀️','🦹♂️','👨⚕️','👨⚖️','👨✈️','🤽♂️','🤽♀️','🧖♀️','🧖♂️','🙇♀️','🤼♂️','🤼♀️','🤹♂️','🤹♀️','🤸♂️','🤸♀️','🤷♂️','🤷♀️','🤵♂️','🧗♀️','🧗♂️','🤵♀️','🤦♂️','🤦♀️','🚶♂️','🚶♀️','🚵♂️','🚵♀️','🚴♂️','🚴♀️','🧘♀️','🧘♂️','🚣♂️','🚣♀️','🧙♀️','🧙♂️','🙎♂️','🙎♀️','🧚♀️','🧚♂️','👩⚕️','🦸♀️','👩✈️','👮♀️','👮♂️','👯♀️','👯♂️','👱♀️','🧛♀️','🧛♂️','🙍♂️','🙍♀️','👱♂️','👳♀️','👳♂️','👷♀️','👷♂️','💁♀️','💁♂️','💂♀️','🧜♀️','🧜♂️','💂♂️','💆♀️','🙋♂️','🙋♀️','💆♂️','💇♀️','💇♂️','🙅♀️','🙅♂️','🧝♀️','🧝♂️','🧞♀️','🧞♂️','🧟♀️','🧟♂️','🏴☠️','🙇♂️','🙆♀️','🙆♂️','🏊♂️','🏊♀️','🏄♂️','🏄♀️','🏃♂️','🏃♀️','👨🎨','👩🍳','👩🎓','👩🎤','👩🎨','👩🏫','👩🏭','👨💻','👨🚒','👩👦','👨👧','👨🦰','👨🦱','👩💻','👩💼','👩🔧','👩🔬','👩🚀','👩🚒','👩🦰','👩🦱','👁🗨','👨🦲','👨🦳','👨👦','👨🎤','👩🦲','👩🦳','👨🎓','👨🍳','👨🌾','👨💼','👨🔧','👨🔬','👨🚀','👨🏭','👩🌾','👨🏫','👩👧','👆🏿','👇🏻','👷🏼','👇🏼','👇🏽','👷🏽','👇🏾','👇🏿','👷🏾','👈🏻','👈🏼','👷🏿','👈🏽','👈🏾','👸🏻','👸🏼','👸🏽','👸🏾','👸🏿','👼🏻','👼🏼','👼🏽','👼🏾','👼🏿','👈🏿','👉🏻','💁🏻','👉🏼','👉🏽','💁🏼','👉🏾','👉🏿','💁🏽','👊🏻','👊🏼','💁🏾','👊🏽','👊🏾','💁🏿','👊🏿','👋🏻','👋🏼','👋🏽','💂🏻','👋🏾','👋🏿','💂🏼','👌🏻','👌🏼','💂🏽','👌🏽','👌🏾','💂🏾','👌🏿','👍🏻','💂🏿','👍🏼','👍🏽','💃🏻','💃🏼','💃🏽','💃🏾','💃🏿','💅🏻','💅🏼','💅🏽','💅🏾','💅🏿','👍🏾','👍🏿','💆🏻','👎🏻','👎🏼','💆🏼','👎🏽','👎🏾','💆🏽','👎🏿','👏🏻','💆🏾','👏🏼','👏🏽','💆🏿','👏🏾','👏🏿','👐🏻','👐🏼','💇🏻','👐🏽','👐🏾','💇🏼','👐🏿','👦🏻','💇🏽','👦🏼','👦🏽','💇🏾','👦🏾','👦🏿','💇🏿','👧🏻','👧🏼','💪🏻','💪🏼','💪🏽','💪🏾','💪🏿','👧🏽','👧🏾','🕴🏻','👧🏿','🇪🇪','🕴🏼','🇪🇬','🇪🇭','🕴🏽','🇪🇷','🇪🇸','🕴🏾','🇪🇹','🇪🇺','🕴🏿','🇫🇮','🇫🇯','🇫🇰','🇫🇲','🕵🏻','🇫🇴','🇫🇷','🕵🏼','🇬🇦','🇬🇧','🕵🏽','🇬🇩','🇬🇪','🕵🏾','🇬🇫','🇬🇬','🕵🏿','🇬🇭','👨🏻','🕺🏻','🕺🏼','🕺🏽','🕺🏾','🕺🏿','🖐🏻','🖐🏼','🖐🏽','🖐🏾','🖐🏿','🖕🏻','🖕🏼','🖕🏽','🖕🏾','🖕🏿','🖖🏻','🖖🏼','🖖🏽','🖖🏾','🖖🏿','🇬🇮','🇬🇱','🙅🏻','🇬🇲','🇬🇳','🙅🏼','🇬🇵','🇬🇶','🙅🏽','🇬🇷','🇬🇸','🙅🏾','🇬🇹','🇬🇺','🙅🏿','🇬🇼','🇬🇾','🇭🇰','🇭🇲','🙆🏻','🇭🇳','🇭🇷','🙆🏼','🇭🇹','🇭🇺','🙆🏽','🇮🇨','🇮🇩','🙆🏾','👨🏼','🇮🇪','🙆🏿','🇮🇱','🇮🇲','🇮🇳','🇮🇴','🙇🏻','🇮🇶','🇮🇷','🙇🏼','🇮🇸','🇮🇹','🙇🏽','🇯🇪','🇯🇲','🙇🏾','🇯🇴','🇯🇵','🙇🏿','🇰🇪','🇰🇬','🇰🇭','🇰🇮','🙋🏻','🇰🇲','🇰🇳','🙋🏼','🇰🇵','👨🏽','🙋🏽','🇰🇷','🇰🇼','🙋🏾','🇰🇾','🇰🇿','🙋🏿','🇱🇦','🇱🇧','🙌🏻','🙌🏼','🙌🏽','🙌🏾','🙌🏿','🇱🇨','🇱🇮','🙍🏻','🇱🇰','🇱🇷','🙍🏼','🇱🇸','🇱🇹','🙍🏽','🇱🇺','🇱🇻','🙍🏾','🇱🇾','🇲🇦','🙍🏿','🇲🇨','🇲🇩','🇲🇪','🇲🇫','🙎🏻','👨🏾','🇲🇬','🙎🏼','🇲🇭','🇲🇰','🙎🏽','🇲🇱','🇲🇲','🙎🏾','🇲🇳','🇲🇴','🙎🏿','🇲🇵','🇲🇶','🙏🏻','🙏🏼','🙏🏽','🙏🏾','🙏🏿','🇲🇷','🇲🇸','🚣🏻','🇲🇹','🇲🇺','🚣🏼','🇲🇻','🇲🇼','🚣🏽','🇲🇽','🇲🇾','🚣🏾','🇲🇿','🇳🇦','🚣🏿','🇳🇨','👨🏿','🇳🇪','🇳🇫','🚴🏻','🇳🇬','🇳🇮','🚴🏼','🇳🇱','🇳🇴','🚴🏽','🇳🇵','🇳🇷','🚴🏾','🇳🇺','🇳🇿','🚴🏿','🇴🇲','🇵🇦','🇵🇪','🇵🇫','🚵🏻','🇵🇬','🇵🇭','🚵🏼','🇵🇰','🇵🇱','🚵🏽','🇵🇲','🇵🇳','🚵🏾','🇵🇷','🇵🇸','🚵🏿','🇵🇹','🇵🇼','🇵🇾','🇶🇦','🚶🏻','🇷🇪','🇷🇴','🚶🏼','🇷🇸','🇷🇺','🚶🏽','🇷🇼','🇸🇦','🚶🏾','🇸🇧','🇸🇨','🚶🏿','🇸🇩','🇸🇪','🛀🏻','🛀🏼','🛀🏽','🛀🏾','🛀🏿','🛌🏻','🛌🏼','🛌🏽','🛌🏾','🛌🏿','🤘🏻','🤘🏼','🤘🏽','🤘🏾','🤘🏿','🤙🏻','🤙🏼','🤙🏽','🤙🏾','🤙🏿','🤚🏻','🤚🏼','🤚🏽','🤚🏾','🤚🏿','🤛🏻','🤛🏼','🤛🏽','🤛🏾','🤛🏿','🤜🏻','🤜🏼','🤜🏽','🤜🏾','🤜🏿','🤞🏻','🤞🏼','🤞🏽','🤞🏾','🤞🏿','🤟🏻','🤟🏼','🤟🏽','🤟🏾','🤟🏿','🇸🇬','🇸🇭','🤦🏻','🇸🇮','🇸🇯','🤦🏼','🇸🇰','🇦🇩','🤦🏽','🇸🇲','🇸🇳','🤦🏾','🇸🇴','🇸🇷','🤦🏿','🇸🇸','🇸🇹','🤰🏻','🤰🏼','🤰🏽','🤰🏾','🤰🏿','🤱🏻','🤱🏼','🤱🏽','🤱🏾','🤱🏿','🤲🏻','🤲🏼','🤲🏽','🤲🏾','🤲🏿','🤳🏻','🤳🏼','🤳🏽','🤳🏾','🤳🏿','🤴🏻','🤴🏼','🤴🏽','🤴🏾','🤴🏿','🇸🇻','🇸🇽','🤵🏻','🇸🇾','🇸🇿','🤵🏼','🇹🇦','🇹🇨','🤵🏽','🇹🇩','🇹🇫','🤵🏾','🇹🇬','👩🏻','🤵🏿','🇹🇭','🇹🇯','🤶🏻','🤶🏼','🤶🏽','🤶🏾','🤶🏿','🇹🇰','🇹🇱','🤷🏻','🇹🇲','🇹🇳','🤷🏼','🇹🇴','🇹🇷','🤷🏽','🇹🇹','🇹🇻','🤷🏾','🇹🇼','🇹🇿','🤷🏿','🇺🇦','🇺🇬','🇺🇲','🇺🇳','🤸🏻','🇺🇸','🇺🇾','🤸🏼','🇺🇿','🇻🇦','🤸🏽','👩🏼','🇻🇨','🤸🏾','🇻🇪','🇻🇬','🤸🏿','🇻🇮','🇻🇳','🇻🇺','🇼🇫','🤹🏻','🇼🇸','🇽🇰','🤹🏼','🇾🇪','🇾🇹','🤹🏽','🇿🇦','🇿🇲','🤹🏾','🇿🇼','🎅🏻','🤹🏿','🎅🏼','🎅🏽','🎅🏾','🎅🏿','🏂🏻','👩🏽','🤽🏻','🏂🏼','🏂🏽','🤽🏼','🏂🏾','🏂🏿','🤽🏽','🇦🇨','🇦🇪','🤽🏾','🏃🏻','🇦🇫','🤽🏿','🇦🇬','🏃🏼','🇦🇮','🇦🇱','🤾🏻','🏃🏽','🇦🇲','🤾🏼','🇦🇴','🏃🏾','🤾🏽','🇦🇶','🇦🇷','🤾🏾','🏃🏿','🇦🇸','🤾🏿','👩🏾','🇦🇹','🦵🏻','🦵🏼','🦵🏽','🦵🏾','🦵🏿','🦶🏻','🦶🏼','🦶🏽','🦶🏾','🦶🏿','🇦🇺','🇦🇼','🦸🏻','🏄🏻','🇦🇽','🦸🏼','🇦🇿','🏄🏼','🦸🏽','🇧🇦','🇧🇧','🦸🏾','🏄🏽','🇧🇩','🦸🏿','🇧🇪','🏄🏾','🇧🇫','🇧🇬','🦹🏻','🏄🏿','🇧🇭','🦹🏼','🇧🇮','🏇🏻','🦹🏽','🏇🏼','👩🏿','🦹🏾','🏇🏽','🏇🏾','🦹🏿','🏇🏿','🇧🇯','🧑🏻','🧑🏼','🧑🏽','🧑🏾','🧑🏿','🧒🏻','🧒🏼','🧒🏽','🧒🏾','🧒🏿','🧓🏻','🧓🏼','🧓🏽','🧓🏾','🧓🏿','🧔🏻','🧔🏼','🧔🏽','🧔🏾','🧔🏿','🧕🏻','🧕🏼','🧕🏽','🧕🏾','🧕🏿','🇧🇱','🏊🏻','🧖🏻','🇧🇲','🇧🇳','🧖🏼','🏊🏼','🇧🇴','🧖🏽','🇧🇶','🏊🏽','🧖🏾','🇧🇷','🇧🇸','🧖🏿','🏊🏾','🇧🇹','🇧🇻','🏊🏿','🧗🏻','🇧🇼','🇧🇾','🧗🏼','🇧🇿','🇨🇦','🧗🏽','🏋🏻','🇨🇨','🧗🏾','🇨🇩','🏋🏼','🧗🏿','🇨🇫','🇨🇬','🏋🏽','🇨🇭','🧘🏻','🇨🇮','🏋🏾','🧘🏼','🇨🇰','🇨🇱','🧘🏽','🏋🏿','🇨🇲','🧘🏾','👮🏻','🇨🇳','🧘🏿','🇨🇴','👮🏼','🇨🇵','🏌🏻','🧙🏻','👮🏽','🇨🇷','🧙🏼','🇨🇺','👮🏾','🧙🏽','🏌🏼','🇨🇻','🧙🏾','👮🏿','🇨🇼','🧙🏿','🏌🏽','🇨🇽','🇨🇾','👰🏻','🧚🏻','👰🏼','👰🏽','🧚🏼','👰🏾','👰🏿','🧚🏽','🏌🏾','🇨🇿','🧚🏾','👱🏻','🇩🇪','🧚🏿','🏌🏿','👱🏼','🇩🇬','🇩🇯','🧛🏻','👱🏽','🇩🇰','🧛🏼','🇩🇲','👱🏾','🧛🏽','🇩🇴','🇩🇿','🧛🏾','👱🏿','🇪🇦','🧛🏿','🇪🇨','👲🏻','👲🏼','👲🏽','🧜🏻','👲🏾','👲🏿','🧜🏼','👂🏻','👂🏼','🧜🏽','👳🏻','👂🏽','🧜🏾','👂🏾','👳🏼','🧜🏿','👂🏿','👃🏻','👳🏽','👃🏼','🧝🏻','👃🏽','👳🏾','🧝🏼','👃🏾','👃🏿','🧝🏽','👳🏿','👆🏻','🧝🏾','👆🏼','👴🏻','🧝🏿','👴🏼','👴🏽','👴🏾','👴🏿','👵🏻','👵🏼','👵🏽','👵🏾','👵🏿','👶🏻','👶🏼','👶🏽','👶🏾','👶🏿','👆🏽','👆🏾','👷🏻','🇸🇱','✍🏿','⛹🏻','✍🏾','✍🏽','✍🏼','✍🏻','✌🏿','✌🏾','✌🏽','✌🏼','✌🏻','✋🏿','✋🏾','✋🏽','✋🏼','✋🏻','✊🏿','✊🏾','✊🏽','✊🏼','✊🏻','⛷🏽','⛷🏾','⛹🏿','☝🏿','☝🏾','⛹🏾','☝🏽','☝🏼','⛹🏽','☝🏻','⛷🏿','⛹🏼','⛷🏻','⛷🏼','4⃣','#⃣','0⃣','1⃣','2⃣','3⃣','*⃣','5⃣','6⃣','7⃣','8⃣','9⃣','🃏','🕺','🖇','🖊','🖋','🖌','🖍','🀄','🇾','🇦','🅰','🅱','🖐','🇿','🈁','🈂','🏄','🏅','🖕','🏆','🈚','🈯','🈲','🈳','🖖','🖤','🖥','🖨','🖱','🖲','🖼','🗂','🗃','🗄','🗑','🗒','🗓','🗜','🗝','🗞','🗡','🗣','🗨','🗯','🗳','🗺','🗻','🗼','🗽','🗾','🗿','😀','😁','😂','😃','😄','😅','😆','😇','😈','😉','😊','😋','😌','😍','😎','😏','😐','😑','😒','😓','😔','😕','😖','😗','😘','😙','😚','😛','😜','😝','😞','😟','😠','😡','😢','😣','😤','😥','😦','😧','😨','😩','😪','😫','😬','😭','😮','😯','😰','😱','😲','😳','😴','😵','😶','😷','😸','😹','😺','😻','😼','😽','😾','😿','🙀','🙁','🙂','🙃','🙄','🈴','🏇','🏈','🏉','🈵','🈶','🈷','🈸','🈹','🈺','🉐','🉑','🌀','🌁','🌂','🌃','🌄','🙅','🌅','🌆','🌇','🌈','🏊','🌉','🌊','🌋','🌌','👨','🌍','🌎','🌏','🌐','🌑','🌒','🌓','🙆','🌔','🌕','🌖','🌗','🌘','🌙','🏋','🌚','🌛','🌜','🌝','🌞','🌟','🌠','🌡','🌤','🌥','🙇','🙈','🙉','🙊','🌦','🌧','🌨','🌩','🌪','🌫','🌬','🏌','🏍','🏎','🏏','🏐','🏑','🏒','🏓','🏔','🏕','🙋','🏖','🏗','🏘','🏙','🏚','🙌','🏛','🏜','🏝','🏞','🏟','🏠','🏡','🏢','🏣','🏤','🏥','🏦','🏧','🏨','🏩','🏪','🏫','🙍','🏬','🏭','🏮','🏯','🏰','🌭','🏳','🌮','🌯','🌰','🌱','🏴','🏵','🏷','🏸','🏹','🏺','🙎','🏻','🏼','🏽','🏾','🏿','🙏','🚀','🚁','🚂','🚃','🚄','🚅','🚆','🚇','🚈','🚉','🚊','🚋','🚌','🚍','🚎','🚏','🚐','🚑','🚒','🚓','🚔','🚕','🚖','🚗','🚘','🚙','🚚','🚛','🚜','🚝','🚞','🚟','🚠','🚡','🚢','🐀','🐁','🐂','🐃','🐄','🐅','🐆','🐇','🐈','🐉','🐊','🐋','🐌','🐍','🐎','🐏','🐐','🚣','🚤','🚥','🚦','🚧','🚨','🚩','🚪','🚫','🚬','🚭','🚮','🚯','🚰','🚱','🚲','🚳','🐑','🐒','🐓','🐔','🐕','🐖','🐗','🐘','🐙','🐚','🐛','🐜','🐝','🐞','🐟','🐠','🐡','🚴','🐢','🐣','🐤','🐥','🐦','🐧','🐨','🐩','🐪','🐫','🐬','🐭','🐮','🐯','🐰','🐱','🐲','🚵','🐳','🐴','🐵','👩','👪','👫','👬','👭','🐶','🐷','🐸','🐹','🐺','🐻','🐼','🐽','🐾','🚶','🚷','🚸','🚹','🚺','🚻','🚼','🚽','🚾','🚿','🐿','👀','🌲','👁','🌳','🛀','🛁','🛂','🛃','🛄','🛅','🛋','🌴','🌵','🌶','👮','🌷','🛌','🛍','🛎','🛏','🛐','🛑','🛒','🛠','🛡','🛢','🛣','🛤','🛥','🛩','🛫','🛬','🛰','🛳','🛴','🛵','🛶','🛷','🛸','🛹','🤐','🤑','🤒','🤓','🤔','🤕','🤖','🤗','👂','👯','🌸','🌹','🌺','🤘','🌻','🌼','👰','👃','👄','🤙','👅','🌽','🌾','🌿','🍀','🤚','🍁','👆','🍂','🍃','🍄','🤛','🍅','🍆','👇','🍇','🍈','🤜','🤝','👱','🍉','🍊','🍋','👈','🤞','🍌','👲','🍍','🍎','🍏','🤟','🤠','🤡','🤢','🤣','🤤','🤥','🍐','👉','🍑','🍒','🍓','🍔','🍕','👊','🍖','🍗','🍘','🍙','🍚','👋','👳','🍛','🍜','🤦','🤧','🤨','🤩','🤪','🤫','🤬','🤭','🤮','🤯','🍝','🍞','🍟','👴','👌','🤰','🍠','🍡','🍢','🍣','👵','🤱','🍤','👍','🍥','🍦','🍧','🤲','👶','🍨','🍩','👎','🍪','🤳','🍫','🍬','🍭','🍮','👏','🤴','🍯','🍰','🍱','🍲','🍳','👐','👑','👒','👷','👓','👔','👕','👖','👗','👸','👹','👺','🤵','👻','👘','👙','👚','👛','🤶','👜','👼','👽','👾','👿','💀','👝','👞','👟','👠','👡','👢','👣','👤','👥','🍴','🍵','🤷','🍶','🍷','🍸','👦','🍹','🍺','💁','🍻','🍼','🍽','👧','🍾','🍿','🎀','🎁','🎂','🎃','🤸','🎄','🇵','🅾','🇶','🇲','🅿','🎅','💂','🎆','🎇','🎈','🎉','🎊','💃','💄','🎋','🎌','🤹','🤺','🎍','🎎','🤼','🎏','💅','🎐','🎑','🎒','🎓','🎖','🎗','🎙','🎚','🎛','🎞','🎟','🎠','🎡','🎢','🎣','🤽','🎤','🎥','💆','🎦','🎧','🎨','🎩','🎪','🎫','🎬','🎭','🎮','🎯','🎰','🎱','🎲','🎳','🤾','🥀','🥁','🥂','🥃','🥄','🥅','🥇','🥈','🥉','🥊','🥋','🥌','🥍','🥎','🥏','🥐','🥑','🥒','🥓','🥔','🥕','🥖','🥗','🥘','🥙','🥚','🥛','🥜','🥝','🥞','🥟','🥠','🥡','🥢','🥣','🥤','🥥','🥦','🥧','🥨','🥩','🥪','🥫','🥬','🥭','🥮','🥯','🥰','🥳','🥴','🥵','🥶','🥺','🥼','🥽','🥾','🥿','🦀','🦁','🦂','🦃','🦄','🦅','🦆','🦇','🦈','🦉','🦊','🦋','🦌','🦍','🦎','🦏','🦐','🦑','🦒','🦓','🦔','🦕','🦖','🦗','🦘','🦙','🦚','🦛','🦜','🦝','🦞','🦟','🦠','🦡','🦢','🦴','🎴','🎵','🎶','💇','💈','🦵','💉','💊','💋','💌','💍','🦶','🦷','💎','💏','💐','💑','💒','💓','💔','💕','💖','💗','💘','💙','💚','💛','💜','💝','💞','🦸','💟','💠','💡','💢','💣','💤','💥','💦','💧','💨','💩','🎷','🎸','🎹','🎺','🎻','💪','🦹','🧀','🧁','🧂','🧐','💫','💬','💭','💮','💯','🧑','💰','💱','💲','💳','💴','🧒','💵','💶','💷','💸','💹','🧓','💺','💻','💼','💽','💾','🧔','💿','📀','📁','📂','📃','🧕','📄','📅','📆','📇','📈','📉','📊','📋','📌','📍','📎','📏','📐','📑','📒','📓','📔','🧖','📕','📖','📗','📘','📙','📚','📛','📜','📝','📞','📟','📠','📡','📢','📣','📤','📥','🧗','📦','📧','📨','📩','📪','📫','📬','📭','📮','📯','📰','📱','📲','📳','📴','📵','📶','🧘','📷','📸','📹','📺','📻','📼','📽','📿','🔀','🔁','🔂','🔃','🔄','🔅','🔆','🔇','🔈','🧙','🔉','🔊','🔋','🔌','🔍','🔎','🔏','🔐','🔑','🔒','🔓','🔔','🔕','🔖','🔗','🔘','🔙','🧚','🔚','🔛','🔜','🔝','🔞','🔟','🔠','🔡','🔢','🔣','🔤','🔥','🔦','🔧','🔨','🔩','🔪','🧛','🔫','🔬','🔭','🔮','🔯','🔰','🔱','🔲','🔳','🔴','🔵','🔶','🔷','🔸','🔹','🔺','🔻','🧜','🔼','🔽','🕉','🕊','🕋','🕌','🕍','🕎','🕐','🕑','🕒','🕓','🕔','🕕','🕖','🕗','🕘','🧝','🕙','🕚','🧞','🕛','🕜','🧟','🧠','🧡','🧢','🧣','🧤','🧥','🧦','🧧','🧨','🧩','🧪','🧫','🧬','🧭','🧮','🧯','🧰','🧱','🧲','🧳','🧴','🧵','🧶','🧷','🧸','🧹','🧺','🧻','🧼','🧽','🧾','🧿','🕝','🕞','🕟','🕠','🕡','🕢','🕣','🕤','🕥','🕦','🕧','🕯','🕰','🕳','🎼','🎽','🎾','🎿','🏀','🏁','🇧','🇮','🇪','🇷','🇱','🏂','🆎','🆑','🇨','🇹','🇯','🕴','🆒','🇬','🆓','🇳','🆔','🇴','🇺','🇫','🆕','🆖','🆗','🇭','🏃','🆘','🇩','🇻','🇰','🕵','🕶','🕷','🕸','🕹','🆙','🇼','🆚','🇽','🇸','▫','☦','☮','☯','☸','☹','☺','♀','♂','♈','♉','♊','♋','♌','♍','♎','♏','♐','♑','♒','♓','♟','♠','♣','♥','♦','♨','♻','♾','♿','⚒','⚓','⚔','⚕','⚖','⚗','⚙','⚛','⚜','⚠','⚡','⚪','⚫','⚰','⚱','⚽','⚾','⛄','⛅','⛈','⛎','⛏','⛑','⛓','⛔','⛩','⛪','⛰','⛱','⛲','⛳','⛴','⛵','☣','☢','☠','☝','☘','⛷','⛸','☕','☔','☑','☎','☄','☃','☂','☁','☀','◾','◽','◼','◻','◀','▶','☪','▪','⛹','⛺','⛽','✂','✅','✈','✉','Ⓜ','⏺','⏹','⏸','⏳','✊','⏲','⏱','⏰','⏯','⏮','✋','⏭','⏬','⏫','⏪','⏩','✌','⏏','⌨','⌛','⌚','↪','✍','✏','✒','✔','✖','✝','✡','✨','✳','✴','❄','❇','❌','❎','❓','❔','❕','❗','❣','❤','➕','➖','➗','➡','➰','➿','⤴','⤵','↩','⬅','⬆','⬇','⬛','⬜','⭐','⭕','↙','〰','〽','↘','↗','㊗','㊙','↖','↕','↔','ℹ','™','⁉','‼','');
+ $partials = array('🀄','🃏','🅰','🅱','🅾','🅿','🆎','🆑','🆒','🆓','🆔','🆕','🆖','🆗','🆘','🆙','🆚','🇦','🇨','🇩','🇪','🇫','🇬','🇮','🇱','🇲','🇴','🇶','🇷','🇸','🇹','🇺','🇼','🇽','🇿','🇧','🇭','🇯','🇳','🇻','🇾','🇰','🇵','🈁','🈂','🈚','🈯','🈲','🈳','🈴','🈵','🈶','🈷','🈸','🈹','🈺','🉐','🉑','🌀','🌁','🌂','🌃','🌄','🌅','🌆','🌇','🌈','🌉','🌊','🌋','🌌','🌍','🌎','🌏','🌐','🌑','🌒','🌓','🌔','🌕','🌖','🌗','🌘','🌙','🌚','🌛','🌜','🌝','🌞','🌟','🌠','🌡','🌤','🌥','🌦','🌧','🌨','🌩','🌪','🌫','🌬','🌭','🌮','🌯','🌰','🌱','🌲','🌳','🌴','🌵','🌶','🌷','🌸','🌹','🌺','🌻','🌼','🌽','🌾','🌿','🍀','🍁','🍂','🍃','🍄','🍅','🍆','🍇','🍈','🍉','🍊','🍋','🍌','🍍','🍎','🍏','🍐','🍑','🍒','🍓','🍔','🍕','🍖','🍗','🍘','🍙','🍚','🍛','🍜','🍝','🍞','🍟','🍠','🍡','🍢','🍣','🍤','🍥','🍦','🍧','🍨','🍩','🍪','🍫','🍬','🍭','🍮','🍯','🍰','🍱','🍲','🍳','🍴','🍵','🍶','🍷','🍸','🍹','🍺','🍻','🍼','🍽','🍾','🍿','🎀','🎁','🎂','🎃','🎄','🎅','🏻','🏼','🏽','🏾','🏿','🎆','🎇','🎈','🎉','🎊','🎋','🎌','🎍','🎎','🎏','🎐','🎑','🎒','🎓','🎖','🎗','🎙','🎚','🎛','🎞','🎟','🎠','🎡','🎢','🎣','🎤','🎥','🎦','🎧','🎨','🎩','🎪','🎫','🎬','🎭','🎮','🎯','🎰','🎱','🎲','🎳','🎴','🎵','🎶','🎷','🎸','🎹','🎺','🎻','🎼','🎽','🎾','🎿','🏀','🏁','🏂','🏃','','♀','️','♂','🏄','🏅','🏆','🏇','🏈','🏉','🏊','🏋','🏌','🏍','🏎','🏏','🏐','🏑','🏒','🏓','🏔','🏕','🏖','🏗','🏘','🏙','🏚','🏛','🏜','🏝','🏞','🏟','🏠','🏡','🏢','🏣','🏤','🏥','🏦','🏧','🏨','🏩','🏪','🏫','🏬','🏭','🏮','🏯','🏰','🏳','🏴','☠','','','','','','','','','','','🏵','🏷','🏸','🏹','🏺','🐀','🐁','🐂','🐃','🐄','🐅','🐆','🐇','🐈','🐉','🐊','🐋','🐌','🐍','🐎','🐏','🐐','🐑','🐒','🐓','🐔','🐕','🐖','🐗','🐘','🐙','🐚','🐛','🐜','🐝','🐞','🐟','🐠','🐡','🐢','🐣','🐤','🐥','🐦','🐧','🐨','🐩','🐪','🐫','🐬','🐭','🐮','🐯','🐰','🐱','🐲','🐳','🐴','🐵','🐶','🐷','🐸','🐹','🐺','🐻','🐼','🐽','🐾','🐿','👀','👁','🗨','👂','👃','👄','👅','👆','👇','👈','👉','👊','👋','👌','👍','👎','👏','👐','👑','👒','👓','👔','👕','👖','👗','👘','👙','👚','👛','👜','👝','👞','👟','👠','👡','👢','👣','👤','👥','👦','👧','👨','💻','💼','🔧','🔬','🚀','🚒','🦰','🦱','🦲','🦳','⚕','⚖','✈','👩','❤','💋','👪','👫','👬','👭','👮','👯','👰','👱','👲','👳','👴','👵','👶','👷','👸','👹','👺','👻','👼','👽','👾','👿','💀','💁','💂','💃','💄','💅','💆','💇','💈','💉','💊','💌','💍','💎','💏','💐','💑','💒','💓','💔','💕','💖','💗','💘','💙','💚','💛','💜','💝','💞','💟','💠','💡','💢','💣','💤','💥','💦','💧','💨','💩','💪','💫','💬','💭','💮','💯','💰','💱','💲','💳','💴','💵','💶','💷','💸','💹','💺','💽','💾','💿','📀','📁','📂','📃','📄','📅','📆','📇','📈','📉','📊','📋','📌','📍','📎','📏','📐','📑','📒','📓','📔','📕','📖','📗','📘','📙','📚','📛','📜','📝','📞','📟','📠','📡','📢','📣','📤','📥','📦','📧','📨','📩','📪','📫','📬','📭','📮','📯','📰','📱','📲','📳','📴','📵','📶','📷','📸','📹','📺','📻','📼','📽','📿','🔀','🔁','🔂','🔃','🔄','🔅','🔆','🔇','🔈','🔉','🔊','🔋','🔌','🔍','🔎','🔏','🔐','🔑','🔒','🔓','🔔','🔕','🔖','🔗','🔘','🔙','🔚','🔛','🔜','🔝','🔞','🔟','🔠','🔡','🔢','🔣','🔤','🔥','🔦','🔨','🔩','🔪','🔫','🔭','🔮','🔯','🔰','🔱','🔲','🔳','🔴','🔵','🔶','🔷','🔸','🔹','🔺','🔻','🔼','🔽','🕉','🕊','🕋','🕌','🕍','🕎','🕐','🕑','🕒','🕓','🕔','🕕','🕖','🕗','🕘','🕙','🕚','🕛','🕜','🕝','🕞','🕟','🕠','🕡','🕢','🕣','🕤','🕥','🕦','🕧','🕯','🕰','🕳','🕴','🕵','🕶','🕷','🕸','🕹','🕺','🖇','🖊','🖋','🖌','🖍','🖐','🖕','🖖','🖤','🖥','🖨','🖱','🖲','🖼','🗂','🗃','🗄','🗑','🗒','🗓','🗜','🗝','🗞','🗡','🗣','🗯','🗳','🗺','🗻','🗼','🗽','🗾','🗿','😀','😁','😂','😃','😄','😅','😆','😇','😈','😉','😊','😋','😌','😍','😎','😏','😐','😑','😒','😓','😔','😕','😖','😗','😘','😙','😚','😛','😜','😝','😞','😟','😠','😡','😢','😣','😤','😥','😦','😧','😨','😩','😪','😫','😬','😭','😮','😯','😰','😱','😲','😳','😴','😵','😶','😷','😸','😹','😺','😻','😼','😽','😾','😿','🙀','🙁','🙂','🙃','🙄','🙅','🙆','🙇','🙈','🙉','🙊','🙋','🙌','🙍','🙎','🙏','🚁','🚂','🚃','🚄','🚅','🚆','🚇','🚈','🚉','🚊','🚋','🚌','🚍','🚎','🚏','🚐','🚑','🚓','🚔','🚕','🚖','🚗','🚘','🚙','🚚','🚛','🚜','🚝','🚞','🚟','🚠','🚡','🚢','🚣','🚤','🚥','🚦','🚧','🚨','🚩','🚪','🚫','🚬','🚭','🚮','🚯','🚰','🚱','🚲','🚳','🚴','🚵','🚶','🚷','🚸','🚹','🚺','🚻','🚼','🚽','🚾','🚿','🛀','🛁','🛂','🛃','🛄','🛅','🛋','🛌','🛍','🛎','🛏','🛐','🛑','🛒','🛠','🛡','🛢','🛣','🛤','🛥','🛩','🛫','🛬','🛰','🛳','🛴','🛵','🛶','🛷','🛸','🛹','🤐','🤑','🤒','🤓','🤔','🤕','🤖','🤗','🤘','🤙','🤚','🤛','🤜','🤝','🤞','🤟','🤠','🤡','🤢','🤣','🤤','🤥','🤦','🤧','🤨','🤩','🤪','🤫','🤬','🤭','🤮','🤯','🤰','🤱','🤲','🤳','🤴','🤵','🤶','🤷','🤸','🤹','🤺','🤼','🤽','🤾','🥀','🥁','🥂','🥃','🥄','🥅','🥇','🥈','🥉','🥊','🥋','🥌','🥍','🥎','🥏','🥐','🥑','🥒','🥓','🥔','🥕','🥖','🥗','🥘','🥙','🥚','🥛','🥜','🥝','🥞','🥟','🥠','🥡','🥢','🥣','🥤','🥥','🥦','🥧','🥨','🥩','🥪','🥫','🥬','🥭','🥮','🥯','🥰','🥳','🥴','🥵','🥶','🥺','🥼','🥽','🥾','🥿','🦀','🦁','🦂','🦃','🦄','🦅','🦆','🦇','🦈','🦉','🦊','🦋','🦌','🦍','🦎','🦏','🦐','🦑','🦒','🦓','🦔','🦕','🦖','🦗','🦘','🦙','🦚','🦛','🦜','🦝','🦞','🦟','🦠','🦡','🦢','🦴','🦵','🦶','🦷','🦸','🦹','🧀','🧁','🧂','🧐','🧑','🧒','🧓','🧔','🧕','🧖','🧗','🧘','🧙','🧚','🧛','🧜','🧝','🧞','🧟','🧠','🧡','🧢','🧣','🧤','🧥','🧦','🧧','🧨','🧩','🧪','🧫','🧬','🧭','🧮','🧯','🧰','🧱','🧲','🧳','🧴','🧵','🧶','🧷','🧸','🧹','🧺','🧻','🧼','🧽','🧾','🧿','‼','⁉','™','ℹ','↔','↕','↖','↗','↘','↙','↩','↪','⃣','⌚','⌛','⌨','⏏','⏩','⏪','⏫','⏬','⏭','⏮','⏯','⏰','⏱','⏲','⏳','⏸','⏹','⏺','Ⓜ','▪','▫','▶','◀','◻','◼','◽','◾','☀','☁','☂','☃','☄','☎','☑','☔','☕','☘','☝','☢','☣','☦','☪','☮','☯','☸','☹','☺','♈','♉','♊','♋','♌','♍','♎','♏','♐','♑','♒','♓','♟','♠','♣','♥','♦','♨','♻','♾','♿','⚒','⚓','⚔','⚗','⚙','⚛','⚜','⚠','⚡','⚪','⚫','⚰','⚱','⚽','⚾','⛄','⛅','⛈','⛎','⛏','⛑','⛓','⛔','⛩','⛪','⛰','⛱','⛲','⛳','⛴','⛵','⛷','⛸','⛹','⛺','⛽','✂','✅','✉','✊','✋','✌','✍','✏','✒','✔','✖','✝','✡','✨','✳','✴','❄','❇','❌','❎','❓','❔','❕','❗','❣','➕','➖','➗','➡','➰','➿','⤴','⤵','⬅','⬆','⬇','⬛','⬜','⭐','⭕','〰','〽','㊗','㊙','');
+ // END: emoji arrays
+
+ if ( 'entities' === $type ) {
+ return $entities;
+ }
+
+ return $partials;
+}
+
+/**
+ * Shorten a URL, to be used as link text.
+ *
+ * @since 1.2.0
+ * @since 4.4.0 Moved to wp-includes/formatting.php from wp-admin/includes/misc.php and added $length param.
+ *
+ * @param string $url URL to shorten.
+ * @param int $length Optional. Maximum length of the shortened URL. Default 35 characters.
+ * @return string Shortened URL.
+ */
+function url_shorten( $url, $length = 35 ) {
+ $stripped = str_replace( array( 'https://', 'http://', 'www.' ), '', $url );
+ $short_url = untrailingslashit( $stripped );
+
+ if ( strlen( $short_url ) > $length ) {
+ $short_url = substr( $short_url, 0, $length - 3 ) . '…';
+ }
+ return $short_url;
+}
+
+/**
+ * Sanitizes a hex color.
+ *
+ * Returns either '', a 3 or 6 digit hex color (with #), or nothing.
+ * For sanitizing values without a #, see sanitize_hex_color_no_hash().
+ *
+ * @since 3.4.0
+ *
+ * @param string $color
+ * @return string|void
+ */
+function sanitize_hex_color( $color ) {
+ if ( '' === $color ) {
+ return '';
+ }
+
+ // 3 or 6 hex digits, or the empty string.
+ if ( preg_match('|^#([A-Fa-f0-9]{3}){1,2}$|', $color ) ) {
+ return $color;
+ }
+}
+
+/**
+ * Sanitizes a hex color without a hash. Use sanitize_hex_color() when possible.
+ *
+ * Saving hex colors without a hash puts the burden of adding the hash on the
+ * UI, which makes it difficult to use or upgrade to other color types such as
+ * rgba, hsl, rgb, and html color names.
+ *
+ * Returns either '', a 3 or 6 digit hex color (without a #), or null.
+ *
+ * @since 3.4.0
+ *
+ * @param string $color
+ * @return string|null
+ */
+function sanitize_hex_color_no_hash( $color ) {
+ $color = ltrim( $color, '#' );
+
+ if ( '' === $color ) {
+ return '';
+ }
+
+ return sanitize_hex_color( '#' . $color ) ? $color : null;
+}
+
+/**
+ * Ensures that any hex color is properly hashed.
+ * Otherwise, returns value untouched.
+ *
+ * This method should only be necessary if using sanitize_hex_color_no_hash().
+ *
+ * @since 3.4.0
+ *
+ * @param string $color
+ * @return string
+ */
+function maybe_hash_hex_color( $color ) {
+ if ( $unhashed = sanitize_hex_color_no_hash( $color ) ) {
+ return '#' . $unhashed;
+ }
+
+ return $color;
+}