Bad customFunctions test (Closes: #938)
This commit is contained in:
parent
f4ed479a1c
commit
45dfd72b0b
|
@ -682,7 +682,7 @@ qr/(?:(?:https?):\/\/(?:(?:(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.]
|
||||||
},
|
},
|
||||||
'customFunctions' => {
|
'customFunctions' => {
|
||||||
'msgFail' => '__badCustomFuncName__',
|
'msgFail' => '__badCustomFuncName__',
|
||||||
'test' => qr/^(?:\w+(?:\s+\w+)*)?$/,
|
'test' => qr/^(?:\w+(?:::\w+)*(?:\s+\w+(?:::\w+)*)*)?$/,
|
||||||
'type' => 'text'
|
'type' => 'text'
|
||||||
},
|
},
|
||||||
'dbiAuthChain' => {
|
'dbiAuthChain' => {
|
||||||
|
@ -1095,8 +1095,6 @@ qr/^(?:(?:(?:(?:[a-zA-Z0-9][-a-zA-Z0-9]*)?[a-zA-Z0-9])[.])*(?:[a-zA-Z][-a-zA-Z0-
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return 0, "__badCustomFuncName__ $f"
|
|
||||||
unless $f =~ /^[a-zA-Z]\w*$/;
|
|
||||||
$s = "sub $f {1} $s";
|
$s = "sub $f {1} $s";
|
||||||
}
|
}
|
||||||
eval $s;
|
eval $s;
|
||||||
|
|
|
@ -225,7 +225,7 @@ sub attributes {
|
||||||
},
|
},
|
||||||
customFunctions => {
|
customFunctions => {
|
||||||
type => 'text',
|
type => 'text',
|
||||||
test => qr/^(?:\w+(?:\s+\w+)*)?$/,
|
test => qr/^(?:\w+(?:::\w+)*(?:\s+\w+(?:::\w+)*)*)?$/,
|
||||||
msgFail => "__badCustomFuncName__",
|
msgFail => "__badCustomFuncName__",
|
||||||
documentation => 'List of custom functions'
|
documentation => 'List of custom functions'
|
||||||
},
|
},
|
||||||
|
@ -900,8 +900,6 @@ sub attributes {
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
return ( 0, "__badCustomFuncName__ $f" )
|
|
||||||
unless ( $f =~ /^[a-zA-Z]\w*$/ );
|
|
||||||
$s = "sub $f {1} $s";
|
$s = "sub $f {1} $s";
|
||||||
}
|
}
|
||||||
eval $s;
|
eval $s;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user