Changeset 928


Ignore:
Timestamp:
07/15/19 18:02:12 (5 years ago)
Author:
Kris Deugau
Message:

/trunk

Extend flexibility for search RPC a bit; allow 1 or 0 to map to y or n
respectively for available. Field is projected to become functionally
non-boolean soon, so callers should use the known state values, however
y/n are the significant majority.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/cgi-bin/search-rpc.cgi

    r927 r928  
    250250
    251251  # Filter on "available", because we can.
    252   if ($args{available} && $args{available} =~ /^[yn]$/) {
    253     push @fields, "s.available";
    254     push @matchtypes, '=';
    255     push @vals, $args{available};
     252  if (defined($args{available}) {
     253    # Flex input;  accept 1 or 0 as y/n respectively.
     254    $args{available} =~ tr/10/yn/;
     255    if ($args{available} =~ /^[yn]$/) {
     256      push @fields, "s.available";
     257      push @matchtypes, '=';
     258      push @vals, $args{available};
     259    }
    256260  }
    257261
Note: See TracChangeset for help on using the changeset viewer.