X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=perl%2FSesse%2Fpr0n%2FCommon.pm;h=e3b33324bcb8de120b80187cc777360d6deb63c5;hb=9ea918ef3d3c20a1bbcea72085435af193301998;hp=be4385ae712ec60de351bbccb68976d35601ec8c;hpb=57eab1fc20fd2c7f972a12631b2cca978fb9f8cb;p=pr0n diff --git a/perl/Sesse/pr0n/Common.pm b/perl/Sesse/pr0n/Common.pm index be4385a..e3b3332 100644 --- a/perl/Sesse/pr0n/Common.pm +++ b/perl/Sesse/pr0n/Common.pm @@ -31,7 +31,7 @@ BEGIN { require Sesse::pr0n::Config_local; }; - $VERSION = "v2.05"; + $VERSION = "v2.10"; @ISA = qw(Exporter); @EXPORT = qw(&error &dberror); %EXPORT_TAGS = qw(); @@ -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"; } }