From 5eb6e9281af4be97ff6aaa29e0091d1622cb3f21 Mon Sep 17 00:00:00 2001 From: Joffrey JAFFEUX Date: Wed, 21 Jul 2021 23:27:20 +0200 Subject: [PATCH] FIX: manually adds frowning_face_with_open_mouth for apple (#13528) --- .../pretty-text/addon/emoji/version.js | 2 +- app/models/emoji.rb | 2 +- plugins/poll/spec/lib/pretty_text_spec.rb | 4 ++-- .../apple/frowning_face_with_open_mouth.png | Bin 0 -> 1691 bytes spec/components/pretty_text_spec.rb | 14 +++++++------- spec/lib/upload_security_spec.rb | 2 +- spec/models/upload_spec.rb | 2 +- 7 files changed, 13 insertions(+), 13 deletions(-) create mode 100644 public/images/emoji/apple/frowning_face_with_open_mouth.png diff --git a/app/assets/javascripts/pretty-text/addon/emoji/version.js b/app/assets/javascripts/pretty-text/addon/emoji/version.js index a57796bd774..5b50dd5dec7 100644 --- a/app/assets/javascripts/pretty-text/addon/emoji/version.js +++ b/app/assets/javascripts/pretty-text/addon/emoji/version.js @@ -1,4 +1,4 @@ // DO NOT EDIT THIS FILE!!! // Update it by running `rake javascript:update_constants` -export const IMAGE_VERSION = "9"; +export const IMAGE_VERSION = "10"; diff --git a/app/models/emoji.rb b/app/models/emoji.rb index f755a7eaadf..d9f8c06d19a 100644 --- a/app/models/emoji.rb +++ b/app/models/emoji.rb @@ -2,7 +2,7 @@ class Emoji # update this to clear the cache - EMOJI_VERSION = "9" + EMOJI_VERSION = "10" FITZPATRICK_SCALE ||= [ "1f3fb", "1f3fc", "1f3fd", "1f3fe", "1f3ff" ] diff --git a/plugins/poll/spec/lib/pretty_text_spec.rb b/plugins/poll/spec/lib/pretty_text_spec.rb index 52fed2284ea..5770f804f3f 100644 --- a/plugins/poll/spec/lib/pretty_text_spec.rb +++ b/plugins/poll/spec/lib/pretty_text_spec.rb @@ -165,7 +165,7 @@ describe PrettyText do MD expect(cooked).to include(<<~HTML) -
What’s your favorite berry? :wink: https://google.com/ +
What’s your favorite berry? :wink: https://google.com/
HTML end @@ -185,7 +185,7 @@ describe PrettyText do MD expect(cooked).to include(<<~HTML) -
What’s your favorite berry? :wink: https://google.com/ +
What’s your favorite berry? :wink: https://google.com/
HTML diff --git a/public/images/emoji/apple/frowning_face_with_open_mouth.png b/public/images/emoji/apple/frowning_face_with_open_mouth.png new file mode 100644 index 0000000000000000000000000000000000000000..e7ef74d9b3c34c5d0737d93e65c87e3caa93b10e GIT binary patch literal 1691 zcmV;M24wk(P)Px#u24)=MMrQ<$Z87CcN_GS7|wz#^oj)Ae;dz;FV}-6 z(0?e&Z4Jd~3(0R1*L4u_l^^1M7MWKD|IRo6*E9dSDgWRy{<9nVs}=O46aT|Dq-P23 znh*cyJ>-xK|I01hg$UMn1ONQT|NOK6^H~4-q5tkk|HCZ*_jdpIk^lbQ|Mi6b_Ggt? z27yNe|Ke24Yy;jt(G(hKB%0=9w}&y^r~t1Bh|000qm zQchC<>4@Pj{hk$RNyOK(*}=s3Z7X|F000GUNkl$O-=cKX&)tQ)s4sJL_&!o$<*#g^Bv-&;Pa5fv#&<`ao5Gjp*9wu|J=&TJ#?k zZSWgq)L+cr-u_ngHkrLmbCxoNm)It7994dsw9iLEkvB+L4~JY?dTROx8BtZqFYUw#HlR87E0Q z5-k}*NI^GI=NbsVZ0WONpk`V2RNsp@)zlC(sj|8y9F!a@tM4WC0Y>H+22oz@#e1mj zzC+;M`xtK?%i}oCygoMl9U;d^fbvlC_8%8Ed(aCy8wNq6+L{eB3n0j3CN^}#z8^58 zBzBUR2092msMQoL=a%L8&}5osVuHmUv9ELdJ}BF^O>_+BV9m1OyDoPlL5BmAZ0zTo z-rcf&pBRLE{{YZp_%0@C@Gx91W+3^#kCAM%a3i;{?>K%Lg{6;qOy&@zh`C;I2qhn+ zBDz8q7|r(hjmmVf!Now>6`eUiQ@Lo*09BG7UZXIA{&u?xY>2J}cNnyMAB#mpXkI}@ z6ooE4py)v5HFVwZT2>B0V%fBngboaX?jUs`m^y3_5KQ%Kv3RaQ?=sP$2Kn7Y2)R)s z(Xs=Hv6&|Q;mE~Rt`JyEoBjkuHF+SKq6*SiFi9K|V+(O)CT$p-eTPrmbD;$S(b8AY zxDJU)Ldh%K&@DXEWRE9<|5AowNo(fFxqg<*Kj;a_at;n`O5cWyk~tMcyBQi1&x9V} zI2?LejpQl9Ad2Mp{F;MJZkVm2YY`a%VW5|l*xBlI^}-{;GnC;PC+t1_Ef+lSia}p)E-gIdC*pRLwxfs2m<>EYG7suZmkWW6q`aUt7C$B}O^Lt%Pk}7Ka)m2S(7O_8*du ztt}bO&84FWD!f@j5e^TeG@cw)k!n%_=U4;sMmOkM3LH30S6phTX+(< zaEV=`Tf^ajTF;P_6-GjdjSeUa4@y@SN`)8}<^iV@h$2T#brW-LV4?3$!=SieGzOZTHp{!fmp+i>0AqN88d4kLa$0eZdLoMg-Q+C*u zB=O -

This is a quote with a regular emoji :upside_down_face:

+

This is a quote with a regular emoji :upside_down_face:

-

This is a quote with an emoji shortcut :slight_smile:

+

This is a quote with an emoji shortcut :slight_smile:

-

This is a quote with a Unicode emoji :sunglasses:

+

This is a quote with a Unicode emoji :sunglasses:

HTML @@ -180,13 +180,13 @@ describe PrettyText do html = <<~HTML
-

This is a quote with a regular emoji :upside_down_face:

+

This is a quote with a regular emoji :upside_down_face:

-

This is a quote with an emoji shortcut :slight_smile:

+

This is a quote with an emoji shortcut :slight_smile:

-

This is a quote with a Unicode emoji :sunglasses:

+

This is a quote with a Unicode emoji :sunglasses:

HTML @@ -680,7 +680,7 @@ describe PrettyText do context "emojis" do it "should remove broken emoji" do html = <<~EOS - \":bike:\" \":cat:\" \":discourse:\" + \":bike:\" \":cat:\" \":discourse:\" EOS expect(PrettyText.excerpt(html, 7)).to eq(":bike: …") expect(PrettyText.excerpt(html, 8)).to eq(":bike: …") diff --git a/spec/lib/upload_security_spec.rb b/spec/lib/upload_security_spec.rb index 32ed9ead8f8..4b5cac79049 100644 --- a/spec/lib/upload_security_spec.rb +++ b/spec/lib/upload_security_spec.rb @@ -120,7 +120,7 @@ RSpec.describe UploadSecurity do describe "when it is based on a regular emoji" do it "returns false" do - falafel = Emoji.all.find { |e| e.url == '/images/emoji/twitter/falafel.png?v=9' } + falafel = Emoji.all.find { |e| e.url == "/images/emoji/twitter/falafel.png?v=#{Emoji::EMOJI_VERSION}" } upload.update!(origin: "http://localhost:3000#{falafel.url}") expect(subject.should_be_secure?).to eq(false) end diff --git a/spec/models/upload_spec.rb b/spec/models/upload_spec.rb index c614b28f5d1..b4ad89a66f3 100644 --- a/spec/models/upload_spec.rb +++ b/spec/models/upload_spec.rb @@ -466,7 +466,7 @@ describe Upload do it 'does not mark an upload whose origin matches a regular emoji as secure (sometimes emojis are downloaded in pull_hotlinked_images)' do SiteSetting.login_required = true - falafel = Emoji.all.find { |e| e.url == '/images/emoji/twitter/falafel.png?v=9' } + falafel = Emoji.all.find { |e| e.url == "/images/emoji/twitter/falafel.png?v=#{Emoji::EMOJI_VERSION}" } upload.update!(secure: false, origin: "http://localhost:3000#{falafel.url}") upload.update_secure_status expect(upload.reload.secure).to eq(false)