Fix defense_id generation
This commit is contained in:
parent
744c3db27c
commit
33222d78c5
@ -97,7 +97,7 @@ sub tag_defense
|
||||
my $path;
|
||||
if ($_[3])
|
||||
{
|
||||
if ($_[3] =~ /^(?:defenses\/)?([a-zA-Z0-9_.\/-]+)(?:.xml)?$/) {
|
||||
if ($_[3] =~ /^(?:defenses\/)?([a-zA-Z0-9_.\/-]+?)(?:.xml)?$/) {
|
||||
$path = "defenses/".$1.".xml";
|
||||
} else {
|
||||
$path = $_[3];
|
||||
@ -119,12 +119,11 @@ sub tag_defense
|
||||
chomp($path);
|
||||
}
|
||||
|
||||
my $defense_id;
|
||||
if ($path =~ /^(?:defenses\/)?([a-zA-Z0-9.\/]+)(?:.xml)?$/) {
|
||||
$defense_id = $1;
|
||||
} else {
|
||||
log ERROR, "Déplacez votre soutenance dans le dossier defenses ou simplifiez le nom du fichier.";
|
||||
}
|
||||
log WARN, "Placez votre soutenance dans le dossier defenses/." if ($path !~ /^defenses/);
|
||||
|
||||
my $defense_id = basename($path);
|
||||
$defense_id =~ s/\.xml$//;
|
||||
$defense_id =~ s/[^a-zA-Z0-9_.-]/_/g;
|
||||
|
||||
my $year;
|
||||
if ($_[4])
|
||||
|
Reference in New Issue
Block a user