Changeset 307 for branches/stable


Ignore:
Timestamp:
02/14/06 12:44:32 (18 years ago)
Author:
Kris Deugau
Message:

/branches/stable

Bugfix for slightly broken "bare /nn" search

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/stable/cgi-bin/search.cgi

    r303 r307  
    140140  ## CIDR query options.
    141141  $webvar{cidr} =~ s/\s+//;     # Hates the nasty spaceseseses we does.
    142   if ($webvar{cidr} == '') { # We has a blank CIDR.  Ignore it.
     142  if ($webvar{cidr} eq '') { # We has a blank CIDR.  Ignore it.
    143143  } elsif ($webvar{cidr} =~ /\//) {
    144144    # 209.91.179/26 should show all /26 subnets in 209.91.179
     
    152152      # Partial match;  beginning of subnet and maskbits are provided
    153153      # Show any blocks with the leading octet(s) and that masklength
     154      # Need some more magic for bare /nn searches:
     155      my $condition = ($net eq '' ?
     156        "masklen(cidr)=$maskbits" : "text(cidr) like '$net%' and masklen(cidr)=$maskbits");
    154157      $sql .= " $sqlconcat (select $cols from searchme where $webvar{cidrexclude} ".
    155         "(text(cidr) like '$net%' and masklen(cidr)=$maskbits))";
     158        "($condition))";
    156159    }
    157160  } elsif ($webvar{cidr} =~ /^(\d{1,3}\.){3}\d{1,3}$/) {
Note: See TracChangeset for help on using the changeset viewer.