mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2024-11-10 17:36:33 +08:00
Merge pull request #642 from mz3944/mz-SCI-1291
Fixed permission error while cloning workflows. [fixes SCI-1291]
This commit is contained in:
commit
d83dcac894
1 changed files with 9 additions and 4 deletions
|
@ -73,10 +73,10 @@ class CanvasController < ApplicationController
|
|||
poss = update_params[:positions].split(";")
|
||||
center = ""
|
||||
(poss.collect { |pos| pos.split(",") }).each_with_index do |pos, index|
|
||||
unless (pos.length == 3 and
|
||||
pos[0].is_a? String and
|
||||
is_int? pos[1] and
|
||||
is_int? pos[2])
|
||||
unless pos.length == 3 &&
|
||||
pos[0].is_a?(String) &&
|
||||
float?(pos[1]) &&
|
||||
float?(pos[2])
|
||||
error = true
|
||||
break
|
||||
end
|
||||
|
@ -318,4 +318,9 @@ class CanvasController < ApplicationController
|
|||
/\A[-+]?\d+\z/ === val
|
||||
end
|
||||
|
||||
def float?(val)
|
||||
true if Float(val)
|
||||
rescue ArgumentError
|
||||
false
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue