-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into 4535-record-email-portfolio
- Loading branch information
Showing
6 changed files
with
46 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# frozen_string_literal: true | ||
module Orangelight | ||
module ExcessivePaging | ||
private | ||
|
||
def deny_excessive_paging | ||
page = params[:page].to_i || 0 | ||
return if page <= 1 | ||
return if (has_search_parameters? || advanced_search? || bookmarks_page?) && page < 1000 | ||
render plain: "excessive paging", status: :bad_request | ||
end | ||
|
||
def advanced_search? | ||
%w[advanced numismatics].include?(params[:advanced_type]) || | ||
params[:search_field] == 'advanced' || | ||
%w[advanced numismatics].include?(action_name) | ||
end | ||
|
||
def bookmarks_page? | ||
instance_of?(BookmarksController) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters