Bug 34651

Summary: Searching system preferences - using a bracket ( either ( or ) ) generates an error trace
Product: Koha Reporter: David Nind <david>
Component: System AdministrationAssignee: Bugs List <koha-bugs>
Status: NEW --- QA Contact: Testopia <testopia>
Severity: normal    
Priority: P5 - low CC: gmcharlt
Version: Main   
Hardware: All   
OS: All   
Change sponsored?: --- Patch complexity: ---
Documentation contact: Documentation submission:
Text to go in the release notes:
Version(s) released in:
Circulation function:

Description David Nind 2023-08-30 00:03:03 UTC
Searching system preferences using just a bracket (either ( or )) generates an error trace.[1]

Other characters, such as {, !, ;, <, @, #, %, and so on, don't do the same.

Ideally, you should just get search results or a 'No system preferences matched your search for: XXXX' message.


[1] Error trace:

Unmatched ( in regex; marked by <-- HERE in m/^( <-- HERE $/ at /kohadevbox/koha/admin/preferences.pl line 201

    in CGI::Compile::ROOT::kohadevbox_koha_admin_preferences_2epl::TransformPrefsToHTML at /kohadevbox/koha/admin/preferences.pl line 201

      198:                         my $chunk = _get_chunk( $value, %$piece );
      199: 
      200:                         # No highlighting of inputs yet, but would be useful
      201:                         $chunk->{'highlighted'} = 1 if ( $searchfield && $name =~ /^$searchfield$/i );
      202: 
      203:                         if ( $name eq 'Pseudonymization' && ! C4::Context->config('bcrypt_settings')) {
      204:                             push @warnings, 'bcrypt_config_not_set';

    Show function arguments