diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php
index 8aa6ad721d..a36129767f 100644
--- a/wp-includes/formatting.php
+++ b/wp-includes/formatting.php
@@ -1912,7 +1912,7 @@ function translate_smiley( $matches ) {
*/
$src_url = apply_filters( 'smilies_src', includes_url( "images/smilies/$img" ), $img, site_url() );
- return sprintf( ' ', esc_url( $src_url ), esc_attr( $smiley ) );
+ return sprintf( '', esc_url( $src_url ), esc_attr( $smiley ) );
}
/**
diff --git a/wp-includes/functions.php b/wp-includes/functions.php
index c62036f7e8..db399cf1e6 100644
--- a/wp-includes/functions.php
+++ b/wp-includes/functions.php
@@ -2713,7 +2713,10 @@ function smilies_init() {
*/
krsort($wpsmiliestrans);
- $wp_smiliessearch = '/((?:\s|^)';
+ $spaces = wp_spaces_regexp();
+
+ // Begin first "subpattern"
+ $wp_smiliessearch = '/(?<=' . $spaces . '|^)';
$subchar = '';
foreach ( (array) $wpsmiliestrans as $smiley => $img ) {
@@ -2723,7 +2726,8 @@ function smilies_init() {
// new subpattern?
if ($firstchar != $subchar) {
if ($subchar != '') {
- $wp_smiliessearch .= ')(?=\s|$))|((?:\s|^)'; ;
+ $wp_smiliessearch .= ')(?=' . $spaces . '|$)'; // End previous "subpattern"
+ $wp_smiliessearch .= '|(?<=' . $spaces . '|^)'; // Begin another "subpattern"
}
$subchar = $firstchar;
$wp_smiliessearch .= preg_quote($firstchar, '/') . '(?:';
@@ -2733,7 +2737,7 @@ function smilies_init() {
$wp_smiliessearch .= preg_quote($rest, '/');
}
- $wp_smiliessearch .= ')(?=\s|$))/m';
+ $wp_smiliessearch .= ')(?=' . $spaces . '|$)/m';
}
@@ -4419,4 +4423,4 @@ function wp_validate_boolean( $var ) {
}
return (bool) $var;
-}
\ No newline at end of file
+}