mirror of
https://github.com/System-End/hackatime.git
synced 2026-04-20 00:35:22 +00:00
fix broken validation
This commit is contained in:
parent
c299e26e67
commit
84ac41ad7e
1 changed files with 4 additions and 6 deletions
|
|
@ -248,8 +248,11 @@ module Api
|
|||
return render json: { error: "whatcha doin'?" }, status: :unprocessable_entity
|
||||
end
|
||||
|
||||
cool = %w[created_at deleted_at]
|
||||
not_cool = %w[INSERT UPDATE DELETE DROP CREATE ALTER TRUNCATE EXEC EXECUTE]
|
||||
if not_cool.any? { |keyword| query.upcase.include?(keyword) }
|
||||
|
||||
if not_cool.any? { |keyword| query.upcase.include?(keyword) } &&
|
||||
cool.none? { |field| query.upcase.include?(field.upcase) }
|
||||
return render json: { error: "no perms lmaooo" }, status: :forbidden
|
||||
end
|
||||
|
||||
|
|
@ -257,11 +260,6 @@ module Api
|
|||
return render json: { error: "no perms lmaooo" }, status: :forbidden
|
||||
end
|
||||
|
||||
cool = %w[created_at deleted_at]
|
||||
if query.upcase.match?(/\b(#{not_cool.join('|')})\b/) && !query.upcase.match?(/\b(#{cool.join('|')})\b/)
|
||||
return render json: { error: "no perms lmaooo" }, status: :forbidden
|
||||
end
|
||||
|
||||
begin
|
||||
limited_query = query.strip
|
||||
unless limited_query.upcase.include?("LIMIT")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue