]> git.sesse.net Git - pr0n/blobdiff - perl/Sesse/pr0n/Listing.pm
Remove all Encode::decode_utf8 calls, as seemingly scalars from PostgreSQL comes...
[pr0n] / perl / Sesse / pr0n / Listing.pm
index 03285a142f969265cf2ae340ed8b7fe68fc1b536..c8f93f249fae58c2ef8ba34ea9c093bf7e58eb5e 100644 (file)
@@ -24,9 +24,9 @@ sub handler {
        }
        
        # find the last modification
-       my $ref = $dbh->selectrow_hashref('SELECT EXTRACT(EPOCH FROM last_update) AS last_update FROM events WHERE vhost=? ORDER BY last_update DESC LIMIT 1',
+       my $ref = $dbh->selectrow_hashref('SELECT EXTRACT(EPOCH FROM last_update) AS last_update FROM last_picture_cache WHERE vhost=? ORDER BY last_update DESC LIMIT 1',
                undef, $r->get_server_name)
-               or error($r, "Could not any events", 404, "File not found");
+               or error($r, "Could not find any events", 404, "File not found");
        $r->set_last_modified($ref->{'last_update'});
        $r->content_type('text/html; charset=utf-8');
                                
@@ -48,7 +48,7 @@ sub handler {
                my $cloud = HTML::TagCloud->new;
 
                while (my $ref = $q->fetchrow_hashref()) {
-                       my $tag = Encode::decode_utf8($ref->{'tag'});
+                       my $tag = $ref->{'tag'};
                        my $html = HTML::Entities::encode_entities($tag);    # is this right?
                        my $uri = Sesse::pr0n::Common::pretty_escape($tag);  # and this?
 
@@ -86,8 +86,8 @@ sub handler {
 
                while (my $ref = $q->fetchrow_hashref()) {
                        my $id = $ref->{'event'};
-                       my $date = HTML::Entities::encode_entities(Encode::decode_utf8($ref->{'date'}));
-                       my $name = HTML::Entities::encode_entities(Encode::decode_utf8($ref->{'name'}));
+                       my $date = HTML::Entities::encode_entities($ref->{'date'});
+                       my $name = HTML::Entities::encode_entities($ref->{'name'});
                        
                        $r->print("      <li><a href=\"$id/\">$name</a> ($date)</li>\n");
                }