Revision d8b7e4d0
Von Moritz Bunkus vor mehr als 14 Jahren hinzugefügt
SL/Dispatcher.pm | ||
---|---|---|
206 | 206 |
} |
207 | 207 |
|
208 | 208 |
sub _route_dispatcher_request { |
209 |
my $action_re = '[a-z0-9_\-]+';
|
|
209 |
my $name_re = qr{[a-z]\w*};
|
|
210 | 210 |
my ($script_name, $action); |
211 | 211 |
|
212 | 212 |
eval { |
213 |
die "Unroutable request -- inavlid module name.\n" if !$::form->{M} || ($::form->{M} !~ m/^$action_re$/);
|
|
213 |
die "Unroutable request -- inavlid module name.\n" if !$::form->{M} || ($::form->{M} !~ m/^${name_re}$/);
|
|
214 | 214 |
$script_name = $::form->{M} . '.pl'; |
215 | 215 |
|
216 | 216 |
if ($::form->{A}) { |
217 | 217 |
$action = $::form->{A}; |
218 | 218 |
|
219 | 219 |
} else { |
220 |
$action = first { m/^A_${action_re}$/ } keys %{ $::form };
|
|
220 |
$action = first { m/^A_${name_re}$/ } keys %{ $::form };
|
|
221 | 221 |
die "Unroutable request -- inavlid action name.\n" if !$action; |
222 | 222 |
|
223 | 223 |
delete $::form->{$action}; |
Auch abrufbar als: Unified diff
Modul- und Funktionsnamen müssen mit einem Buchstaben beginnen