# Find the event and file name
my ($event,$filename,$xres,$yres);
my $infobox = 1;
- if ($r->uri =~ m#^/([a-zA-Z0-9-]+)/original/([a-zA-Z0-9._-]+)$#) {
+ if ($r->uri =~ m#^/([a-zA-Z0-9-]+)/original/(nobox/)?([a-zA-Z0-9._-]+)$#) {
$event = $1;
- $filename = $2;
+ $filename = $3;
} elsif ($r->uri =~ m#^/([a-zA-Z0-9-]+)/(\d+)x(\d+)/(nobox/)?([a-zA-Z0-9._-]+)$#) {
$event = $1;
$filename = $5;
# or error($r, "Could not find $event", 404, "File not found");
# Look it up in the database
- my $ref = $dbh->selectrow_hashref('SELECT id,width,height FROM images WHERE event=? AND filename=?',
- undef, $event, $filename);
+ my $ref = $dbh->selectrow_hashref('SELECT id,width,height FROM images WHERE event=? AND vhost=? AND filename=?',
+ undef, $event, $r->get_server_name, $filename);
error($r, "Could not find $event/$filename", 404, "File not found") unless (defined($ref));
$id = $ref->{'id'};