Changeset 171 for branches/new-search-20050223/cgi-bin/main.cgi
- Timestamp:
- 02/24/05 15:09:46 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/new-search-20050223/cgi-bin/main.cgi
r167 r171 123 123 # Search term entered. Display matches. 124 124 # We should really sanitize $webvar{input}, no? 125 viewBy($webvar{searchfor}, $webvar{input}); 125 # need to munge up data for $webvar{searchfor}, rather than breaking things here. 126 my $searchfor; 127 # Chew up leading and trailing whitespace 128 $webvar{input} =~ s/^\s+//; 129 $webvar{input} =~ s/\s+$//; 130 if ($webvar{input} =~ /^(\d{1,3}\.){3}\d{1,3}\/\d{1,3}$/) { 131 # "Perfect" IP subnet match 132 $searchfor = "ipblock"; 133 } elsif ($webvar{input} =~ /^(\d{1,3}\.){3}\d{1,3}$/) { 134 # "Perfect" IP address match (shows containing block) 135 $searchfor = "ipblock"; 136 } elsif ($webvar{input} =~ /^(\d{1,3}\.){2}\d{1,3}(\.\d{1,3}?)?/) { 137 # Partial IP match 138 $searchfor = "ipblock"; 139 } elsif ($webvar{input} =~ /^\d+$/) { 140 # All-digits, new custID 141 $searchfor = "cust"; 142 } else { 143 # Anything else. 144 $searchfor = "desc"; 145 } 146 viewBy($searchfor, $webvar{input}); 126 147 } 127 148 }
Note:
See TracChangeset
for help on using the changeset viewer.