Fixed permission error while cloning workflows. [fixes SCI-1291]

This commit is contained in:
Matej Zrimšek 2017-05-26 11:13:27 +02:00
parent 6b8c8deb16
commit 853096634d

View file

@ -73,10 +73,10 @@ class CanvasController < ApplicationController
poss = update_params[:positions].split(";") poss = update_params[:positions].split(";")
center = "" center = ""
(poss.collect { |pos| pos.split(",") }).each_with_index do |pos, index| (poss.collect { |pos| pos.split(",") }).each_with_index do |pos, index|
unless (pos.length == 3 and unless pos.length == 3 &&
pos[0].is_a? String and pos[0].is_a?(String) &&
is_int? pos[1] and float?(pos[1]) &&
is_int? pos[2]) float?(pos[2])
error = true error = true
break break
end end
@ -318,4 +318,9 @@ class CanvasController < ApplicationController
/\A[-+]?\d+\z/ === val /\A[-+]?\d+\z/ === val
end end
def float?(val)
true if Float(val)
rescue ArgumentError
false
end
end end