https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43540
--- Comment #1 from Martin Renvoize (ashimema) <[email protected]> --- Created attachment 205886 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=205886&action=edit Bug 43540: Recognize /bib/ short URL as local in local_referer Koha ships an Apache RewriteRule for /bib/<biblionumber> short URLs (apache-shared-opac.conf, apache-shared-intranet.conf, koha-httpd.conf) using the [PT] flag, so the rewrite happens internally - the browser's Referer header keeps showing /bib/<id>, never /cgi-bin/koha/.... Koha::Util::Navigation::local_referer(), used by opac-changelanguage.pl and changelanguage.pl to redirect back to the referring page after a language switch, only recognized a referer as local if it matched the site's base URL AND contained the literal substring /cgi-bin/koha/. Since /bib/<id> never contains that substring, the language switch fell back to the site root, dropping the user on the homepage instead of returning them to the record they were viewing. This patch extends local_referer()'s recognized local-path pattern to also accept /bib/<digits>, in both the base-URL branch and the no-base-URL fallback branch. Test plan: 1. Enable mod_rewrite and confirm /bib/<biblionumber> loads the same page as opac-detail.pl?biblionumber=<biblionumber>. 2. On that page, switch OPAC language via the language selector. 3. Before this patch: redirected to the OPAC homepage. 4. After this patch: redirected back to /bib/<biblionumber>. 5. prove t/Koha/Util/Navigation.t - all tests pass. Co-Authored-By: Claude Sonnet 5 <[email protected]> -- You are receiving this mail because: You are watching all bug changes. _______________________________________________ Koha-bugs mailing list -- [email protected] To unsubscribe send an email to [email protected] website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
