From: Mikael Nordfeldth Date: Sun, 27 Sep 2015 09:54:52 +0000 (+0200) Subject: Be harsher on database saving failure for File entry X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=02418cffd81389bd3a7e17daf9eac259ac0b9439;p=quix0rs-gnu-social.git Be harsher on database saving failure for File entry --- diff --git a/classes/File.php b/classes/File.php index 1a29ea5107..8991616f82 100644 --- a/classes/File.php +++ b/classes/File.php @@ -99,6 +99,10 @@ class File extends Managed_DataObject if (!empty($redir_data['size'])) $file->size = intval($redir_data['size']); if (isset($redir_data['time']) && $redir_data['time'] > 0) $file->date = intval($redir_data['time']); $file_id = $file->insert(); + + if ($file_id === false) { + throw new ServerException('File/URL metadata could not be saved to the database.'); + } } Event::handle('EndFileSaveNew', array($file, $redir_data, $given_url));