mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-05 16:08:12 +01:00
git-svn-id: http://svn.automattic.com/wordpress/trunk@4360 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
fce38c2c1f
commit
e710ff1a29
@ -618,14 +618,7 @@ function convert_smilies($text) {
|
|||||||
if (get_option('use_smilies')) {
|
if (get_option('use_smilies')) {
|
||||||
// HTML loop taken from texturize function, could possible be consolidated
|
// HTML loop taken from texturize function, could possible be consolidated
|
||||||
$textarr = preg_split("/(<.*>)/U", $text, -1, PREG_SPLIT_DELIM_CAPTURE); // capture the tags as well as in between
|
$textarr = preg_split("/(<.*>)/U", $text, -1, PREG_SPLIT_DELIM_CAPTURE); // capture the tags as well as in between
|
||||||
$stop = count($textarr);// loop stuff
|
$output = implode('', preg_replace($wp_smiliessearch, $wp_smiliesreplace, $textarr));
|
||||||
for ($i = 0; $i < $stop; $i++) {
|
|
||||||
$content = $textarr[$i];
|
|
||||||
if ((strlen($content) > 0) && ('<' != $content{0})) { // If it's not a tag
|
|
||||||
$content = preg_replace($wp_smiliessearch, $wp_smiliesreplace, $content);
|
|
||||||
}
|
|
||||||
$output .= $content;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
// return default text.
|
// return default text.
|
||||||
$output = $text;
|
$output = $text;
|
||||||
|
@ -87,7 +87,7 @@ if (!isset($wpsmiliestrans)) {
|
|||||||
|
|
||||||
// generates smilies' search & replace arrays
|
// generates smilies' search & replace arrays
|
||||||
foreach($wpsmiliestrans as $smiley => $img) {
|
foreach($wpsmiliestrans as $smiley => $img) {
|
||||||
$wp_smiliessearch[] = '/(\s|^)?'.preg_quote($smiley, '/').'(\b|\s)/';
|
$wp_smiliessearch[] = '/(\s|^|[^<])?'.preg_quote($smiley, '/').'(\b|\s|$)/';
|
||||||
$smiley_masked = htmlspecialchars( trim($smiley) , ENT_QUOTES);
|
$smiley_masked = htmlspecialchars( trim($smiley) , ENT_QUOTES);
|
||||||
$wp_smiliesreplace[] = " <img src='" . get_option('siteurl') . "/wp-includes/images/smilies/$img' alt='$smiley_masked' class='wp-smiley' /> ";
|
$wp_smiliesreplace[] = " <img src='" . get_option('siteurl') . "/wp-includes/images/smilies/$img' alt='$smiley_masked' class='wp-smiley' /> ";
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user