Firefox PHP

Allowing Emojis?

Posted by Brummie 
Allowing Emojis?
September 12, 2016 04:05PM
I'm trying to get emojis to work but for some reason the character is being removed when submitted to the database. Any ideas?
Re: Allowing Emojis?
September 13, 2016 04:42AM
Hi Brummie,

you are using the Smileys Module?

Regards
Oliver


Using Phorum since 7/2000: forum.langzeittest.de (actual version 5.2.23)
Modules "Made in Germany" for version 5.2: Author_as_Sender, CarCost, Close_Topic, Conceal_Message_Timestamp,
Format_Email, Index_Structure, Mailing_List, Pervasive_Forum, Spritmonitor, Terms_of_Service and German_Language_Files_Package.
Re: Allowing Emojis?
September 13, 2016 05:27AM
Yes but it doesn't show emojis?
Re: Allowing Emojis?
September 13, 2016 05:39AM
Hi Brummie,

please check path value in the module settings.

Can you provide a link to a post which should include Smileys?

Regards
Oliver


Using Phorum since 7/2000: forum.langzeittest.de (actual version 5.2.23)
Modules "Made in Germany" for version 5.2: Author_as_Sender, CarCost, Close_Topic, Conceal_Message_Timestamp,
Format_Email, Index_Structure, Mailing_List, Pervasive_Forum, Spritmonitor, Terms_of_Service and German_Language_Files_Package.
Re: Allowing Emojis?
September 13, 2016 08:28AM
Smileys work... Emojis from iOS etc, don't?
Re: Allowing Emojis?
September 13, 2016 08:30AM
Hi Brummie,

the Smileys Module simply replaces text smileys by html image tag...

You can add your own smiley definitions in the module settings.

Regards
Oliver


Using Phorum since 7/2000: forum.langzeittest.de (actual version 5.2.23)
Modules "Made in Germany" for version 5.2: Author_as_Sender, CarCost, Close_Topic, Conceal_Message_Timestamp,
Format_Email, Index_Structure, Mailing_List, Pervasive_Forum, Spritmonitor, Terms_of_Service and German_Language_Files_Package.
Re: Allowing Emojis?
September 13, 2016 08:34AM
I think it may be down to the character set though? See here for example
Re: Allowing Emojis?
September 13, 2016 08:38AM
The character(s) is|are stripped so that injectable code does not get into the database.
I did not test allowing html in the message body, you could try this. (change in the admin I believe)

One of the smilies doesn't work either.
Several years ago I spent several hours looking at this, and decided to leave it alone due to the amount of testing required to verify that code could not be injected.
Re: Allowing Emojis?
September 13, 2016 08:51AM
I've gone through format_functions.php where it seems to format the body before it's inserted, however can't seem to narrow it down. I found this line however:

Language: PHP
$escaped_body = htmlspecialchars($body, ENT_COMPAT, $PHORUM["DATA"]["HCHARSET"]);

And wondered whether there is a character set that is explicitly supplied in the $PHORUM array... However I have no idea where that is stored.
Re: Allowing Emojis?
September 13, 2016 08:54AM
Quote
Brummie
However I have no idea where that is stored.

In the language file: [github.com]


Using Phorum since 7/2000: forum.langzeittest.de (actual version 5.2.23)
Modules "Made in Germany" for version 5.2: Author_as_Sender, CarCost, Close_Topic, Conceal_Message_Timestamp,
Format_Email, Index_Structure, Mailing_List, Pervasive_Forum, Spritmonitor, Terms_of_Service and German_Language_Files_Package.
Re: Allowing Emojis?
September 13, 2016 09:07AM
Warning: htmlspecialchars(): charset `utf8mb4_general_ci' not supported, assuming iso-8859-1 in common.php on line 750
Warning: htmlspecialchars(): charset `utf8mb4_general_ci' not supported, assuming iso-8859-1 in format_functions.php on line 156
Warning: htmlspecialchars(): charset `utf8mb4_general_ci' not supported, assuming iso-8859-1 in format_functions.php on line 158
Warning: htmlspecialchars(): charset `utf8mb4_general_ci' not supported, assuming iso-8859-1 in format_functions.php on line 174
Warning: htmlspecialchars(): charset `utf8mb4_general_ci' not supported, assuming iso-8859-1 in api/user.php on line 1488
Warning: htmlspecialchars(): charset `utf8mb4_general_ci' not supported, assuming iso-8859-1 in api/user.php on line 1488
Warning: htmlspecialchars(): charset `utf8mb4_general_ci' not supported, assuming iso-8859-1 in api/user.php on line 1488
Warning: htmlspecialchars(): charset `utf8mb4_general_ci' not supported, assuming iso-8859-1 in api/user.php on line 1488
Warning: htmlspecialchars(): charset `utf8mb4_general_ci' not supported, assuming iso-8859-1 in api/user.php on line 1488
Warning: htmlspecialchars(): charset `utf8mb4_general_ci' not supported, assuming iso-8859-1 in format_functions.php on line 156
Warning: htmlspecialchars(): charset `utf8mb4_general_ci' not supported, assuming iso-8859-1 in format_functions.php on line 158
Warning: htmlspecialchars(): charset `utf8mb4_general_ci' not supported, assuming iso-8859-1 in format_functions.php on line 174
Warning: htmlspecialchars(): charset `utf8mb4_general_ci' not supported, assuming iso-8859-1 in format_functions.php on line 174
Warning: htmlspecialchars(): charset `utf8mb4_general_ci' not supported, assuming iso-8859-1 in format_functions.php on line 156
Warning: htmlspecialchars(): charset `utf8mb4_general_ci' not supported, assuming iso-8859-1 in format_functions.php on line 158
Warning: htmlspecialchars(): charset `utf8mb4_general_ci' not supported, assuming iso-8859-1 in format_functions.php on line 174
Warning: htmlspecialchars(): charset `utf8mb4_general_ci' not supported, assuming iso-8859-1 in format_functions.php on line 174
Warning: htmlspecialchars(): charset `utf8mb4_general_ci' not supported, assuming iso-8859-1 in format_functions.php on line 156
Warning: htmlspecialchars(): charset `utf8mb4_general_ci' not supported, assuming iso-8859-1 in format_functions.php on line 158
Warning: htmlspecialchars(): charset `utf8mb4_general_ci' not supported, assuming iso-8859-1 in format_functions.php on line 174
Warning: htmlspecialchars(): charset `utf8mb4_general_ci' not supported, assuming iso-8859-1 in format_functions.php on line 174
Warning: htmlspecialchars(): charset `utf8mb4_general_ci' not supported, assuming iso-8859-1 in format_functions.php on line 156
Warning: htmlspecialchars(): charset `utf8mb4_general_ci' not supported, assuming iso-8859-1 in format_functions.php on line 158
Warning: htmlspecialchars(): charset `utf8mb4_general_ci' not supported, assuming iso-8859-1 in format_functions.php on line 174
Warning: htmlspecialchars(): charset `utf8mb4_general_ci' not supported, assuming iso-8859-1 in format_functions.php on line 174
Warning: htmlspecialchars(): charset `utf8mb4_general_ci' not supported, assuming iso-8859-1 in format_functions.php on line 156
Warning: htmlspecialchars(): charset `utf8mb4_general_ci' not supported, assuming iso-8859-1 in format_functions.php on line 158
Warning: htmlspecialchars(): charset `utf8mb4_general_ci' not supported, assuming iso-8859-1 in format_functions.php on line 174
Warning: htmlspecialchars(): charset `utf8mb4_general_ci' not supported, assuming iso-8859-1 in format_functions.php on line 174
Warning: htmlspecialchars(): charset `utf8mb4_general_ci' not supported, assuming iso-8859-1 in format_functions.php on line 156
Warning: htmlspecialchars(): charset `utf8mb4_general_ci' not supported, assuming iso-8859-1 in format_functions.php on line 158
Warning: htmlspecialchars(): charset `utf8mb4_general_ci' not supported, assuming iso-8859-1 in format_functions.php on line 174
Warning: htmlspecialchars(): charset `utf8mb4_general_ci' not supported, assuming iso-8859-1 in format_functions.php on line 174
Warning: htmlspecialchars(): charset `utf8mb4_general_ci' not supported, assuming iso-8859-1 in format_functions.php on line 156
Warning: htmlspecialchars(): charset `utf8mb4_general_ci' not supported, assuming iso-8859-1 in format_functions.php on line 158
Warning: htmlspecialchars(): charset `utf8mb4_general_ci' not supported, assuming iso-8859-1 in format_functions.php on line 174
Warning: htmlspecialchars(): charset `utf8mb4_general_ci' not supported, assuming iso-8859-1 in format_functions.php on line 174
Warning: Cannot modify header information - headers already sent by (output started at format_functions.php:174) in /tmp/tpl-Acorns-header-4dbd9fc1075479ca60fb2b1769c4773f.php-stage2 on line 5

That didn't work then haha
Re: Allowing Emojis?
September 13, 2016 09:12AM
utf8mb4_general_ci looks like something from mysql...

For php look here: [www.php.net]


Using Phorum since 7/2000: forum.langzeittest.de (actual version 5.2.23)
Modules "Made in Germany" for version 5.2: Author_as_Sender, CarCost, Close_Topic, Conceal_Message_Timestamp,
Format_Email, Index_Structure, Mailing_List, Pervasive_Forum, Spritmonitor, Terms_of_Service and German_Language_Files_Package.
Re: Allowing Emojis?
September 13, 2016 09:34AM
I'm not really sure what I'm doing in all honesty... however...

Could this:

    // The charset to use for htmlspecialchars() calls. PHP does
    // not implement all available charsets, which might result in
    // warning messages if an unsupported charset is used.
    //
    // See [www.php.net] for info on charset
    // compatibility. If the charset that you specified above is
    // compatible with htmlspecialchars(), then you can leave this
    // variable empty. Otherwise, specify a compatible character
    // set (ISO-8859-1 is usually a good choice for this).
    $PHORUM["DATA"]['HCHARSET']="";

Could this be used in conjunction with this [teamtreehouse.com]?
Re: Allowing Emojis?
September 13, 2016 09:39AM
I think you need a new module to handle emoji, see: [www.iamcal.com] and [github.com]


Using Phorum since 7/2000: forum.langzeittest.de (actual version 5.2.23)
Modules "Made in Germany" for version 5.2: Author_as_Sender, CarCost, Close_Topic, Conceal_Message_Timestamp,
Format_Email, Index_Structure, Mailing_List, Pervasive_Forum, Spritmonitor, Terms_of_Service and German_Language_Files_Package.
Re: Allowing Emojis?
September 13, 2016 09:40AM
In the language file you have to use UTF-8.


Using Phorum since 7/2000: forum.langzeittest.de (actual version 5.2.23)
Modules "Made in Germany" for version 5.2: Author_as_Sender, CarCost, Close_Topic, Conceal_Message_Timestamp,
Format_Email, Index_Structure, Mailing_List, Pervasive_Forum, Spritmonitor, Terms_of_Service and German_Language_Files_Package.
Re: Allowing Emojis?
September 13, 2016 09:46AM
I think they should work though... The emoji is there in message preview, just not when it goes through checks before adding to the database.
Re: Allowing Emojis?
September 13, 2016 09:51AM
I've investigated more... I've added an emoji code directly to the database... It displays no problem. The problem is getting it in to the database. ✌



Edited 1 time(s). Last edit at 09/13/2016 09:52AM by Brummie.
Re: Allowing Emojis?
September 13, 2016 09:52AM
Or maybe it was just that symbol...
Re: Allowing Emojis?
September 13, 2022 01:51PM
I just tested the following emojis on my phorum and they don't work.
My charset is UTF-8

???? ???? ????‍♂️ ????????????

...
Steve H, currently on: (version 5.2.23)
contributions:
Birthdays mod, Top Users mod, Icon legend.tpl, (plus a handful of bugfixes and old 5.0 creations)
Re: Allowing Emojis?
September 13, 2022 01:52PM
...and they don't work here either, lol

...
Steve H, currently on: (version 5.2.23)
contributions:
Birthdays mod, Top Users mod, Icon legend.tpl, (plus a handful of bugfixes and old 5.0 creations)
Re: Allowing Emojis?
September 13, 2022 02:51PM
I found this article which looks promising.
Need to convert mysql from utf8 to utf8mb4

[www.eversql.com]

...
Steve H, currently on: (version 5.2.23)
contributions:
Birthdays mod, Top Users mod, Icon legend.tpl, (plus a handful of bugfixes and old 5.0 creations)
Sorry, only registered users may post in this forum.

Click here to login