Current behavior of the OPAC_SEARCH_LIMIT variable (set in httpd.conf) is to add a hidden HTML input in masthead.inc. This works, but makes it easy to override the limit by altering the URL.
Created attachment 69335 [details] [review] Bug 19691 - Move code to opac-search.pl Removes the hidden input from masthead.inc, and adds a line to opac-search.pl to enforce the limit. Test plan: Before: 0) Set OPAC_SEARCH_LIMIT and OPAC_LIMIT_OVERRIDE to valid values in koha-httpd.conf (they should be commented) 1) Reload apache 2) Perform a search in the OPAC. You'll see the limit you specified appended to the URL and reflected in the results. 3) Manually remove the limit from the URL and load the page; the search results will not reflect the limit. After: 0) With the same apache config 1) Perform a search from the OPAC. The limit will not show up in the URL, but will be reflected in the search results. There should be no way of circumventing the limit.
Hi there Can you please rebase this as it is not applying cleanly on master as the below output shows: Apply? [(y)es, (n)o, (i)nteractive] y Applying: Bug 19691 - Move code to opac-search.pl Using index info to reconstruct a base tree... M koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc M opac/opac-search.pl Falling back to patching base and 3-way merge... Auto-merging opac/opac-search.pl Auto-merging koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc CONFLICT (content): Merge conflict in koha-tmpl/opac-tmpl/bootstrap/en/includes/masthead.inc Failed to merge in the changes. Patch failed at 0001 Bug 19691 - Move code to opac-search.pl The copy of the patch that failed is found in: /home/vagrant/kohaclone/.git/rebase-apply/patch When you have resolved this problem run "git bz apply --continue". If you would prefer to skip this patch, instead run "git bz apply --skip". To restore the original branch and stop patching run "git bz apply --abort". Patch left in /tmp/Bug-19691---Move-code-to-opac-searchpl-BrIj3i.patch Cheers, Alex
In this case remove also code from C4::Auth opac_search_limit => $opac_search_limit,