68e31c098e
[10.4] Fix GH namespace security issue
17 lines
443 B
Ruby
17 lines
443 B
Ruby
class Import::BaseController < ApplicationController
|
|
private
|
|
|
|
def find_or_create_namespace(names, owner)
|
|
names = params[:target_namespace].presence || names
|
|
|
|
return current_user.namespace if names == owner
|
|
|
|
group = Groups::NestedCreateService.new(current_user, group_path: names).execute
|
|
|
|
group.errors.any? ? current_user.namespace : group
|
|
rescue => e
|
|
Gitlab::AppLogger.error(e)
|
|
|
|
current_user.namespace
|
|
end
|
|
end
|