Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
bug 3027: Fatal error on Configuration->Options->Photo size
git-svn-id: http://piwigo.org/svn/trunk@26902 68402e56-0260-453c-a942-63ccdbb3a9ee
  • Loading branch information
mistic100 committed Jan 22, 2014
1 parent eecb7cf commit 732e0bb
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions include/functions.inc.php
Expand Up @@ -550,12 +550,10 @@ function str2DateTime($original, $format=null)
}
else
{
$date = new DateTime();

$t = trim($original, '0123456789');
if (empty($t)) // from timestamp
{
$date->setTimestamp($original);
$date = new DateTime('@'.$original);
}
else // from unknown date format (assuming something like Y-m-d H:i:s)
{
Expand All @@ -572,6 +570,7 @@ function str2DateTime($original, $format=null)
if (!isset($ymdhms[4])) $ymdhms[4] = 0;
if (!isset($ymdhms[5])) $ymdhms[5] = 0;

$date = new DateTime();
$date->setDate($ymdhms[0], $ymdhms[1], $ymdhms[2]);
$date->setTime($ymdhms[3], $ymdhms[4], $ymdhms[5]);
}
Expand Down

0 comments on commit 732e0bb

Please sign in to comment.