1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-19 12:51:52 +02:00

Don't allow selection of emote without substitution string

This commit is contained in:
e107steved
2007-05-25 21:47:19 +00:00
parent 734933399e
commit 9295ce93bc

View File

@@ -11,9 +11,9 @@
| GNU General Public License (http://gnu.org).
|
| $Source: /cvs_backup/e107_0.8/e107_handlers/emote_filter.php,v $
| $Revision: 1.1.1.1 $
| $Date: 2006-12-02 04:33:44 $
| $Author: mcfly_e107 $
| $Revision: 1.2 $
| $Date: 2007-05-25 21:47:13 $
| $Author: e107steved $
+----------------------------------------------------------------------------+
*/
@@ -36,12 +36,15 @@ class e_emotefilter {
foreach($this->emotes as $key => $value)
{
$value = trim($value);
if ($value)
{ // Only 'activate' emote if there's a substitution string set
$key = preg_replace("#!(\w{3,}?)$#si", ".\\1", $key);
// Next two probably to sort out legacy issues - may not be required any more
$key = preg_replace("#_(\w{3})$#", ".\\1", $key);
$key = str_replace("!", "_", $key);
$value = trim($value);
$filename = e_IMAGE."emotes/" . $pref['emotepack'] . "/" . $key;
$fileloc = SITEURLBASE.e_IMAGE_ABS."emotes/" . $pref['emotepack'] . "/" . $key;
@@ -71,6 +74,11 @@ class e_emotefilter {
}
}
}
else
{
unset($this->emotes[$key]);
}
}
}
function filterEmotes($text)