publify_core 10.0.2 → 10.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +20 -0
- data/app/controllers/admin/articles_controller.rb +1 -1
- data/app/controllers/admin/notes_controller.rb +11 -2
- data/app/controllers/admin/seo_controller.rb +5 -1
- data/app/controllers/admin/settings_controller.rb +1 -1
- data/app/controllers/admin/sidebar_controller.rb +4 -2
- data/app/models/config_manager.rb +8 -0
- data/app/uploaders/resource_uploader.rb +10 -4
- data/lib/publify_core/testing_support/fixtures/like_plain.html +2 -0
- data/lib/publify_core/version.rb +1 -1
- metadata +4 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: cb863f2b83b8da8700912e96e0c744d024e7a3e4ffa362d9ad935f058ce9e9a5
|
|
4
|
+
data.tar.gz: 49608e62a576f90c263501a080e78aa54aa9c46277ef49e8d7fbde9af7891ca4
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d5d506b38f535284cc378b38d22afc611036ababfc81a5c8be05afe6736128fc76f6dd3639997ee7a7b3180e27d4071ab07cf1c5f69ad4c8f90093a384f0e94b
|
|
7
|
+
data.tar.gz: a1fa53f2e4d0ceffc96b32f67961cb23b09806c4ded69bdba2fffbcad4dbd4198694b2f145fb6a4971f9e4bfd7ce7c6edd1a0ef1347af5245739519be3676324
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 10.0.4 / 2026-10-04
|
|
4
|
+
|
|
5
|
+
* Refuse attempts to upload a file detected as text with an html extension ([#267] by [mvz])
|
|
6
|
+
|
|
7
|
+
[#267]: https://github.com/publify/publify_core/pull/267
|
|
8
|
+
|
|
9
|
+
## 10.0.3 / 2025-03-28
|
|
10
|
+
|
|
11
|
+
* Limit accepted parameters for Sidebar update in Admin ([#159] by [mvz])
|
|
12
|
+
* Use known set of allowed attributes when autosaving an Article ([#160] by [mvz])
|
|
13
|
+
* Permit only valid settings keys when updating blog settings ([#161] by [mvz])
|
|
14
|
+
* Limit assigned attributes when creating and updating Notes ([#162] by [mvz])
|
|
15
|
+
* Limit allowed SEO settings params ([#163] by [mvz])
|
|
16
|
+
|
|
17
|
+
[#159]: https://github.com/publify/publify_core/pull/159
|
|
18
|
+
[#160]: https://github.com/publify/publify_core/pull/160
|
|
19
|
+
[#161]: https://github.com/publify/publify_core/pull/161
|
|
20
|
+
[#162]: https://github.com/publify/publify_core/pull/162
|
|
21
|
+
[#163]: https://github.com/publify/publify_core/pull/163
|
|
22
|
+
|
|
3
23
|
## 10.0.2 / 2024-06-28
|
|
4
24
|
|
|
5
25
|
### Security updates
|
|
@@ -108,7 +108,7 @@ class Admin::ArticlesController < Admin::BaseController
|
|
|
108
108
|
|
|
109
109
|
fetch_fresh_or_existing_draft_for_article
|
|
110
110
|
|
|
111
|
-
@article.
|
|
111
|
+
@article.assign_attributes(update_params)
|
|
112
112
|
|
|
113
113
|
@article.author = current_user
|
|
114
114
|
@article.save_attachments!(params[:attachments])
|
|
@@ -23,7 +23,7 @@ class Admin::NotesController < Admin::BaseController
|
|
|
23
23
|
note = new_note
|
|
24
24
|
|
|
25
25
|
note.state = "published"
|
|
26
|
-
note.
|
|
26
|
+
note.assign_attributes(note_params)
|
|
27
27
|
note.text_filter ||= default_text_filter
|
|
28
28
|
note.published_at ||= Time.zone.now
|
|
29
29
|
if note.save
|
|
@@ -41,7 +41,7 @@ class Admin::NotesController < Admin::BaseController
|
|
|
41
41
|
end
|
|
42
42
|
|
|
43
43
|
def update
|
|
44
|
-
@note.
|
|
44
|
+
@note.assign_attributes(note_params)
|
|
45
45
|
@note.save
|
|
46
46
|
redirect_to admin_notes_url
|
|
47
47
|
end
|
|
@@ -54,6 +54,15 @@ class Admin::NotesController < Admin::BaseController
|
|
|
54
54
|
|
|
55
55
|
private
|
|
56
56
|
|
|
57
|
+
def note_params
|
|
58
|
+
params.require(:note).permit(:text_filter_name,
|
|
59
|
+
:body,
|
|
60
|
+
:push_to_twitter,
|
|
61
|
+
:in_reply_to_status_id,
|
|
62
|
+
:permalink,
|
|
63
|
+
:published_at)
|
|
64
|
+
end
|
|
65
|
+
|
|
57
66
|
def load_existing_notes
|
|
58
67
|
@notes = Note.page(params[:page]).per(this_blog.limit_article_display)
|
|
59
68
|
end
|
|
@@ -30,7 +30,11 @@ class Admin::SeoController < Admin::BaseController
|
|
|
30
30
|
private
|
|
31
31
|
|
|
32
32
|
def settings_params
|
|
33
|
-
@settings_params ||= params.require(:setting).permit
|
|
33
|
+
@settings_params ||= params.require(:setting).permit(settings_keys)
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
def settings_keys
|
|
37
|
+
@setting.settings_keys + [:custom_permalink]
|
|
34
38
|
end
|
|
35
39
|
|
|
36
40
|
VALID_SECTIONS = %w(general titles permalinks).freeze
|
|
@@ -36,7 +36,7 @@ class Admin::SettingsController < Admin::BaseController
|
|
|
36
36
|
VALID_ACTIONS = %w(index write feedback display).freeze
|
|
37
37
|
|
|
38
38
|
def settings_params
|
|
39
|
-
@settings_params ||= params.require(:setting).permit
|
|
39
|
+
@settings_params ||= params.require(:setting).permit(@setting.settings_keys)
|
|
40
40
|
end
|
|
41
41
|
|
|
42
42
|
def action_param
|
|
@@ -8,9 +8,11 @@ class Admin::SidebarController < Admin::BaseController
|
|
|
8
8
|
|
|
9
9
|
# Just update a single active Sidebar instance at once
|
|
10
10
|
def update
|
|
11
|
-
@sidebar = Sidebar.
|
|
11
|
+
@sidebar = Sidebar.find(params[:id])
|
|
12
12
|
@old_s_index = @sidebar.staged_position || @sidebar.active_position
|
|
13
|
-
@sidebar.update params
|
|
13
|
+
@sidebar.update params.require(:configure)
|
|
14
|
+
.require(@sidebar.id.to_s)
|
|
15
|
+
.permit(@sidebar.fields.map(&:key))
|
|
14
16
|
respond_to do |format|
|
|
15
17
|
format.js
|
|
16
18
|
format.html do
|
|
@@ -28,6 +28,10 @@ module ConfigManager
|
|
|
28
28
|
fields[key.to_s].default
|
|
29
29
|
end
|
|
30
30
|
|
|
31
|
+
def settings_keys
|
|
32
|
+
fields.keys
|
|
33
|
+
end
|
|
34
|
+
|
|
31
35
|
private
|
|
32
36
|
|
|
33
37
|
def add_setting_reader(item)
|
|
@@ -65,6 +69,10 @@ module ConfigManager
|
|
|
65
69
|
self.class.fields[key.to_s].canonicalize(value)
|
|
66
70
|
end
|
|
67
71
|
|
|
72
|
+
def settings_keys
|
|
73
|
+
self.class.settings_keys
|
|
74
|
+
end
|
|
75
|
+
|
|
68
76
|
class Item
|
|
69
77
|
VALID_TYPES = [:boolean, :integer, :string, :text].freeze
|
|
70
78
|
|
|
@@ -57,9 +57,11 @@ class ResourceUploader < CarrierWave::Uploader::Base
|
|
|
57
57
|
end
|
|
58
58
|
|
|
59
59
|
def check_content_type!(new_file)
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
60
|
+
detected_type = if image? new_file
|
|
61
|
+
type_from_content(new_file)
|
|
62
|
+
else
|
|
63
|
+
type_from_name(new_file)
|
|
64
|
+
end
|
|
63
65
|
if detected_type != new_file.content_type
|
|
64
66
|
raise CarrierWave::IntegrityError, "has MIME type mismatch"
|
|
65
67
|
end
|
|
@@ -67,7 +69,11 @@ class ResourceUploader < CarrierWave::Uploader::Base
|
|
|
67
69
|
|
|
68
70
|
private
|
|
69
71
|
|
|
70
|
-
def
|
|
72
|
+
def type_from_content(new_file)
|
|
71
73
|
Marcel::MimeType.for Pathname.new(new_file.path)
|
|
72
74
|
end
|
|
75
|
+
|
|
76
|
+
def type_from_name(new_file)
|
|
77
|
+
Marcel::MimeType.for Pathname.new(new_file.path), name: new_file.filename
|
|
78
|
+
end
|
|
73
79
|
end
|
data/lib/publify_core/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: publify_core
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 10.0.
|
|
4
|
+
version: 10.0.4
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Matijs van Zuijlen
|
|
@@ -11,7 +11,7 @@ authors:
|
|
|
11
11
|
autorequire:
|
|
12
12
|
bindir: bin
|
|
13
13
|
cert_chain: []
|
|
14
|
-
date:
|
|
14
|
+
date: 2026-10-04 00:00:00.000000000 Z
|
|
15
15
|
dependencies:
|
|
16
16
|
- !ruby/object:Gem::Dependency
|
|
17
17
|
name: aasm
|
|
@@ -1158,6 +1158,7 @@ files:
|
|
|
1158
1158
|
- lib/publify_core/testing_support/fixtures/exploit.svg
|
|
1159
1159
|
- lib/publify_core/testing_support/fixtures/fakepng.png
|
|
1160
1160
|
- lib/publify_core/testing_support/fixtures/just_some.html
|
|
1161
|
+
- lib/publify_core/testing_support/fixtures/like_plain.html
|
|
1161
1162
|
- lib/publify_core/testing_support/fixtures/otherfile.txt
|
|
1162
1163
|
- lib/publify_core/testing_support/fixtures/testfile.jpg
|
|
1163
1164
|
- lib/publify_core/testing_support/fixtures/testfile.png
|
|
@@ -1203,7 +1204,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
1203
1204
|
- !ruby/object:Gem::Version
|
|
1204
1205
|
version: '0'
|
|
1205
1206
|
requirements: []
|
|
1206
|
-
rubygems_version: 3.5.
|
|
1207
|
+
rubygems_version: 3.5.22
|
|
1207
1208
|
signing_key:
|
|
1208
1209
|
specification_version: 4
|
|
1209
1210
|
summary: Core engine for the Publify blogging system.
|