]> git.sesse.net Git - pr0n/blobdiff - perl/Sesse/pr0n/Image.pm
Make some sorely needed changes to the SQL schema, and update the code
[pr0n] / perl / Sesse / pr0n / Image.pm
index e436428950b6adc9d5a8e56e23755d3eab4ae710..d1743b41d5c456428e4ce78cf0a19e803f0ff065 100644 (file)
@@ -46,8 +46,8 @@ sub handler {
                #       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'};