mirror of
https://github.com/e107inc/e107.git
synced 2025-08-19 04:41:53 +02:00
Don't allow selection of emote without substitution string
This commit is contained in:
@@ -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,17 +36,20 @@ 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;
|
||||
|
||||
$filename = e_IMAGE."emotes/" . $pref['emotepack'] . "/" . $key;
|
||||
$fileloc = SITEURLBASE.e_IMAGE_ABS."emotes/" . $pref['emotepack'] . "/" . $key;
|
||||
|
||||
if(file_exists($filename))
|
||||
{
|
||||
if(file_exists($filename))
|
||||
{
|
||||
if(strstr($value, " "))
|
||||
{
|
||||
$tmp = explode(" ", $value);
|
||||
@@ -69,7 +72,12 @@ class e_emotefilter {
|
||||
$this->replace[] = "\n <img src='".$filename."' alt='' style='vertical-align:middle; border:0' /> ";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
unset($this->emotes[$key]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user