Curiosity killed smilies: how smilies are parsed into shortcodes

User avatar
axew3
w3all User
w3all User
Posts: 2689
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Curiosity killed smilies: how smilies are parsed into shortcodes

Post by axew3 »

So i'm over some while to check for next plugin version and checking for any possible bug on different scenario (buddypress, members plugin etc) and i noted that a shortcoded post with text, was containing smiles on wp home page ... so i've go to look how was possible that the last topics/posts showing smilies on output in wordpress.
With my surprise the post contain this:

Screenshot_2018-10-18 phpbb 323 - Edit post.png
Screenshot_2018-10-18 phpbb 323 - Edit post.png (31.4 KiB) Viewed 1929 times

the output on wp shortcode will be this:

Screenshot_2018-10-18 wptests – Just another WordPress site.png
Screenshot_2018-10-18 wptests – Just another WordPress site.png (43.9 KiB) Viewed 1929 times

Substantially, smilies wrapped inside bbcode
[img] will be correctly parsed not in phpBB post, but in wordpress widgets.
Just a curiosity, it's not so useful in this way. May it is useful to discover a way to parse smilies in a not common way ... i will take a look to the joke. I've not check further more but i assume this result is coming out because: if you wrap smilies into a bbcode img tag, phpBB parse the smilie url (something like for example https://s.w.org/images/core/emoji/11/svg/1f633.svg ) and archive the post in this way ... it resulted to me strange behavior, but maybe it isn't so strange after you'll take a look into.
User avatar
axew3
w3all User
w3all User
Posts: 2689
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: Curiosity killed smilies: how smilies are parsed into shortcodes

Post by axew3 »

the stored post as above is this:

Code: Select all

oh, these are outputted on wp output, but not on phpBB post (because it is wrong bbcode, not parsed)<br/>
<IMG src=":oops:%20%20:D%20%20:lol%3A"><s>[img]</s> <E>:oops:</E>  <E>:D</E>  <E>:lol:</E> <e>[/img]</e></IMG></r>
strange behavior, except for the fact that maybe wordpress do this: parse this via some function, associating the correct src url that will result something like: https://s.w.org/images/core/emoji/11/svg/1f633.svg
for example. Nice to know but also asking myself if this is a secure behavior ... could i include something else, forcing wordpress to include something else instead?
More probably wp recognize just something like this: <E>:D</E> and translate into url to https://s.w.org/ related icon.
User avatar
axew3
w3all User
w3all User
Posts: 2689
Joined: Fri Jan 22, 2016 5:15 pm
Location: Italy
Contact:

Re: Curiosity killed smilies: how smilies are parsed into shortcodes and widgets

Post by axew3 »

finally on third fly check just over the pc, i see that: smilies are correctly parsed if posts are retrieved via last post topics shortcode, while it not happen when parse last topics widget. That' i will check why as possible
Screenshot_2018-10-18 wptests.png
Screenshot_2018-10-18 wptests.png (17.01 KiB) Viewed 1919 times
Post Reply