mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-06-28 14:20:15 +00:00
Don't place smilies inside of pre or code tags. Don't skip smilie after a smilie with an 8 in it. Fix regular expression used for smiley translations to work when there is only one registered emoticon.
Props solarissmoke, soulseekah, mdbitz, yonasy. ht to mdbitz for the Unit Tests and a comprehensive patch. Fixes #16448, #20124, #25303. git-svn-id: https://develop.svn.wordpress.org/trunk@26191 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -2477,6 +2477,7 @@ function _mce_set_direction( $input ) {
|
||||
return $input;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Convert smiley code to the icon graphic file equivalent.
|
||||
*
|
||||
@@ -2566,7 +2567,7 @@ function smilies_init() {
|
||||
*/
|
||||
krsort($wpsmiliestrans);
|
||||
|
||||
$wp_smiliessearch = '/(?:\s|^)';
|
||||
$wp_smiliessearch = '/((?:\s|^)';
|
||||
|
||||
$subchar = '';
|
||||
foreach ( (array) $wpsmiliestrans as $smiley => $img ) {
|
||||
@@ -2576,7 +2577,7 @@ function smilies_init() {
|
||||
// new subpattern?
|
||||
if ($firstchar != $subchar) {
|
||||
if ($subchar != '') {
|
||||
$wp_smiliessearch .= ')|(?:\s|^)';
|
||||
$wp_smiliessearch .= ')(?=\s|$))|((?:\s|^)'; ;
|
||||
}
|
||||
$subchar = $firstchar;
|
||||
$wp_smiliessearch .= preg_quote($firstchar, '/') . '(?:';
|
||||
@@ -2586,7 +2587,8 @@ function smilies_init() {
|
||||
$wp_smiliessearch .= preg_quote($rest, '/');
|
||||
}
|
||||
|
||||
$wp_smiliessearch .= ')(?:\s|$)/m';
|
||||
$wp_smiliessearch .= ')(?=\s|$))/m';
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user