From 87f89e92a82e6260a64804a41016461b925a85d1 Mon Sep 17 00:00:00 2001 From: Neil Lalonde Date: Thu, 31 Jan 2019 17:24:35 -0500 Subject: [PATCH] Merge diffs from master --- Gemfile.lock | 6 +- app/assets/stylesheets/common/base/user.scss | 38 ---- app/jobs/onceoff/recover_post_uploads.rb | 22 -- config/locales/client.bs_BA.yml | 1 - config/locales/client.pt_BR.yml | 3 - config/locales/server.en.yml | 1 - config/locales/server.fr.yml | 29 --- config/nginx.sample.conf | 2 +- discourse.iml | 215 ------------------ lib/final_destination.rb | 5 - lib/upload_creator.rb | 2 +- lib/validators/upload_url_validator.rb | 2 +- .../images/emoji/emoji_one/sushing_face.png | Bin 0 -> 1409 bytes .../emoji/facebook_messenger/sushing_face.png | Bin 0 -> 1031 bytes public/images/emoji/google/sushing_face.png | Bin 0 -> 1096 bytes public/images/emoji/twitter/sushing_face.png | Bin 0 -> 1182 bytes spec/jobs/recover_post_uploads_spec.rb | 17 -- spec/models/group_spec.rb | 22 -- spec/models/topic_embed_spec.rb | 14 -- spec/serializers/user_serializer_spec.rb | 25 -- spec/services/search_indexer_spec.rb | 21 -- 21 files changed, 6 insertions(+), 419 deletions(-) delete mode 100644 app/jobs/onceoff/recover_post_uploads.rb delete mode 100644 discourse.iml create mode 100644 public/images/emoji/emoji_one/sushing_face.png create mode 100644 public/images/emoji/facebook_messenger/sushing_face.png create mode 100644 public/images/emoji/google/sushing_face.png create mode 100644 public/images/emoji/twitter/sushing_face.png delete mode 100644 spec/jobs/recover_post_uploads_spec.rb diff --git a/Gemfile.lock b/Gemfile.lock index 379101a2c7e..b59803ab6ac 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -271,7 +271,6 @@ GEM openid-redis-store (0.0.2) redis ruby-openid - optimist (3.0.0) parallel (1.12.1) parser (2.5.3.0) ast (~> 2.4.0) @@ -321,10 +320,10 @@ GEM rb-fsevent (0.10.3) rb-inotify (0.9.10) ffi (>= 0.5.0, < 2) - rbtrace (0.4.11) + rbtrace (0.4.10) ffi (>= 1.0.6) msgpack (>= 0.4.3) - optimist (>= 3.0.0) + trollop (>= 1.16.2) rchardet (1.8.0) redis (4.0.1) redis-namespace (1.6.0) @@ -421,6 +420,7 @@ GEM thor (0.19.4) thread_safe (0.3.6) tilt (2.0.8) + trollop (2.1.2) tzinfo (1.2.5) thread_safe (~> 0.1) uglifier (4.1.11) diff --git a/app/assets/stylesheets/common/base/user.scss b/app/assets/stylesheets/common/base/user.scss index caffa6c8a4e..b678408b0c1 100644 --- a/app/assets/stylesheets/common/base/user.scss +++ b/app/assets/stylesheets/common/base/user.scss @@ -400,44 +400,6 @@ list-style: none; margin: 0; } - - .username, .name { - display: block; - } - - .name { - margin-left: 0; - } -} - -.user-nav { - margin: 5px 0px; - .fa { - margin-right: 5px; - } - .fa.fa-comment { - margin-right: 2px; - } -} - -.user-right .list-actions { - margin-bottom: 10px; - .btn { - margin-right: 10px; - } -} - -.top-section { - ul { - list-style: none; - margin: 0; - } -} - -.top-section, -.replies-section, -.topics-section { - margin-bottom: 20px; } .top-section, diff --git a/app/jobs/onceoff/recover_post_uploads.rb b/app/jobs/onceoff/recover_post_uploads.rb deleted file mode 100644 index ef3fb0b5aa2..00000000000 --- a/app/jobs/onceoff/recover_post_uploads.rb +++ /dev/null @@ -1,22 +0,0 @@ -require_dependency "upload_recovery" - -module Jobs - class RecoverPostUploads < Jobs::Onceoff - MIN_PERIOD = 30 - MAX_PERIOD = 120 - - def execute_onceoff(args) - UploadRecovery.new.recover(Post.where( - "baked_at >= ?", - grace_period.days.ago - )) - end - - def grace_period - SiteSetting.purge_deleted_uploads_grace_period_days.clamp( - MIN_PERIOD, - MAX_PERIOD - ) - end - end -end diff --git a/config/locales/client.bs_BA.yml b/config/locales/client.bs_BA.yml index 3f3da516491..70f79f18997 100644 --- a/config/locales/client.bs_BA.yml +++ b/config/locales/client.bs_BA.yml @@ -510,7 +510,6 @@ bs_BA: "14": "Na čekanju." categories: all: "Sve kategorije" - all_subcategories: "sve u %{categoryName}" no_subcategory: "nijedna" category: "Kategorija" category_list: "Prikaži listu kategorija" diff --git a/config/locales/client.pt_BR.yml b/config/locales/client.pt_BR.yml index 71dc01204ec..bb4ba1ab9aa 100644 --- a/config/locales/client.pt_BR.yml +++ b/config/locales/client.pt_BR.yml @@ -789,9 +789,6 @@ pt_BR: email_always: "Envie-me notificações mesmo quando eu estiver ativo no site." other_settings: "Outros" categories_settings: "Categorias" - enable_mailing_list: - one: "Você tem certeza de que deseja receber um email para cada novo post?" - other: "Você tem certeza de que deseja receber um email para cada novo post?

Isso vai resultar em aproximadamente {{count}} emails por dia." new_topic_duration: label: "Considerar tópicos como novos quando" not_viewed: "Eu ainda não os vi" diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index 82a911e0306..ddea713c1c6 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -1682,7 +1682,6 @@ en: levenshtein_distance_spammer_emails: "When matching spammer emails, number of characters difference that will still allow a fuzzy match." max_new_accounts_per_registration_ip: "If there are already (n) trust level 0 accounts from this IP (and none is a staff member or at TL2 or higher), stop accepting new signups from that IP." - min_ban_entries_for_roll_up: "When clicking the Roll up button, will create a new subnet ban entry if there are at least (N) entries." max_age_unmatched_emails: "Delete unmatched screened email entries after (N) days." diff --git a/config/locales/server.fr.yml b/config/locales/server.fr.yml index 816fb2969d0..b0b36b2d84f 100644 --- a/config/locales/server.fr.yml +++ b/config/locales/server.fr.yml @@ -3555,35 +3555,6 @@ fr: ## [Changements à notre politique de confidentialité](#changes) Si nous décidons de changer notre politique de confidentialité, nous afficherons ces modifications sur cette page. Ce document est soumis à la licence creative commons CC-BY-SA. Il a été mis à jour le 31 mai 2013. - static: - search_help: | -

Astuces

-

-

-

-

Options

-

- - - - - - - -
order:viewsorder:latestorder:likes@usernameuser:foo
status:openstatus:closedstatus:archivedstatus:norepliesstatus:single_user
#category-slugcategory:foogroup:foobadge:foo
in:likesin:postedin:watchingin:trackingin:private
in:bookmarksin:firstin:pinnedin:unpinnedin:wiki
posts_count:numbefore:days or dateafter:days or datetags:one,two
-

-

Examples

-

-

-

badges: editor: name: Éditeur diff --git a/config/nginx.sample.conf b/config/nginx.sample.conf index 7fd696bca7e..48bb7a3c152 100644 --- a/config/nginx.sample.conf +++ b/config/nginx.sample.conf @@ -71,7 +71,7 @@ server { # further more etags are based on the file in nginx not sha of data # use dates, it solves the problem fine even cross server etag off; - + # prevent direct download of backups location ^~ /backups/ { internal; diff --git a/discourse.iml b/discourse.iml deleted file mode 100644 index 13f1cee409f..00000000000 --- a/discourse.iml +++ /dev/null @@ -1,215 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/lib/final_destination.rb b/lib/final_destination.rb index c3fff9dcb55..a098df3b526 100644 --- a/lib/final_destination.rb +++ b/lib/final_destination.rb @@ -267,11 +267,6 @@ class FinalDestination return true if SiteSetting.whitelist_internal_hosts.split("|").any? { |h| h.downcase == @uri.hostname.downcase } end - # Whitelisted hosts - return true if hostname_matches?(SiteSetting.s3_cdn_url) || - hostname_matches?(GlobalSetting.try(:cdn_url)) || - hostname_matches?(Discourse.base_url_no_prefix) - address_s = @opts[:lookup_ip].call(@uri.hostname) return false unless address_s diff --git a/lib/upload_creator.rb b/lib/upload_creator.rb index fcc005632db..a1386feb2e3 100644 --- a/lib/upload_creator.rb +++ b/lib/upload_creator.rb @@ -49,10 +49,10 @@ class UploadCreator elsif !Rails.env.test? || @opts[:force_optimize] convert_to_jpeg! if should_convert_to_jpeg? downsize! if should_downsize? - fix_orientation! if should_fix_orientation? return @upload if is_still_too_big? + fix_orientation! if should_fix_orientation? crop! if should_crop? optimize! if should_optimize? end diff --git a/lib/validators/upload_url_validator.rb b/lib/validators/upload_url_validator.rb index 67f1e7af674..7823478aa77 100644 --- a/lib/validators/upload_url_validator.rb +++ b/lib/validators/upload_url_validator.rb @@ -7,7 +7,7 @@ class UploadUrlValidator < ActiveModel::EachValidator rescue URI::Error end - unless uri && Discourse.store.has_been_uploaded?(value) + unless uri && Upload.exists?(url: value) record.errors[attribute] << (options[:message] || I18n.t('errors.messages.invalid')) end end diff --git a/public/images/emoji/emoji_one/sushing_face.png b/public/images/emoji/emoji_one/sushing_face.png new file mode 100644 index 0000000000000000000000000000000000000000..b792bac92afe0c7a86c3fe53a3b17be6728ac7c5 GIT binary patch literal 1409 zcmV-{1%CR8P)cd<7$2#l9Ui`^L_{T>2yb%1wH2um){lzo<#ya}G8=9%GnW(S&y%PGn z4VtO1nyIgxtFZmbN13Uwn5nOysGgaquKmhK|NsB_w*c+%@y?S0{r>*0y1(zgLcz+; z)T%wAu(jm2K+o3Mx5CER-{JQ6`2EK@xS2+#uc<{mJuoagsD~^3!6d+#D*e!1tgM!W zZa?Jb>2zT}Us6N<*LawGK>z5v{@sw(y>jNlUf`z|?YJ-hCqq|jX(m<)z%$j>;I~{ryEiF$5iXopDLAVwNiPi zcWT#C%1>2+BqUa!%2#-)SIH4o>$S@;tu`Tx-TQkM)oxvY>bA+^{panCaWbgxxppdu zc|**CoKWQ~Q=K-+$DrDsGh&I0ALQ&vuEcr~r!MRe^RplY5_$z37K;$UvF6k1+&VnT zK0DFX8sw6?!h0CYng7|#i9kklGItnw);i5;h&#%0rhj6^maN0sG(-u_lNGO37sy#q zH#CGH8ipgr<#h}^pn<6?dOW*3HGM6D{rW_TCFXX_LY9FfxtbGf;Y=+e6t&C>)6L}L z;VNioM+AWsD*7k6e{^e*1#&LZOs*d_^nM|S431f95R%{+udCsajKXmBY9vTaxqPH$ z30dRGWU|ThPTb(}*h*&0Hm;rE7|21bc+e_59vg{l&1|xSUMEaWn&a$`UlX9r4X7tU zW9|u#KR&Q!xtHnLLE>buO&YX`&c#Hv`#B}DBG5Js+D0HN0lMQr$qpGsj*J9I=4*Xj zjSy7k<|83tm5D$;K0d@K@+t-Dra&F8&s>QF~39ckbCJdd`c4Lu*WZqGka7s<=2s8u*@cWDV!$9V1)F64X zZHWq&Dgt;=nZHLl0-bU+1PN)|GX#~=s^)M$!K0u6L9}k^THoc&8YgiGCN-qMZw@4& zq5i4q=Vh$MTWlI?odMBgy}W(I?YO_-Q%61wIZzWpof8|97rmMQiiC0zG~j#I%-h-g z9S2*ZARXo^Zz$T?#o3JQWW4Xb4XVl;ijx)hO?>^!YE7G_etoA6^^bnjp3o9Z)6;bu zmczNKs^4+TxIrtj^Z^OI4AGSk2kW1B8{rVqCeqz?ph;S=c6CI}Lz2+sDpb%ov|}n# zEKM;1ki-fkS5LmNWv2{$DZxROOG)2hfuc9I;&8$UIZ2SOQPNUXWiA-6uD}H|BgCF$ zVy$!>l`omwvAkM?w4tazfg6ORHIfx(so;&hH{T@bYqhTTE*7Wkkha9#XK!`IH-=OB1MmA)q*(+?)-_ z$Yum{%}BaO9oahAisr*j?W`Y>GHMUfG+SXnTSHp_o`Q!avs8@g-9;cIc>8R+X+s?J zp>(FYv_`DX_;hFjWipPU!)@tYJ;q(rb%~Wncag2Qo(=F=I$O`+M>7Vlq}c4^S_jn4 zL+yOfZG5ve>=b~@A|V7*U8I}CteLvEW=rG|DVOR2^wciWOzs|DP;T5Cu>u`#(9Sh# z+<>RVTg`??tnk$&@O(v4)~*fkT>2k+Kok=j`0G`>eZIfHfBw}d{bTwMR3~HB>g_c( P00000NkvXXu0mjf3t7X8 literal 0 HcmV?d00001 diff --git a/public/images/emoji/facebook_messenger/sushing_face.png b/public/images/emoji/facebook_messenger/sushing_face.png new file mode 100644 index 0000000000000000000000000000000000000000..cd0c5b5401f2bc0989bc5b9242d72e7278e277d7 GIT binary patch literal 1031 zcmV+i1o-=jP)g)cZpMw7<_0000DbW%=J0RH`msptLu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C`E)67#^4=!d+84BEk_E@a!_K03FS)NN!#QEC$<+ z9m@~v6rq&sTZdU_6t*Ex7KpI+d+ra+f_s3T@NWNx|KdqIV?!Hnnv&p-q?a>k5k$9_h@8NWm`U4H#r2VyL}# zF-S4kH6ml9_8QOFl`R3!snF{hE4(I{(yQx(3MEK->6zT}7vLk$rKI9TN0+}Uw;jr< zPRM-<%B~}AED#K-~)_c1CTU6&)`2G7uhn9|Yb zvAE&j(Ipmz8Eu26_j=o-ra^S+YcI({E~4kQ=h08G*B@D#qBL{a<)jlGDW=rxEJxc* zX4q6eMcKY)2@~{szEEuAmdEkR<&?aVv=inY$I9pW#^p#8axvLcts_InW{bAXlakad zt5b`d;Z6V2_;o2-mgFAtsMB*UD>Z|kF2ier5+d|nyO|$ugDt7qAMJKtxSEkR8uSoa zd}WoCAr)F^J(yFgQJUvrJ#epXIP9S_qyg0`HAxT>r+Y_4g-Wy~I{nP1sg>I@N9Fv7 w){pze+3Wy$dG=?Z^=9z0_{=X17pidn0Vs2y`Y-GEXaE2J07*qoM6N<$g5={rF8}}l literal 0 HcmV?d00001 diff --git a/spec/jobs/recover_post_uploads_spec.rb b/spec/jobs/recover_post_uploads_spec.rb deleted file mode 100644 index 0448bc9adcf..00000000000 --- a/spec/jobs/recover_post_uploads_spec.rb +++ /dev/null @@ -1,17 +0,0 @@ -require 'rails_helper' - -RSpec.describe Jobs::RecoverPostUploads do - describe '#grace_period' do - it 'should restrict the grace period to the right range' do - SiteSetting.purge_deleted_uploads_grace_period_days = - described_class::MIN_PERIOD - 1 - - expect(described_class.new.grace_period).to eq(30) - - SiteSetting.purge_deleted_uploads_grace_period_days = - described_class::MAX_PERIOD + 1 - - expect(described_class.new.grace_period).to eq(120) - end - end -end diff --git a/spec/models/group_spec.rb b/spec/models/group_spec.rb index 33664ab13bb..37ef6736430 100644 --- a/spec/models/group_spec.rb +++ b/spec/models/group_spec.rb @@ -256,28 +256,6 @@ describe Group do end end - it "does not reset the localized name" do - begin - default_locale = SiteSetting.default_locale - I18n.locale = SiteSetting.default_locale = 'fi' - - group = Group.find(Group::AUTO_GROUPS[:everyone]) - group.update!(name: I18n.t("groups.default_names.everyone")) - - Group.refresh_automatic_group!(:everyone) - - expect(group.reload.name).to eq(I18n.t("groups.default_names.everyone")) - - I18n.locale = SiteSetting.default_locale = 'en' - - Group.refresh_automatic_group!(:everyone) - - expect(group.reload.name).to eq(I18n.t("groups.default_names.everyone")) - ensure - I18n.locale = SiteSetting.default_locale = default_locale - end - end - it "uses the localized name if name has not been taken" do begin default_locale = SiteSetting.default_locale diff --git a/spec/models/topic_embed_spec.rb b/spec/models/topic_embed_spec.rb index 3e51111930b..b9e1247929b 100644 --- a/spec/models/topic_embed_spec.rb +++ b/spec/models/topic_embed_spec.rb @@ -105,20 +105,6 @@ describe TopicEmbed do end end - context '.topic_id_for_embed' do - it "returns correct topic id irrespective of url protocol" do - topic_embed = Fabricate(:topic_embed, embed_url: "http://example.com/post/248") - - expect(TopicEmbed.topic_id_for_embed('http://exAMPle.com/post/248')).to eq(topic_embed.topic_id) - expect(TopicEmbed.topic_id_for_embed('https://example.com/post/248/')).to eq(topic_embed.topic_id) - - expect(TopicEmbed.topic_id_for_embed('http://example.com/post/248/2')).to eq(nil) - expect(TopicEmbed.topic_id_for_embed('http://examples.com/post/248')).to eq(nil) - expect(TopicEmbed.topic_id_for_embed('http://example.com/post/24')).to eq(nil) - expect(TopicEmbed.topic_id_for_embed('http://example.com/post')).to eq(nil) - end - end - describe '.find_remote' do context ".title_scrub" do diff --git a/spec/serializers/user_serializer_spec.rb b/spec/serializers/user_serializer_spec.rb index b2f1cb5f300..505294d1187 100644 --- a/spec/serializers/user_serializer_spec.rb +++ b/spec/serializers/user_serializer_spec.rb @@ -238,31 +238,6 @@ describe UserSerializer do end - context "with user fields" do - let(:user) { Fabricate(:user) } - - let! :fields do - [ - Fabricate(:user_field), - Fabricate(:user_field), - Fabricate(:user_field, show_on_profile: true), - Fabricate(:user_field, show_on_user_card: true), - Fabricate(:user_field, show_on_user_card: true, show_on_profile: true) - ] - end - - let(:other_user_json) { UserSerializer.new(user, scope: Guardian.new(Fabricate(:user)), root: false).as_json } - let(:self_json) { UserSerializer.new(user, scope: Guardian.new(user), root: false).as_json } - let(:admin_json) { UserSerializer.new(user, scope: Guardian.new(Fabricate(:admin)), root: false).as_json } - - it "includes the correct fields for each audience" do - expect(admin_json[:user_fields].keys).to contain_exactly(*fields.map { |f| f.id.to_s }) - expect(other_user_json[:user_fields].keys).to contain_exactly(*fields[2..5].map { |f| f.id.to_s }) - expect(self_json[:user_fields].keys).to contain_exactly(*fields.map { |f| f.id.to_s }) - end - - end - context "with user_api_keys" do let(:user) { Fabricate(:user) } diff --git a/spec/services/search_indexer_spec.rb b/spec/services/search_indexer_spec.rb index 2df395930a8..3886eb025a6 100644 --- a/spec/services/search_indexer_spec.rb +++ b/spec/services/search_indexer_spec.rb @@ -63,27 +63,6 @@ describe SearchIndexer do expect(scrubbed).to eq("Discourse 51%20PM Untitled design (21).jpg Untitled%20design%20(21) Untitled design (21).jpg 1280x1136 472 KB") end - it "doesn't index local files" do - html = <<~HTML -

Discourse

-

51%20PM

- - HTML - - scrubbed = SearchIndexer::HtmlScrubber.scrub(html).gsub(/\s+/, " ") - - expect(scrubbed).to eq(" Discourse 51%20PM Untitled design (21).jpg Untitled%20design%20(21) Untitled design (21).jpg 1280x1136 472 KB ") - end - it 'correctly indexes a post according to version' do # Preparing so that they can be indexed to right version SearchIndexer.update_posts_index(post_id, "dummy", "", nil, nil)