Commit 80f691ee authored by Steven Wittens's avatar Steven Wittens
Browse files

#101164: Fix file upload in PHP5 (pass by reference)

parent 8825e579
...@@ -377,7 +377,10 @@ function upload_form_alter($form_id, &$form) { ...@@ -377,7 +377,10 @@ function upload_form_alter($form_id, &$form) {
// Make sure necessary directories for upload.module exist and are // Make sure necessary directories for upload.module exist and are
// writable before displaying the attachment form. // writable before displaying the attachment form.
if (!file_check_directory(file_directory_path(), FILE_CREATE_DIRECTORY) || !file_check_directory(file_directory_temp(), FILE_CREATE_DIRECTORY)) { $path = file_directory_path();
$temp = file_directory_temp();
// Note: pass by reference
if (!file_check_directory($path, FILE_CREATE_DIRECTORY) || !file_check_directory($temp, FILE_CREATE_DIRECTORY)) {
$form['attachments']['#description'] = t('File attachments are disabled. The file directories have not been properly configured.'); $form['attachments']['#description'] = t('File attachments are disabled. The file directories have not been properly configured.');
if (user_access('administer site configuration')) { if (user_access('administer site configuration')) {
$form['attachments']['#description'] .= ' '. t('Please visit the <a href="@admin-file-system">file system configuration page</a>.', array('@admin-file-system' => url('admin/settings/file-system'))); $form['attachments']['#description'] .= ' '. t('Please visit the <a href="@admin-file-system">file system configuration page</a>.', array('@admin-file-system' => url('admin/settings/file-system')));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment