Changeset 931


Ignore:
Timestamp:
10/21/22 12:48:30 (19 months ago)
Author:
Kris Deugau
Message:

/trunk

Fix a few minor glitches falling out from r930

File:
1 edited

Legend:

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

    r930 r931  
    237237      # Show any blocks with the leading octet(s) and that masklength
    238238      # Need some more magic for bare /nn searches:
    239       $sql .= " $sqlconcat ($sqlbase WHERE $webvar{cidrexclude} (masklen(s.cidr) = ?";
     239      $sql .= " $sqlconcat ($sqlbase WHERE $webvar{cidrexclude} (masklen(s.cidr)) = ?";
    240240      push @bindargs, $maskbits;
    241241      if ($net ne '') {
    242242        $sql .= " AND text(s.cidr) LIKE ?";
    243         push @bindargs, $net;
     243        push @bindargs, "$net%";
    244244      }
    245       $sql .= "))";
     245      $sql .= ")";
    246246    }
    247247  } elsif ($webvar{cidr} =~ /^(\d{1,3}\.){3}\d{1,3}$/) {
     
    270270  } else {
    271271    # Add the limit/offset clauses
    272     $sql .= " ORDER BY s.cidr";
     272    # note ORDER BY needs to NOT reference the table alias s as in $sqlbase because Reasons
     273    $sql .= " ORDER BY cidr";
    273274    $sql .= " LIMIT $RESULTS_PER_PAGE OFFSET $offset" if $RESULTS_PER_PAGE != 0;
    274275    # And tell the user.
Note: See TracChangeset for help on using the changeset viewer.