This commit is contained in:
Shish 2020-02-01 18:27:21 +00:00
parent 7f2f5c342e
commit dcb1f862e6
2 changed files with 5 additions and 5 deletions

View file

@ -613,7 +613,7 @@ function autodate(string $date, bool $html=true): string
function isValidDateTime(string $dateTime): bool
{
if (preg_match("/^(\d{4})-(\d{2})-(\d{2}) ([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])$/", $dateTime, $matches)) {
if (checkdate($matches[2], $matches[3], $matches[1])) {
if (checkdate((int)$matches[2], (int)$matches[3], (int)$matches[1])) {
return true;
}
}
@ -628,7 +628,7 @@ function isValidDate(string $date): bool
{
if (preg_match("/^(\d{4})-(\d{2})-(\d{2})$/", $date, $matches)) {
// checkdate wants (month, day, year)
if (checkdate($matches[2], $matches[3], $matches[1])) {
if (checkdate((int)$matches[2], (int)$matches[3], (int)$matches[1])) {
return true;
}
}

View file

@ -303,7 +303,7 @@ class TagHistory extends Extension
', $select_args);
if (!empty($row)) {
$revert_id = $row['id'];
$revert_id = (int)$row['id'];
$result = $this->get_tag_history_from_revert($revert_id);
if (empty($result)) {
@ -315,8 +315,8 @@ class TagHistory extends Extension
}
// lets get the values out of the result
$stored_result_id = int_escape($result['id']);
$stored_image_id = int_escape($result['image_id']);
$stored_result_id = (int)$result['id'];
$stored_image_id = (int)$result['image_id'];
$stored_tags = $result['tags'];
$image = Image::by_id($stored_image_id);