aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2014-09-08 21:36:33 -0700
committerfriendica <info@friendica.com>2014-09-08 21:36:33 -0700
commite4e9098f391e92fa95d0abeed6c90b651b579370 (patch)
treec9cbcbe65f5d80606431004816623a78df262ba4
parentb7c1ad8cb2d50da98d38166500c83e17c611e163 (diff)
downloadvolse-hubzilla-e4e9098f391e92fa95d0abeed6c90b651b579370.tar.gz
volse-hubzilla-e4e9098f391e92fa95d0abeed6c90b651b579370.tar.bz2
volse-hubzilla-e4e9098f391e92fa95d0abeed6c90b651b579370.zip
prevent red#matrix smilie replacements from tripping over each other.
-rw-r--r--include/text.php5
1 files changed, 3 insertions, 2 deletions
diff --git a/include/text.php b/include/text.php
index 097b02bbc..599c5d445 100644
--- a/include/text.php
+++ b/include/text.php
@@ -972,6 +972,7 @@ function smilies($s, $sample = false) {
|| (local_user() && intval(get_pconfig(local_user(),'system','no_smilies'))))
return $s;
+
$s = preg_replace_callback('{<(pre|code)>.*?</\1>}ism','smile_shield',$s);
$s = preg_replace_callback('/<[a-z]+ .*?>/ism','smile_shield',$s);
@@ -1046,8 +1047,8 @@ function smilies($s, $sample = false) {
'<img class="smiley" src="' . $a->get_baseurl() . '/images/smiley-facepalm.gif" alt=":facepalm" />',
'<img class="smiley" src="' . $a->get_baseurl() . '/images/like.gif" alt=":like" />',
'<img class="smiley" src="' . $a->get_baseurl() . '/images/dislike.gif" alt=":dislike" />',
- '<a href="http://getzot.com"><strong>red<img class="smiley" src="' . $a->get_baseurl() . '/images/rm-16.png" alt="red#matrix" />matrix</strong></a>',
- '<a href="http://getzot.com"><strong>red<img class="smiley" src="' . $a->get_baseurl() . '/images/rm-16.png" alt="red#" />matrix</strong></a>',
+ '<a href="http://getzot.com"><strong>red<img class="smiley" src="' . $a->get_baseurl() . '/images/rm-16.png" alt="' . urlencode('red#matrix') . '" />matrix</strong></a>',
+ '<a href="http://getzot.com"><strong>red<img class="smiley" src="' . $a->get_baseurl() . '/images/rm-16.png" alt="' . urlencode('red#') . '" />matrix</strong></a>',
'<a href="http://getzot.com"><strong>red<img class="smiley" src="' . $a->get_baseurl() . '/images/rm-16.png" alt="r#" />matrix</strong></a>'
);