change write permission check to catch exceptions

main
msquare 7 years ago
parent cbe88ad801
commit dbf6e64a2c

@ -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.'));
} }

Loading…
Cancel
Save