From 6ad53d66f3575e68d0ddb2a4fc6b5709883ad49c Mon Sep 17 00:00:00 2001 From: Frode Petterson Date: Mon, 22 Jun 2015 10:02:07 +0200 Subject: [PATCH] Improve error handling. --- h5p.classes.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/h5p.classes.php b/h5p.classes.php index 5cb2f07..89a3574 100644 --- a/h5p.classes.php +++ b/h5p.classes.php @@ -660,6 +660,11 @@ class H5PValidator { $tmpDir = $this->h5pF->getUploadedH5pFolderPath(); $tmpPath = $this->h5pF->getUploadedH5pPath(); + if (!H5PCore::dirReady($tmpDir)) { + $this->h5pF->setErrorMessage($this->h5pF->t('Unable to write to the temporary directory.')); + return FALSE; + } + $valid = TRUE; // Extract and then remove the package file.