]> git.ipfire.org Git - ipfire-2.x.git/commitdiff
dhcp.cgi: Count up key when skippingh search entries
authorMichael Tremer <michael.tremer@ipfire.org>
Wed, 17 Jun 2015 12:02:05 +0000 (14:02 +0200)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 17 Jun 2015 12:02:05 +0000 (14:02 +0200)
This caused a bug that when the user wanted to edit one
of the static leases and clicked on the edit icon that
an other entry opened up for editing.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
html/cgi-bin/dhcp.cgi

index c49988e1d94787611a24bf827014fe3719b7dd9a..971c51e6cf6606248eb0270eba0e99017ab5f441 100644 (file)
@@ -942,7 +942,10 @@ foreach my $line (@current2) {
 
     # Skip all entries that do not match the search query
     if ($search_query ne "") {
-       next if (!grep(/$search_query/, @temp));
+       if (!grep(/$search_query/, @temp)) {
+               $key++;
+               next;
+       }
     }
 
     if ($dhcpsettings{'KEY2'} eq $key) {