Parse conf (#1988)
This commit is contained in:
parent
85b9095f7e
commit
836add81c0
|
@ -195,12 +195,14 @@ sub virtualHosts {
|
|||
type => 'keyText',
|
||||
};
|
||||
|
||||
# If rule contains a comment, split it
|
||||
# If rule contains a comment or an AuthLevel, split them
|
||||
if ( $query eq 'locationRules' ) {
|
||||
$res->{comment} = '';
|
||||
$res->{level} = '';
|
||||
if ( $r =~ s/\(\?#(.*?)\)// ) {
|
||||
$res->{title} = $res->{comment} = $1;
|
||||
}
|
||||
$res->{level} = $1 if ( $r =~ s/\(\?#AuthnLevel=(-?\d+)\)// );
|
||||
$res->{re} = $r;
|
||||
$res->{type} = 'rule';
|
||||
}
|
||||
|
|
|
@ -264,8 +264,9 @@ sub _scanNodes {
|
|||
hdebug(' locationRules');
|
||||
my $k =
|
||||
$leaf->{comment}
|
||||
? "(?#$leaf->{comment}&AuthnLevel=$leaf->{level})$leaf->{re}"
|
||||
: "(?#&AuthnLevel=$leaf->{level})$leaf->{re}";
|
||||
? "(?#$leaf->{comment})$leaf->{re}"
|
||||
: $leaf->{re};
|
||||
$k .= "(?#AuthnLevel=$leaf->{level})" if $leaf->{level};
|
||||
$self->set( $target, $key, $k, $leaf->{data} );
|
||||
}
|
||||
else {
|
||||
|
|
Loading…
Reference in New Issue
Block a user