el_finder 1.1.7 → 1.1.8
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/el_finder/connector.rb +2 -2
- data/lib/el_finder/mime_type.rb +1 -0
- data/lib/el_finder/pathname.rb +4 -4
- data/lib/el_finder/version.rb +2 -2
- metadata +2 -2
data/lib/el_finder/connector.rb
CHANGED
@@ -42,8 +42,8 @@ module ElFinder
|
|
42
42
|
def initialize(options)
|
43
43
|
@options = DEFAULT_OPTIONS.merge(options)
|
44
44
|
|
45
|
-
raise(ArgumentError, "Missing required :url option") unless @options.key?(:url)
|
46
|
-
raise(ArgumentError, "Missing required :root option") unless @options.key?(:root)
|
45
|
+
raise(ArgumentError, "Missing required :url option") unless @options.key?(:url)
|
46
|
+
raise(ArgumentError, "Missing required :root option") unless @options.key?(:root)
|
47
47
|
raise(ArgumentError, "Mime Handler is invalid") unless mime_handler.respond_to?(:for)
|
48
48
|
raise(ArgumentError, "Image Handler is invalid") unless image_handler.nil? || ([:size, :resize, :thumbnail].all?{|m| image_handler.respond_to?(m)})
|
49
49
|
|
data/lib/el_finder/mime_type.rb
CHANGED
data/lib/el_finder/pathname.rb
CHANGED
@@ -10,7 +10,7 @@ module ElFinder
|
|
10
10
|
def initialize(root, path = '.')
|
11
11
|
@root = root.is_a?(ElFinder::Pathname) ? root.root : ::Pathname.new(root)
|
12
12
|
|
13
|
-
@path = ::Pathname.new(path)
|
13
|
+
@path = ::Pathname.new(path)
|
14
14
|
@path = path.is_a?(ElFinder::Pathname) ? path.path : ::Pathname.new(path)
|
15
15
|
if absolute?
|
16
16
|
if @path.cleanpath.to_s.start_with?(@root.to_s)
|
@@ -18,13 +18,13 @@ module ElFinder
|
|
18
18
|
elsif @path.cleanpath.to_s.start_with?(@root.realpath.to_s)
|
19
19
|
@path = ::Pathname.new @path.to_s.slice((@root.realpath.to_s.length + 1)..-1)
|
20
20
|
else
|
21
|
-
raise SecurityError, "Absolute paths are not allowed"
|
21
|
+
raise SecurityError, "Absolute paths are not allowed"
|
22
22
|
end
|
23
23
|
end
|
24
24
|
raise SecurityError, "Paths outside the root are not allowed" if outside_of_root?
|
25
25
|
|
26
26
|
end # of initialize
|
27
|
-
|
27
|
+
|
28
28
|
#
|
29
29
|
def +(other)
|
30
30
|
if other.is_a? ::ElFinder::Pathname
|
@@ -118,7 +118,7 @@ module ElFinder
|
|
118
118
|
def relative_to(other)
|
119
119
|
@path.relative_path_from(other)
|
120
120
|
end
|
121
|
-
|
121
|
+
|
122
122
|
#
|
123
123
|
def unique
|
124
124
|
return self.dup unless self.file?
|
data/lib/el_finder/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: el_finder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.1.
|
4
|
+
version: 1.1.8
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-06-04 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: image_size
|