]> iEval git - zeal.git/commitdiff
Make family:query syntax in Zeal->query stricter
authorMarius Gavrilescu <marius@ieval.ro>
Wed, 31 Dec 2014 21:44:21 +0000 (23:44 +0200)
committerMarius Gavrilescu <marius@ieval.ro>
Wed, 31 Dec 2014 21:44:21 +0000 (23:44 +0200)
family now has to match \w+ and query must not start with a :

lib/Zeal.pm

index c943e51fb1381651fa8aeb206ae4f0110bc422b7..c2ed5d7bcf8207aef0dbb6e173e5269fa7e2943a 100644 (file)
@@ -46,7 +46,7 @@ sub sets {
 
 sub query {
        my ($self, $query, $family) = @_;
-       ($family, $query) = split /:/, $query, 2 if !$family && $query =~ /:/;
+       ($family, $query) = split /:/, $query, 2 if !$family && $query =~ /^\w+:[^:]/;
        my @res = map { $_->query($query) } $self->sets($family);
        wantarray ? @res : $res[0]
 }
This page took 0.023206 seconds and 4 git commands to generate.