Skip to content

Commit

Permalink
URI.encode is removed, use CGI.unescape
Browse files Browse the repository at this point in the history
  • Loading branch information
hennevogel committed Mar 14, 2022
1 parent 9e89628 commit cb82a8d
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src/api/app/controllers/group_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def update

# POST for editing it, adding or remove users
def command
group = Group.find_by_title!(URI.unescape(params[:title]))
group = Group.find_by_title!(CGI.unescape(params[:title]))
authorize group, :update?

user = User.find_by_login!(params[:userid]) if params[:userid]
Expand Down
4 changes: 2 additions & 2 deletions src/api/app/controllers/person_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,9 @@ def change_my_password

login = xml.elements['/userchangepasswd/login'].text
password = xml.elements['/userchangepasswd/password'].text
login = URI.unescape(login)
login = CGI.unescape(login)

change_password(login, URI.unescape(password))
change_password(login, CGI.unescape(password))
render_ok
end

Expand Down
2 changes: 1 addition & 1 deletion src/api/app/models/package_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ class PackageFile < Backend::File

# calculates the real url on the backend to search the file
def full_path(query = {})
URI.encode("/source/#{project_name}/#{package_name}/#{name}") + "?#{query.to_query}"
CGI.unescape("/source/#{project_name}/#{package_name}/#{name}") + "?#{query.to_query}"
end
end
2 changes: 1 addition & 1 deletion src/api/app/models/project_config_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def initialize(attributes = {})

# calculates the real url on the backend to search the file
def full_path(query = {})
URI.encode("/source/#{project_name}/#{name}") + "?#{query.to_query}"
CGI.unescape("/source/#{project_name}/#{name}") + "?#{query.to_query}"
end

# You dont want to change name of _config
Expand Down
2 changes: 1 addition & 1 deletion src/api/app/models/project_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,6 @@ class ProjectFile < Backend::File

# calculates the real url on the backend to search the file
def full_path(query = {})
URI.encode("/source/#{project_name}/_project/#{name}") + "?#{query.to_query}"
CGI.unescape("/source/#{project_name}/_project/#{name}") + "?#{query.to_query}"
end
end
2 changes: 1 addition & 1 deletion src/api/app/models/project_meta_file.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ def initialize(attributes = {})

# calculates the real url on the backend to search the file
def full_path(query = {})
URI.encode("/source/#{project_name}/#{name}") + "?#{query.to_query}"
CGI.unescape("/source/#{project_name}/#{name}") + "?#{query.to_query}"
end

# You dont want to change name of _meta
Expand Down
2 changes: 1 addition & 1 deletion src/api/spec/models/backend/file_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
attr_accessor :somefile

def full_path(_query)
URI.encode(somefile)
CGI.unescape(somefile)
end
end
end
Expand Down

0 comments on commit cb82a8d

Please sign in to comment.