Compare commits
3 Commits
39d2ef86ad
...
a3e722589f
Author | SHA1 | Date | |
---|---|---|---|
a3e722589f | |||
85d43851d1 | |||
8b277607cf |
@ -290,26 +290,23 @@ sub parse_page_arg {
|
|||||||
# Split page name from page ids if available.
|
# Split page name from page ids if available.
|
||||||
my ($page, $ids) = split(/=/, $page_arg);
|
my ($page, $ids) = split(/=/, $page_arg);
|
||||||
my @ids;
|
my @ids;
|
||||||
|
$ids = "" unless defined $ids;
|
||||||
|
|
||||||
if(!$ids) {
|
# Parse the page ids and push them onto @ids array
|
||||||
$ids = "";
|
my @ids_by_comma = split(/\,/, $ids);
|
||||||
}
|
foreach my $id_by_comma (@ids_by_comma) {
|
||||||
else {
|
my @ids_for_range = split(/\.\./, $id_by_comma);
|
||||||
# Parse the page ids and push them onto @ids array
|
if ((scalar @ids_for_range) == 2) {
|
||||||
my @ids_by_comma = split(/\,/, $ids);
|
push @ids, $ids_for_range[0]..$ids_for_range[1];
|
||||||
foreach my $id_by_comma (@ids_by_comma) {
|
}
|
||||||
my @ids_for_range = split(/\.\./, $id_by_comma);
|
elsif ((scalar @ids_for_range) == 1) {
|
||||||
if ((scalar @ids_for_range) == 2) {
|
push @ids, $ids_for_range[0];
|
||||||
push @ids, $ids_for_range[0]..$ids_for_range[1];
|
}
|
||||||
}
|
else {
|
||||||
elsif ((scalar @ids_for_range) == 1) {
|
verbose (1, "\nWarning: Page $page id range $id_by_comma could not be parsed.");
|
||||||
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]);
|
return ('page' => $page, 'ids' => [@ids]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -326,7 +323,7 @@ sub get_ids_from_db {
|
|||||||
|| die $tt->error(), "\n";
|
|| die $tt->error(), "\n";
|
||||||
|
|
||||||
# Starts with a newline and comma
|
# Starts with a newline and comma
|
||||||
return split(/,/, substr($selected_ids, 2));
|
return split(/,/, substr($selected_ids, 1));
|
||||||
}
|
}
|
||||||
|
|
||||||
sub get_filename {
|
sub get_filename {
|
||||||
|
Loading…
Reference in New Issue
Block a user