X-Git-Url: https://git.sesse.net/?p=pr0n;a=blobdiff_plain;f=perl%2FSesse%2Fpr0n%2FCommon.pm;h=e3b33324bcb8de120b80187cc777360d6deb63c5;hp=d7e673dc98a0fe03b86d4c131ca9f820c4bb6e33;hb=35e8aefa9fb061d78f1f47951a0e520e872c6cf7;hpb=3f1953791a301d4370bff240f9347aa81474881d diff --git a/perl/Sesse/pr0n/Common.pm b/perl/Sesse/pr0n/Common.pm index d7e673d..e3b3332 100644 --- a/perl/Sesse/pr0n/Common.pm +++ b/perl/Sesse/pr0n/Common.pm @@ -134,8 +134,12 @@ sub get_query_string { } sub print_link { - my ($r, $title, $baseurl, $param, $defparam) = @_; - my $str = "$title"; + my ($r, $title, $baseurl, $param, $defparam, $accesskey) = @_; + my $str = "print($str); } @@ -145,7 +149,7 @@ sub get_dbh { # Try to reconnect Apache2::ServerUtil->server->log_error("Lost contact with PostgreSQL server, trying to reconnect..."); unless ($dbh = DBI->connect("dbi:Pg:dbname=pr0n;host=" . $Sesse::pr0n::Config::db_host, - $Sesse::pr0n::Config::db_user, $Sesse::pr0n::Config::db_password)) { + $Sesse::pr0n::Config::db_username, $Sesse::pr0n::Config::db_password)) { $dbh = undef; die "Couldn't connect to PostgreSQL database"; } @@ -182,10 +186,10 @@ sub update_width_height { # Also find the date taken if appropriate (from the EXIF tag etc.) my $info = Image::ExifTool::ImageInfo(get_disk_location($r, $id)); my $datetime = undef; - + if (defined($info->{'DateTimeOriginal'})) { # Parse the date and time over to ISO format - if ($info->{'DateTimeOriginal'} =~ /^(\d{4}):(\d\d):(\d\d) (\d\d):(\d\d):(\d\d)$/ && $1 > 1990) { + if ($info->{'DateTimeOriginal'} =~ /^(\d{4}):(\d\d):(\d\d) (\d\d):(\d\d):(\d\d)(?:\+\d\d:\d\d)?$/ && $1 > 1990) { $datetime = "$1-$2-$3 $4:$5:$6"; } }