<?php
-// $Id$
/**
* @file
* FileField: Defines a CCK file field type.
if (empty($item['filepath']) && !empty($item['fid'])) {
$item = array_merge($item, field_file_load($item['fid']));
}
-
- return empty($item['filepath']) ? '' : file_create_path($item['filepath']);
+ return empty($item['filepath']) ? '' : check_plain(file_create_path($item['filepath']));
}
/**
$item = array_merge($item, field_file_load($item['fid']));
}
- return empty($item['filepath']) ? '' : file_create_url($item['filepath']);
+ if (empty($item['filepath'])) {
+ return '';
+ }
+
+ return file_create_url(field_file_urlencode_path($item['filepath']));
}
/**
*
* This function checks if the file may be shown and returns an empty string
* if viewing the file is not allowed for any reason. If you need to display it
- * in any case, please use theme('filefield') instead.
+ * in any case, please use theme('filefield_file') instead.
*/
function theme_filefield_item($file, $field) {
if (filefield_view_access($field['field_name']) && filefield_file_listed($file, $field)) {
*/
function filefield_file_listed($file, $field) {
if (!empty($field['list_field'])) {
- return (bool)$file['list'];
+ return !empty($file['list']);
}
return TRUE;
}
$options['attributes']['title'] = $file['filename'];
}
- return '<div class="filefield-file clear-block">'. $icon . l($link_text, $url, $options) .'</div>';
+ return '<div class="filefield-file">'. $icon . l($link_text, $url, $options) .'</div>';
}