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:
Scott Taylor
2013-11-15 02:45:39 +00:00
parent e7fc90c34e
commit 15c1c2f130
3 changed files with 275 additions and 61 deletions

View File

@@ -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';
}
/**