From dbf6e64a2cc0d83322d249da4844b5cf3b85bf60 Mon Sep 17 00:00:00 2001 From: msquare Date: Sun, 10 Dec 2017 18:10:28 +0100 Subject: change write permission check to catch exceptions --- includes/pages/admin_import.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/includes/pages/admin_import.php b/includes/pages/admin_import.php index dcf4e0d1..b59f2b17 100644 --- a/includes/pages/admin_import.php +++ b/includes/pages/admin_import.php @@ -32,10 +32,11 @@ function admin_import() $step = $request->input('step'); } - if ($test_handle = @fopen($import_dir . '/tmp', 'w')) { + try { + $test_handle = @fopen($import_dir . '/tmp', 'w'); fclose($test_handle); @unlink($import_dir . '/tmp'); - } else { + } catch(Exception $e) { error(_('Webserver has no write-permission on import directory.')); } -- cgit v1.2.3-54-g00ecf