govuk_publishing_components 13.1 → 13.2.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e1a042523ef71aff602f228aa3916918363168cc82423775a0e7c305527f9165
4
- data.tar.gz: ea84c5d9b0f1b5eaf85baddbb62ca91948c61b4c3381e44b130240ece1c07c59
3
+ metadata.gz: a6ae1813c5f24b844139e7a5d57697718fc515e14a20fc5e3f5337474d085c98
4
+ data.tar.gz: d2212c52c0b6ee05d6edc95621faf347726fce80d84bc562ba24c163af92d91b
5
5
  SHA512:
6
- metadata.gz: f644184cc8dbbfe0c85a5312e3f4caa789ee4c4b1177505c835bafad1ba3ac45e6d4d2f6bcba60ac11261c58a7398f810cab9a82c59aa8f04be60cb4bf85f4f8
7
- data.tar.gz: 96b16387733e32766bdd067ed9f611184797de877f770bb0faacdfd971ebebd5d17c6ddf48a3864581698e28a874dcf0b3c476fcd9a5b9a0b643bffcf36b1dec
6
+ metadata.gz: 4cb079269b5f24931adb289c8eafb83f450ec4601d577dc6fc1a40aed673f6e713e60a62c322b861d52d5b1169581320a44082c13b6f692a480f881013549dd4
7
+ data.tar.gz: a44bf1a137d8fe11d3dd1f0547b162ff998525ff1fdbf7eb9bd2f17365ec0dcf7364bae12917ec9f0b006c029c1a5b292aa3e772fb012f3b4dc2a59a06191d72
@@ -3,9 +3,13 @@
3
3
  margin_top ||= 1
4
4
  margin_top_class = "gem-c-feedback--top-margin" if margin_top == 1
5
5
  email_regex = /[^\s=\/?&]+(?:@|%40)[^\s=\/?&]+/
6
- stripped_path = request.original_url.gsub(email_regex, '[email]').encode
7
- stripped_url = request.fullpath.gsub(email_regex, '[email]').encode
8
- user_agent = request.user_agent.encode
6
+ stripped_path = request.original_url.gsub(email_regex, '[email]')
7
+ stripped_url = request.fullpath.gsub(email_regex, '[email]')
8
+ user_agent = request.user_agent
9
+
10
+ def utf_encode element
11
+ element.is_a?(String) ? element.encode : element
12
+ end
9
13
  %>
10
14
 
11
15
  <div class="gem-c-feedback <%= margin_top_class %>" data-module="feedback">
@@ -90,8 +94,8 @@
90
94
  <div class="gem-c-feedback__column-two-thirds">
91
95
  <div class="gem-c-feedback__error-summary gem-c-feedback__js-show js-hidden js-errors" tabindex="-1"></div>
92
96
 
93
- <input type="hidden" name="url" value="<%= stripped_path -%>">
94
- <input type="hidden" name="user_agent" value="<%= user_agent -%>">
97
+ <input type="hidden" name="url" value="<%= utf_encode(stripped_path) -%>">
98
+ <input type="hidden" name="user_agent" value="<%= utf_encode(user_agent) -%>">
95
99
 
96
100
  <h3 class="gem-c-feedback__form-heading">Help us improve GOV.UK</h3>
97
101
  <p id="feedback_explanation" class="gem-c-feedback__form-paragraph">Don’t include personal or financial information like your National Insurance number or credit card details.</p>
@@ -136,11 +140,11 @@
136
140
  <div class="gem-c-feedback__column-two-thirds">
137
141
  <div class="gem-c-feedback__error-summary js-hidden js-errors" tabindex="-1"></div>
138
142
 
139
- <input type="hidden" name="url" value="<%= stripped_path -%>">
140
- <input type="hidden" name="user_agent" value="<%= user_agent -%>">
143
+ <input type="hidden" name="url" value="<%= utf_encode(stripped_path) -%>">
144
+ <input type="hidden" name="user_agent" value="<%= utf_encode(user_agent) -%>">
141
145
 
142
146
  <input name="email_survey_signup[survey_id]" type="hidden" value="footer_satisfaction_survey">
143
- <input name="email_survey_signup[survey_source]" type="hidden" value="<%= stripped_path -%>">
147
+ <input name="email_survey_signup[survey_source]" type="hidden" value="<%= utf_encode(stripped_path) -%>">
144
148
  <input name="email_survey_signup[ga_client_id]" type="hidden" value="1627485790.1515403243">
145
149
 
146
150
  <h3 class="gem-c-feedback__form-heading">Help us improve GOV.UK</h3>
@@ -158,7 +162,7 @@
158
162
  <%= render "govuk_publishing_components/components/button", {
159
163
  text: "Send me the survey"
160
164
  } %>
161
- <a href="https://www.smartsurvey.co.uk/s/gov-uk-banner/?c=<%= stripped_url -%>&amp;gcl=1627485790.1515403243" class="gem-c-feedback__email-link govuk-link" id="take-survey" target="_blank" rel="noopener noreferrer">Don’t have an email address?</a>
165
+ <a href="https://www.smartsurvey.co.uk/s/gov-uk-banner/?c=<%= utf_encode(stripped_url) -%>&amp;gcl=1627485790.1515403243" class="gem-c-feedback__email-link govuk-link" id="take-survey" target="_blank" rel="noopener noreferrer">Don’t have an email address?</a>
162
166
  </div>
163
167
  </div>
164
168
  </form>
@@ -1,3 +1,3 @@
1
1
  module GovukPublishingComponents
2
- VERSION = '13.1'.freeze
2
+ VERSION = '13.2.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: govuk_publishing_components
3
3
  version: !ruby/object:Gem::Version
4
- version: '13.1'
4
+ version: 13.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - GOV.UK Dev