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 zcmeAS@N?(olHy`uVBq!ia0y~yVDJE84rT@hh9qO>QU(SFmUKs7M+SzC{oH>NSs54@ z7>k44ofy`glX=O&z_2dBC&bmgz~@93*ST`(FHZTbH# zeQE?-qdUw0Me7I5l|0V7xbxhluB+gG&s9deB z#=yWJSQ6wH%_b=?L+3fG~^%*N~Jx=oLdi(bK?YCv`Z+a{={l&P{ zHqFu~uIkpB_?6dQ$8Okq@zj3bmpvbw&StN^w)={j*UxiDw7pXvUH|}=oV?4%tCOW$ zsw0+iINrC|cx&RkO*zw4JbkX2-OW2MFShMi^czWaPirAvNhc3S^T6j)9Q$)#ZcbW| z7WpmYez(QdD+0zVH|S;^sj@&-#($|lWVv*NH_aaBb3 z`Lw4$E~Ly#OKLhQw{d;(A3KfP+k8uSo+q5$^l-Ocxw2zB^W>a2&u8DeyQy}*L`%(o zh6_nQ^wcsx7{utMDg4~mKQU)>f%5hZ?=9*iTbK4%`aBa@(y=qHkV92|iPA17QHitP ze)OIy*?91%!wu27mJY!?GtM)FPLhvXY|!+tY&Ta<$2!(>i7hqq-LB3VagMGct$H>K zUN}58ExG$4DvZxD>E@QHEqpvp?-WWEXISM32>5)>*;uj8@x9T-g=|0Xx^V0aRKB>0 zxpU)8wZ9Kf91UG35aBcXAB&4=rNXR5T$jQPJY|HExeHU&awTThw)@{MUdYOH@lyDO z9ekahPA9eRT+p?-oYJq}{6DBI(KGwmiJf)RPTRlWJW<5Qm*aK6t$UKCsOxS?DWUT% zat|zIsv>)zXdY7Ndh+AXtY+W58EY413raF3E|@;`#?4nHUk@oCe9AMWQN)V3^W6cl z5*bMjg`fJK4+Y$cHq2-dd;Ft!>iY*D8Tr_lGOkW`UsAVF*Hg%{z$7%}ti!PtGIAL@ z=NCJ!?@F<35=uR#f5f<*ca5cMK+UAApyp4jR+oXdG74e#hhAuBAo>J_?MW>lL?)e6~y>Ff`!$ct0FPb@Q&k(>lIxt z6K@4EvdhFoR|xGW=!{()efVKx)cFZhMBSV^d-*iD`Mtu$yjms1o-r;L?obN7d_-gW zLxob_wao=T4$LxEN$d2^spwwuG+~*vp$@;*YR~7MORV;7$b7VLP4w-B&S6Is*_rNE zHl1NRuDalzv+nbE!DTn5s(gHS@Iu1ctXA#vrzslD633K$)Bhny!GmB*JM9^`NAJBJXytgJ^ z&LCZ_G)E4N12q%d&j#~<7hXIgbp6wyBRhNcSB0+juh3XD&9`N#WBQk`uiqRDX%U*S z=6SkY`l8zRt^a>Gt(?Is^}jE1!b{EO{QZj^MWTWpa~UYlO8vT9gl9tHfrryYm8Rcw z`T5b>j5*h8r^zbwurK%bb}o4}%ShIL!LiE|7xC8p4HLP%;@`pY$N!j5Eb8}jlHT!y Qfq{X+)78&qol`;+0G6jQXaE2J literal 0 HcmV?d00001 diff --git a/spec/components/pretty_text_spec.rb b/spec/components/pretty_text_spec.rb index c2e5a611a54..cf9a2145c01 100644 --- a/spec/components/pretty_text_spec.rb +++ b/spec/components/pretty_text_spec.rb @@ -159,13 +159,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 @@ -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)