govuk_content_models 44.3.0 → 44.4.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/app/models/artefact.rb +0 -15
- data/lib/govuk_content_models/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd932fc22c47acdf2d812e077c1eaecb052dde18
|
4
|
+
data.tar.gz: 60dc5aae190c48f6913bc228a810d68c1d752132
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 357e4c449867964488308bf8c21b16de1674271c33989ee2c3fa7578276d0761d539285b50a36664955c0f7be9b87f21ff2f187018be10770abae2f11e73a729
|
7
|
+
data.tar.gz: b4f458e6b3e57574c15534d9b528d75841c9a8e5ad3b0b6aca43b829e8cd6b300402ea404463fc31def799aa32ea34f6181fafd8d204f23e765f6955bfc4d254
|
data/CHANGELOG.md
CHANGED
data/app/models/artefact.rb
CHANGED
@@ -155,7 +155,6 @@ class Artefact
|
|
155
155
|
validates_with CannotEditSlugIfEverPublished
|
156
156
|
validate :validate_prefixes_and_paths
|
157
157
|
validate :format_of_new_need_ids, if: :need_ids_changed?
|
158
|
-
validate :validate_redirect_url
|
159
158
|
|
160
159
|
def self.in_alphabetical_order
|
161
160
|
order_by(name: :asc)
|
@@ -334,18 +333,4 @@ class Artefact
|
|
334
333
|
rescue URI::InvalidURIError
|
335
334
|
false
|
336
335
|
end
|
337
|
-
|
338
|
-
def validate_redirect_url
|
339
|
-
return unless self.redirect_url.present?
|
340
|
-
unless valid_redirect_url_path?(self.redirect_url)
|
341
|
-
errors[:redirect_url] << "is not a valid redirect target"
|
342
|
-
end
|
343
|
-
end
|
344
|
-
|
345
|
-
def valid_redirect_url_path?(target)
|
346
|
-
URI.parse(target)
|
347
|
-
target.starts_with?("/") && target !~ %r{//} && target !~ %r{./\z}
|
348
|
-
rescue URI::InvalidURIError
|
349
|
-
false
|
350
|
-
end
|
351
336
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: govuk_content_models
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 44.
|
4
|
+
version: 44.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Paul Battley
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-04-
|
11
|
+
date: 2017-04-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bson_ext
|