File tree Expand file tree Collapse file tree 1 file changed +16
-1
lines changed
Expand file tree Collapse file tree 1 file changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -1089,7 +1089,7 @@ function parse_signature($text)
10891089//
10901090function sva_do_for_only_text ($ text , $ do_smilies )
10911091{
1092- if (! $ do_smilies || '' === $ text )
1092+ if ('' === $ text )
10931093 return $ text ;
10941094
10951095 if (false === strpos ($ text , '< ' ))
@@ -1102,10 +1102,25 @@ function sva_do_for_only_text($text, $do_smilies)
11021102 if ('< ' === $ cur [0 ])
11031103 continue ;
11041104
1105+ $ cur = preg_replace_callback ('%:[\w\-+]++:% ' , 'sva_do_emoji ' , $ cur );
1106+
11051107 if ($ do_smilies )
11061108 $ cur = do_smilies ($ cur );
11071109 }
11081110 unset($ cur );
11091111
11101112 return implode ('' , $ arr );
11111113}
1114+
1115+ //
1116+ // Обработчик emoji
1117+ //
1118+ function sva_do_emoji ($ matches )
1119+ {
1120+ static $ emoji ;
1121+
1122+ if (! isset ($ emoji ))
1123+ $ emoji = include PUN_ROOT .'include/emoji.inc.php ' ;
1124+
1125+ return $ emoji [substr ($ matches [0 ], 1 , -1 )] ?? $ matches [0 ];
1126+ }
You can’t perform that action at this time.
0 commit comments