mirror of
git://git.proxmox.com/git/pve-common.git
synced 2025-01-10 09:17:37 +03:00
add the 'urlencoded' string format
This commit is contained in:
parent
28a2669d9b
commit
c77b4c9640
@ -110,6 +110,16 @@ sub get_format {
|
||||
|
||||
register_format('string', sub {}); # allow format => 'string-list'
|
||||
|
||||
register_format('urlencoded', \&pve_verify_urlencoded);
|
||||
sub pve_verify_urlencoded {
|
||||
my ($text, $noerr) = @_;
|
||||
if ($text !~ /^[-%a-zA-Z0-9_.!~*'()]*$/) {
|
||||
return undef if $noerr;
|
||||
die "invalid urlencoded string: $text\n";
|
||||
}
|
||||
return $text;
|
||||
}
|
||||
|
||||
register_format('pve-configid', \&pve_verify_configid);
|
||||
sub pve_verify_configid {
|
||||
my ($id, $noerr) = @_;
|
||||
|
Loading…
Reference in New Issue
Block a user