[I212] Fix general series page generation #213
@ -290,26 +290,23 @@ sub parse_page_arg {
|
||||
# Split page name from page ids if available.
|
||||
my ($page, $ids) = split(/=/, $page_arg);
|
||||
my @ids;
|
||||
$ids = "" unless defined $ids;
|
||||
|
||||
if(!$ids) {
|
||||
$ids = "";
|
||||
}
|
||||
else {
|
||||
# Parse the page ids and push them onto @ids array
|
||||
my @ids_by_comma = split(/\,/, $ids);
|
||||
foreach my $id_by_comma (@ids_by_comma) {
|
||||
my @ids_for_range = split(/\.\./, $id_by_comma);
|
||||
if ((scalar @ids_for_range) == 2) {
|
||||
push @ids, $ids_for_range[0]..$ids_for_range[1];
|
||||
}
|
||||
elsif ((scalar @ids_for_range) == 1) {
|
||||
push @ids, $ids_for_range[0];
|
||||
}
|
||||
else {
|
||||
verbose (1, "\nWarning: Page $page id range $id_by_comma could not be parsed.");
|
||||
}
|
||||
# Parse the page ids and push them onto @ids array
|
||||
my @ids_by_comma = split(/\,/, $ids);
|
||||
foreach my $id_by_comma (@ids_by_comma) {
|
||||
my @ids_for_range = split(/\.\./, $id_by_comma);
|
||||
if ((scalar @ids_for_range) == 2) {
|
||||
push @ids, $ids_for_range[0]..$ids_for_range[1];
|
||||
}
|
||||
elsif ((scalar @ids_for_range) == 1) {
|
||||
push @ids, $ids_for_range[0];
|
||||
}
|
||||
else {
|
||||
verbose (1, "\nWarning: Page $page id range $id_by_comma could not be parsed.");
|
||||
}
|
||||
}
|
||||
|
||||
return ('page' => $page, 'ids' => [@ids]);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user