change write permission check to catch exceptions

This commit is contained in:
msquare 2017-12-10 18:10:28 +01:00
parent cbe88ad801
commit dbf6e64a2c
1 changed files with 3 additions and 2 deletions

View File

@ -32,10 +32,11 @@ function admin_import()
$step = $request->input('step'); $step = $request->input('step');
} }
if ($test_handle = @fopen($import_dir . '/tmp', 'w')) { try {
$test_handle = @fopen($import_dir . '/tmp', 'w');
fclose($test_handle); fclose($test_handle);
@unlink($import_dir . '/tmp'); @unlink($import_dir . '/tmp');
} else { } catch(Exception $e) {
error(_('Webserver has no write-permission on import directory.')); error(_('Webserver has no write-permission on import directory.'));
} }