mirror of
https://github.com/e107inc/e107.git
synced 2025-08-06 22:57:14 +02:00
Fixes #1621 : Emoticons fix for codes using | char.
This commit is contained in:
@@ -664,8 +664,15 @@ class emotec
|
|||||||
{
|
{
|
||||||
foreach ($pack_local as $p => $d)
|
foreach ($pack_local as $p => $d)
|
||||||
{
|
{
|
||||||
$mes->addInfo(EMOLAN_34.":".$p.EMOLAN_35);
|
if($p == '0')
|
||||||
$sql->db_Delete("core","`e107_name` = 'emote_{$p}'");
|
{
|
||||||
|
$p = '';
|
||||||
|
}
|
||||||
|
|
||||||
|
if($sql->delete("core","`e107_name` = 'emote_{$p}'"))
|
||||||
|
{
|
||||||
|
$mes->addInfo(EMOLAN_34.":".$p.EMOLAN_35);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -4650,7 +4650,7 @@ class e_emotefilter
|
|||||||
|
|
||||||
$key = preg_replace("#!(\w{3,}?)$#si", ".\\1", $key);
|
$key = preg_replace("#!(\w{3,}?)$#si", ".\\1", $key);
|
||||||
// Next two probably to sort out legacy issues - may not be required any more
|
// Next two probably to sort out legacy issues - may not be required any more
|
||||||
// $key = preg_replace("#_(\w{3})$#", ".\\1", $key);
|
$key = preg_replace("#_(\w{3})$#", ".\\1", $key);
|
||||||
|
|
||||||
$key = str_replace("!", "_", $key);
|
$key = str_replace("!", "_", $key);
|
||||||
|
|
||||||
@@ -4666,7 +4666,7 @@ class e_emotefilter
|
|||||||
foreach($tmp as $code)
|
foreach($tmp as $code)
|
||||||
{
|
{
|
||||||
$img = "<img class='e-emoticon' src='".$fileloc."' alt=\"".$alt."\" />";
|
$img = "<img class='e-emoticon' src='".$fileloc."' alt=\"".$alt."\" />";
|
||||||
$this->regSearch[] = "/(^|[\s>])(".quotemeta($code).")($|[\s<])/";
|
$this->regSearch[] = "#(^|[\s>])(".$this->buildRegex($code).")($|[\s<])#";
|
||||||
$this->regReplace[] ="$1".$img."$3";
|
$this->regReplace[] ="$1".$img."$3";
|
||||||
$this->search[] = $code;
|
$this->search[] = $code;
|
||||||
$this->replace[] = $img;
|
$this->replace[] = $img;
|
||||||
@@ -4708,9 +4708,19 @@ class e_emotefilter
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// print_a($this->regSearch);
|
||||||
|
// print_a($this->regReplace);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function buildRegex($code)
|
||||||
|
{
|
||||||
|
|
||||||
|
$code = quotemeta($code);
|
||||||
|
$code = str_replace('|','\|',$code);
|
||||||
|
return $code;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
function filterEmotes($text)
|
function filterEmotes($text)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user