https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43258 Bug ID: 43258 Summary: Add a centralized IP range matching helper Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement Priority: P5 - low Component: Architecture, internals, and plumbing Assignee: koha-bugs@lists.koha-community.org Reporter: tomascohen@gmail.com QA Contact: testopia@bugs.koha-community.org Depends on: 20846 Target Milestone: --- Several OPAC features check whether the client IP matches a configured range (OpacSuppressionByIPRange, RestrictedPageLocalIPs, SelfCheckAllowByIPRanges, etc). Each repeats the same inline pattern: my $ip_address = $ENV{'REMOTE_ADDR'}; my $in_range = ( $ip_address =~ /^$ip_range/ ); This should be centralized into a helper method (e.g. on C4::Context or a utility class) so callers can simply ask 'does the current request match this range?' without reimplementing the logic. A centralized helper would also be the right place to: - Handle edge cases (undef REMOTE_ADDR, empty range) - Document that the matching is regex-based, not CIDR - Eventually support CIDR notation if needed Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=20846 [Bug 20846] Suppressed records still appear in public lists -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.