postrank-uri 1.0.14 → 1.0.15

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,5 +1,5 @@
1
1
  module PostRank
2
2
  module URI
3
- VERSION = "1.0.14"
3
+ VERSION = "1.0.15"
4
4
  end
5
5
  end
data/lib/postrank-uri.rb CHANGED
@@ -200,7 +200,7 @@ module PostRank
200
200
 
201
201
  uri = Addressable::URI.parse(uri)
202
202
 
203
- unless uri.host
203
+ if !uri.host && uri.scheme !~ /^javascript|mailto|xmpp$/
204
204
  if uri.scheme
205
205
  # With no host and scheme yes, the parser exploded
206
206
  return parse("http://#{uri}", opts)
@@ -320,5 +320,17 @@ describe PostRank::URI do
320
320
  it 'should not fail on large host-part look-alikes' do
321
321
  PostRank::URI.parse('a'*64+'.ca').host.should == nil
322
322
  end
323
+
324
+ it 'should not pancake javascript scheme URIs' do
325
+ PostRank::URI.parse('javascript:void(0);').scheme.should == 'javascript'
326
+ end
327
+
328
+ it 'should not pancake mailto scheme URIs' do
329
+ PostRank::URI.parse('mailto:void(0);').scheme.should == 'mailto'
330
+ end
331
+
332
+ it 'should not pancake xmpp scheme URIs' do
333
+ PostRank::URI.parse('xmpp:void(0);').scheme.should == 'xmpp'
334
+ end
323
335
  end
324
336
  end
metadata CHANGED
@@ -1,8 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: postrank-uri
3
3
  version: !ruby/object:Gem::Version
4
+ hash: 9
4
5
  prerelease:
5
- version: 1.0.14
6
+ segments:
7
+ - 1
8
+ - 0
9
+ - 15
10
+ version: 1.0.15
6
11
  platform: ruby
7
12
  authors:
8
13
  - Ilya Grigorik
@@ -10,7 +15,7 @@ autorequire:
10
15
  bindir: bin
11
16
  cert_chain: []
12
17
 
13
- date: 2011-05-18 00:00:00 -04:00
18
+ date: 2011-05-19 00:00:00 -04:00
14
19
  default_executable:
15
20
  dependencies:
16
21
  - !ruby/object:Gem::Dependency
@@ -21,6 +26,11 @@ dependencies:
21
26
  requirements:
22
27
  - - ">="
23
28
  - !ruby/object:Gem::Version
29
+ hash: 1
30
+ segments:
31
+ - 2
32
+ - 2
33
+ - 3
24
34
  version: 2.2.3
25
35
  type: :runtime
26
36
  version_requirements: *id001
@@ -32,6 +42,9 @@ dependencies:
32
42
  requirements:
33
43
  - - ">="
34
44
  - !ruby/object:Gem::Version
45
+ hash: 3
46
+ segments:
47
+ - 0
35
48
  version: "0"
36
49
  type: :runtime
37
50
  version_requirements: *id002
@@ -43,6 +56,9 @@ dependencies:
43
56
  requirements:
44
57
  - - ">="
45
58
  - !ruby/object:Gem::Version
59
+ hash: 3
60
+ segments:
61
+ - 0
46
62
  version: "0"
47
63
  type: :runtime
48
64
  version_requirements: *id003
@@ -54,6 +70,9 @@ dependencies:
54
70
  requirements:
55
71
  - - ">="
56
72
  - !ruby/object:Gem::Version
73
+ hash: 3
74
+ segments:
75
+ - 0
57
76
  version: "0"
58
77
  type: :development
59
78
  version_requirements: *id004
@@ -93,12 +112,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
93
112
  requirements:
94
113
  - - ">="
95
114
  - !ruby/object:Gem::Version
115
+ hash: 3
116
+ segments:
117
+ - 0
96
118
  version: "0"
97
119
  required_rubygems_version: !ruby/object:Gem::Requirement
98
120
  none: false
99
121
  requirements:
100
122
  - - ">="
101
123
  - !ruby/object:Gem::Version
124
+ hash: 3
125
+ segments:
126
+ - 0
102
127
  version: "0"
103
128
  requirements: []
104
129