Closed (fixed)
Project:
URL Icon
Version:
5.x-1.5
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
3 Jul 2008 at 04:49 UTC
Updated:
2 Aug 2008 at 16:22 UTC
I used the following code to work on a site with private files:
// check for favicon availability
- $favicon = file_exists($dir .'/'. $domain .'.ico') ? (base_path().$dir .'/'. $domain .'.ico') : (base_path().drupal_get_path('module', 'urlicon') .'/favicon.ico');
+ $favicon = file_exists($dir .'/'. $domain .'.ico') ? (file_create_url($dir .'/'. $domain .'.ico')) : (base_path().drupal_get_path('module', 'urlicon') .'/favicon.ico');
$link = theme_urlicon($match[3], $favicon, $match[1], array('alt' => '', 'title' => t('favicon'), 'class' => 'urlicon ui-'. $domain));
return $link;
@@ -154,3 +154,12 @@
$favicon = '<img src="'. $favicon .'" '. drupal_attributes($attributes) .' />';
return l($text .' '. $favicon, $path, array(), NULL, NULL, TRUE, TRUE);
}
+
+function urlicon_file_download($filepath) {
+ // Check if the file is controlled by the current module.
+ if (strpos($filepath, 'urlicon') !== FALSE) {
+ if (user_access('access content')) {
+ return array('Content-type: image/png');
+ }
+ }
+}
Comments
Comment #1
jonathan_hunt commentedOops, I see I left the specific content-type in there; that needs to be made sensitive to the type of file being stored...
Comment #2
sanduhrsCommited to 5,6,HEAD
Thanks.
Comment #3
Anonymous (not verified) commentedAutomatically closed -- issue fixed for two weeks with no activity.