smart_titles 0.4.0 → 0.4.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,7 @@
1
1
  ---
2
- !binary "U0hBMQ==":
3
- metadata.gz: !binary |-
4
- ZmM2MjRlNTYzMzZhNDdmM2ZkNmIzNDQ3MTExN2I1NzQ5ZDU0YjYwYw==
5
- data.tar.gz: !binary |-
6
- NzM4Y2Q3YjRmNzI0ZWM3NDljYjcwYjVjYTkwNTE5NTUzOGViN2M5Ng==
7
- !binary "U0hBNTEy":
8
- metadata.gz: !binary |-
9
- YzBlNGY3YzgzMTg2YTYwM2JmYTUzMzI1MGIzNWViZjVkMWYyM2ZiODkxNmZi
10
- MWNhMjY3Y2M0Yzk4MmVjOTMyYzhhYzBjNjE0ZTdjNWE1MTRiYTRkODUzM2Q5
11
- ZjVhMTc5NDdhNzkzY2NkMTc2NTdmMTQwYjVkM2UyNmM2MDBmYTc=
12
- data.tar.gz: !binary |-
13
- MTM2ODMyZDU1NzY3ZDVkODNiOTEzODg0YzY1ZTYxOWFlY2MxOTdiMDRhMmY1
14
- YjgxMDcwYWVmMzNmOTVlMTUxOTZjNTFjN2RiNWUyYTQ2MmZmNTNlM2EyNWI4
15
- ZTQ0Y2QwMzQ3MzhlNmViYTAzMDA5NDFkNmI5N2FkYzA4ODI4Y2U=
2
+ SHA1:
3
+ metadata.gz: 169123fe04d64048f27bc19d1b846c7259d0caf3
4
+ data.tar.gz: a82477fa9f9b231e0db25a1d47dfd79fa8610170
5
+ SHA512:
6
+ metadata.gz: c599748e4160dcb4f62d1edf15efdb502852f10040c28e1e69f5fcf3f73a756c828ed9c276cf578888bf20c8a4998e8f0b580fd6918a3ade3261533e8e1f75a0
7
+ data.tar.gz: 169da91edabc4395076f3f62045f0dcdbd86bd383681726f311c473d14ea9b0499526f0ead181b330d77ce702c7c1512264f5b4291e05bdf358854c46a237aec
data/Readme.md CHANGED
@@ -80,6 +80,21 @@ And now products#index page will have "Products from the Coolest Store" browser'
80
80
  Changelog
81
81
  ---
82
82
 
83
+ ### 0.4.1
84
+ This update fixes XSS vulnerability introduced in 0.3.2. H1 tag returned by "title" would skip HTML-escaping.
85
+ Your app is affected if you include untrusted user input in the title and output the tag:
86
+
87
+ <%= title post.title %>
88
+ <%= title "My blog - #{post.title}" %>
89
+
90
+ Not affected:
91
+
92
+ <% title post.title %> - no output
93
+ <%= title category.name %> - if your categories are not edited by users
94
+
95
+ You are advised to upgrade. Alternatively, you can downgrade to 0.3.1 or below.
96
+ Versions affected: 0.3.2, 0.4.0.
97
+
83
98
  ### 0.4.0
84
99
  The website title and template translations can now be scoped by layout. Example:
85
100
 
@@ -41,8 +41,7 @@ module SmartTitles
41
41
  rescue I18n::MissingTranslationData
42
42
  end
43
43
 
44
- title &&= title.html_safe
45
- provide(:page_title, title)
44
+ provide(:page_title, title && title.html_safe) # "provide" already escapes
46
45
  content_tag(:h1, title) if title
47
46
  end
48
47
  end
@@ -1,3 +1,3 @@
1
1
  module SmartTitles
2
- VERSION = "0.4.0"
2
+ VERSION = "0.4.1"
3
3
  end
@@ -63,7 +63,7 @@ class SmartTitlesHelperTest < ActionView::TestCase
63
63
  end
64
64
 
65
65
  def test_head_title_with_no_title
66
- assert_includes head_title, "translation missing: en.title"
66
+ assert_includes head_title, "translation missing"
67
67
  end
68
68
 
69
69
 
@@ -116,8 +116,9 @@ class SmartTitlesHelperTest < ActionView::TestCase
116
116
  end
117
117
 
118
118
  def test_head_title_is_not_double_escaped
119
- title 'New "post"'
119
+ result = title 'New "post"'
120
120
  assert_equal 'New &quot;post&quot;', h(head_title)
121
+ assert_equal '<h1>New &quot;post&quot;</h1>', h(result)
121
122
  end
122
123
 
123
124
 
metadata CHANGED
@@ -1,43 +1,43 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: smart_titles
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Semyon Perepelitsa
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-05-23 00:00:00.000000000 Z
11
+ date: 2013-12-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
- prerelease: false
15
14
  name: activesupport
16
- version_requirements: !ruby/object:Gem::Requirement
17
- requirements:
18
- - - ! '>='
19
- - !ruby/object:Gem::Version
20
- version: '0'
21
15
  requirement: !ruby/object:Gem::Requirement
22
16
  requirements:
23
- - - ! '>='
17
+ - - '>='
24
18
  - !ruby/object:Gem::Version
25
19
  version: '0'
26
20
  type: :runtime
27
- - !ruby/object:Gem::Dependency
28
21
  prerelease: false
29
- name: actionpack
30
22
  version_requirements: !ruby/object:Gem::Requirement
31
23
  requirements:
32
- - - ! '>='
24
+ - - '>='
33
25
  - !ruby/object:Gem::Version
34
26
  version: '0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: actionpack
35
29
  requirement: !ruby/object:Gem::Requirement
36
30
  requirements:
37
- - - ! '>='
31
+ - - '>='
38
32
  - !ruby/object:Gem::Version
39
33
  version: '0'
40
34
  type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '>='
39
+ - !ruby/object:Gem::Version
40
+ version: '0'
41
41
  description:
42
42
  email: sema@sema.in
43
43
  executables: []
@@ -68,17 +68,17 @@ require_paths:
68
68
  - lib
69
69
  required_ruby_version: !ruby/object:Gem::Requirement
70
70
  requirements:
71
- - - ! '>='
71
+ - - '>='
72
72
  - !ruby/object:Gem::Version
73
73
  version: '0'
74
74
  required_rubygems_version: !ruby/object:Gem::Requirement
75
75
  requirements:
76
- - - ! '>='
76
+ - - '>='
77
77
  - !ruby/object:Gem::Version
78
78
  version: '0'
79
79
  requirements: []
80
80
  rubyforge_project:
81
- rubygems_version: 2.0.3
81
+ rubygems_version: 2.1.11
82
82
  signing_key:
83
83
  specification_version: 4
84
84
  summary: Really convenient way to set up page titles in a Rails application.