{"id":472,"date":"2009-06-19T00:30:57","date_gmt":"2009-06-19T07:30:57","guid":{"rendered":"http:\/\/xiehang.com\/blog\/?p=472"},"modified":"2009-06-19T21:49:01","modified_gmt":"2009-06-20T04:49:01","slug":"smiley-test","status":"publish","type":"post","link":"https:\/\/xiehang.com\/blog\/2009\/06\/19\/smiley-test\/","title":{"rendered":"Smiley test"},"content":{"rendered":"
Testing smilies.<\/p>\n
I think I got it fixed – the problem is that “\/” is used as delimiter of regular expression, and if “\/” is part of a smiley’s pattern, the whole thing is broken.<\/p>\n
So I’m defining a delimiter variable in wp-includes\/functions.php, in function smilies_init(), and use a character that can never be used (well, sort of) – I’m using “\\001” for now. Then replace all occurrences of “\/” with $delimiter while composing $wp_smiliessearch, and that’s it.<\/p>\n
Only open issue, which I don’t think it is related, is that two continuous #:-s will have only one shows up, still debugging …<\/p>\n
:@)<\/td>\n | :@)<\/td>\n | =P~<\/td>\n | =P~<\/td>\n | =p~<\/td>\n | =p~<\/td>\n | >:P<\/td>\n | >:P<\/td>\n | >:p<\/td>\n | >:p<\/td>\n<\/tr>\n |
:-/<\/td>\n | :-\/<\/td>\n | @-)<\/td>\n | @-)<\/td>\n | :-"<\/td>\n | :-“<\/td>\n | %-(<\/td>\n | %-(<\/td>\n | [-X<\/td>\n | [-X<\/td>\n<\/tr>\n |
[-x<\/td>\n | [-x<\/td>\n | :-@<\/td>\n | :-@<\/td>\n | :D<\/td>\n | \ud83d\ude00<\/td>\n | :d<\/td>\n | :d<\/td>\n | :-D<\/td>\n | \ud83d\ude00<\/td>\n<\/tr>\n |
:-d<\/td>\n | :-d<\/td>\n | :|<\/td>\n | \ud83d\ude10<\/td>\n | :-|<\/td>\n | \ud83d\ude10<\/td>\n | =))<\/td>\n | =))<\/td>\n | ;;)<\/td>\n | ;;)<\/td>\n<\/tr>\n |
I-)<\/td>\n | I-)<\/td>\n | i-)<\/td>\n | i-)<\/td>\n | :*<\/td>\n | :*<\/td>\n | :-*<\/td>\n | :-*<\/td>\n | :"><\/td>\n | :”><\/td>\n<\/tr>\n |
:-&<\/td>\n | :-&<\/td>\n | :)]<\/td>\n | :)]<\/td>\n | :-SS<\/td>\n | :-SS<\/td>\n | :-ss<\/td>\n | :-ss<\/td>\n | :-sS<\/td>\n | :-sS<\/td>\n<\/tr>\n |
:-Ss<\/td>\n | :-Ss<\/td>\n | ~O)<\/td>\n | ~O)<\/td>\n | ~o)<\/td>\n | ~o)<\/td>\n | **==<\/td>\n | **==<\/td>\n | @};-<\/td>\n | @};-<\/td>\n<\/tr>\n |
:-<<\/td>\n | :-<<\/td>\n | >:)<\/td>\n | >:)<\/td>\n | [-O<<\/td>\n | [-O<<\/td>\n | [-o<<\/td>\n | [-o<<\/td>\n | b-(<\/td>\n | b-(<\/td>\n<\/tr>\n |
B-(<\/td>\n | B-(<\/td>\n | :^o<\/td>\n | :^o<\/td>\n | :^O<\/td>\n | :^O<\/td>\n | ;))<\/td>\n | ;))<\/td>\n | :-w<\/td>\n | :-w<\/td>\n<\/tr>\n |
:-W<\/td>\n | :-W<\/td>\n | :-S<\/td>\n | :-S<\/td>\n | :-s<\/td>\n | :-s<\/td>\n | :-j<\/td>\n | :-j<\/td>\n | :-J<\/td>\n | :-J<\/td>\n<\/tr>\n |
:-t<\/td>\n | :-t<\/td>\n | :-T<\/td>\n | :-T<\/td>\n | >:D<<\/td>\n | >:D<<\/td>\n | >:d<<\/td>\n | >:d<<\/td>\n | (%)<\/td>\n | (%)<\/td>\n<\/tr>\n |
O:)<\/td>\n | O:)<\/td>\n | o:)<\/td>\n | o:)<\/td>\n | O:-)<\/td>\n | O:-)<\/td>\n | o:-)<\/td>\n | o:-)<\/td>\n | L-)<\/td>\n | L-)<\/td>\n<\/tr>\n |
l-)<\/td>\n | l-)<\/td>\n | %%-<\/td>\n | %%-<\/td>\n | :))<\/td>\n | :))<\/td>\n | :-))<\/td>\n | :-))<\/td>\n | :O<\/td>\n | :O<\/td>\n<\/tr>\n |
:o<\/td>\n | \ud83d\ude2e<\/td>\n | :-O<\/td>\n | :-O<\/td>\n | :-o<\/td>\n | \ud83d\ude2e<\/td>\n | o=><\/td>\n | o=><\/td>\n | O=><\/td>\n | O=><\/td>\n<\/tr>\n |
:)<\/td>\n | \ud83d\ude42<\/td>\n | :-)<\/td>\n | \ud83d\ude42<\/td>\n | :-B<\/td>\n | :-B<\/td>\n | :-b<\/td>\n | :-b<\/td>\n | (~~)<\/td>\n | (~~)<\/td>\n<\/tr>\n |
^:)^<\/td>\n | ^:)^<\/td>\n | =;<\/td>\n | =;<\/td>\n | :-L<\/td>\n | :-L<\/td>\n | :-l<\/td>\n | :-l<\/td>\n | :><\/td>\n | :><\/td>\n<\/tr>\n |
:-><\/td>\n | :-><\/td>\n | B-)<\/td>\n | B-)<\/td>\n | b-)<\/td>\n | b-)<\/td>\n | :-c<\/td>\n | :-c<\/td>\n | :-C<\/td>\n | :-C<\/td>\n<\/tr>\n |
:-?<\/td>\n | \ud83d\ude15<\/td>\n | (*)<\/td>\n | (*)<\/td>\n | <):)<\/td>\n | <):)<\/td>\n | =((<\/td>\n | =((<\/td>\n | :-h<\/td>\n | :-h<\/td>\n<\/tr>\n |
:-H<\/td>\n | :-H<\/td>\n | >:/<\/td>\n | >:\/<\/td>\n | =:)<\/td>\n | =:)<\/td>\n | :o3<\/td>\n | :o3<\/td>\n | :O3<\/td>\n | :O3<\/td>\n<\/tr>\n |
8-><\/td>\n | 8-><\/td>\n | :-??<\/td>\n | :-??<\/td>\n | ~:><\/td>\n | ~:><\/td>\n | [-(<\/td>\n | [-(<\/td>\n | :O)<\/td>\n | :O)<\/td>\n<\/tr>\n |
:o)<\/td>\n | :o)<\/td>\n | /:)<\/td>\n | \/:)<\/td>\n | #:-s<\/td>\n | #:-s<\/td>\n | #:-S<\/td>\n | #:-S<\/td>\n | 8-|<\/td>\n | 8-|<\/td>\n<\/tr>\n |
8-}<\/td>\n | 8-}<\/td>\n | :P<\/td>\n | \ud83d\ude1b<\/td>\n | :p<\/td>\n | :p<\/td>\n | :-P<\/td>\n | \ud83d\ude1b<\/td>\n | :-p<\/td>\n | :-p<\/td>\n<\/tr>\n |
(:|<\/td>\n | (:|<\/td>\n | =D><\/td>\n | =D><\/td>\n | =d><\/td>\n | =d><\/td>\n | :((<\/td>\n | :((<\/td>\n | :-((<\/td>\n | :-((<\/td>\n<\/tr>\n |
:(<\/td>\n | \ud83d\ude41<\/td>\n | :-(<\/td>\n | \ud83d\ude41<\/td>\n | :)>-<\/td>\n | :)>-<\/td>\n | \:D/<\/td>\n | \\:D\/<\/td>\n | \:d/<\/td>\n | \\:d\/<\/td>\n<\/tr>\n |
3:-O<\/td>\n | 3:-O<\/td>\n | 3:-o<\/td>\n | 3:-o<\/td>\n | >-)<\/td>\n | >-)<\/td>\n | 8-X<\/td>\n | 8-X<\/td>\n | 8-x<\/td>\n | 8-x<\/td>\n<\/tr>\n |
:-$<\/td>\n | :-$<\/td>\n | $-)<\/td>\n | $-)<\/td>\n | :(|)<\/td>\n | :(|)<\/td>\n | ;)<\/td>\n | \ud83d\ude09<\/td>\n | ;-)<\/td>\n | \ud83d\ude09<\/td>\n<\/tr>\n |
<:-P<\/td>\n | <:-P<\/td>\n | <:-p<\/td>\n | <:-p<\/td>\n | :x<\/td>\n | \ud83d\ude21<\/td>\n | :X<\/td>\n | :X<\/td>\n | :-x<\/td>\n | \ud83d\ude21<\/td>\n<\/tr>\n |
:-X<\/td>\n | :-X<\/td>\n | X(<\/td>\n | X(<\/td>\n | x(<\/td>\n | x(<\/td>\n | X-(<\/td>\n | X-(<\/td>\n | x-(<\/td>\n | x-(<\/td>\n<\/tr>\n |
o-><\/td>\n | o-><\/td>\n | O-><\/td>\n | O-><\/td>\n | *-:)<\/td>\n | *-:)<\/td>\n | ~X(<\/td>\n | ~X(<\/td>\n | ~x(<\/td>\n | ~x(<\/td>\n<\/tr>\n |
#-o<\/td>\n | #-o<\/td>\n | o-+<\/td>\n | o-+<\/td>\n | O-+<\/td>\n | O-+<\/td>\n | <\/td>\n | <\/td>\n | <\/td>\n | <\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"excerpt":{"rendered":" Testing smilies. I think I got it fixed – the problem is that “\/” is used as delimiter of regular expression, and if “\/” is part of a smiley’s pattern, the whole thing is broken. So I’m defining a delimiter variable in wp-includes\/functions.php, in function smilies_init(), and use a character that can never be used […]<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[71,28],"_links":{"self":[{"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/posts\/472"}],"collection":[{"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/comments?post=472"}],"version-history":[{"count":24,"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/posts\/472\/revisions"}],"predecessor-version":[{"id":496,"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/posts\/472\/revisions\/496"}],"wp:attachment":[{"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/media?parent=472"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/categories?post=472"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/xiehang.com\/blog\/wp-json\/wp\/v2\/tags?post=472"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}} |