Skip to content

Guard disk_free_space() and disk_total_space() with function_exists()#112

Open
Giermann wants to merge 3 commits intoerror311:masterfrom
Giermann:patch-1
Open

Guard disk_free_space() and disk_total_space() with function_exists()#112
Giermann wants to merge 3 commits intoerror311:masterfrom
Giermann:patch-1

Conversation

@Giermann
Copy link
Copy Markdown

FileModel::createZipArchive() and FolderController call disk_free_space() without checking whether the function exists. This causes a fatal error on hosts where the function is in disable_functions. The fix wraps the call:

$free = function_exists('disk_free_space') ? @disk_free_space($work) : false;

The same fix is needed in DiskUsageModel and in the admin panel disk usage display.

The same guard should be applied to any other host-restricted functions called without function_exists() checks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant