Compare commits

..

No commits in common. "85d43851d1cfafb0c3d21d497ea2bd9449fd52b9" and "39d2ef86ad5b6095662b79e37c0ee7219f4d61e1" have entirely different histories.

View File

@ -290,23 +290,26 @@ 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;
# Parse the page ids and push them onto @ids array if(!$ids) {
my @ids_by_comma = split(/\,/, $ids); $ids = "";
foreach my $id_by_comma (@ids_by_comma) { }
my @ids_for_range = split(/\.\./, $id_by_comma); else {
if ((scalar @ids_for_range) == 2) { # Parse the page ids and push them onto @ids array
push @ids, $ids_for_range[0]..$ids_for_range[1]; my @ids_by_comma = split(/\,/, $ids);
} foreach my $id_by_comma (@ids_by_comma) {
elsif ((scalar @ids_for_range) == 1) { my @ids_for_range = split(/\.\./, $id_by_comma);
push @ids, $ids_for_range[0]; if ((scalar @ids_for_range) == 2) {
} push @ids, $ids_for_range[0]..$ids_for_range[1];
else { }
verbose (1, "\nWarning: Page $page id range $id_by_comma could not be parsed."); 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]); return ('page' => $page, 'ids' => [@ids]);
} }
@ -323,7 +326,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, 1)); return split(/,/, substr($selected_ids, 2));
} }
sub get_filename { sub get_filename {