Changeset 389
- Timestamp:
- 04/05/08 21:21:00 (16 years ago)
- Location:
- plugins/myfavicon
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
plugins/myfavicon/_define.php
r388 r389 19 19 /* Description*/ "Add a customized favicon to your blog", 20 20 /* Author */ "Oleksandr Syenchuk", 21 /* Version */ '0. 1',21 /* Version */ '0.2', 22 22 /* Permissions */ 'contentadmin' 23 23 ); -
plugins/myfavicon/_install.php
r388 r389 30 30 # New install / update 31 31 $sets->put('favicon_url','','string','Favicon URL',false); 32 $sets->put('favicon_mimetype','image/png','string','Favicon MIME type',false);33 32 34 33 # --SETTING NEW VERSION-- -
plugins/myfavicon/_public.php
r388 r389 24 24 class myFavicon 25 25 { 26 #FIXME Mimetypes in common/lib.files.php (Clearbricks) are not enough 26 27 public static $allowed_mimetypes = array( 27 'i mage/x-icon',28 ' image/png',29 ' image/bmp',30 ' image/gif',31 ' image/jpeg',32 ' video/x-mng'28 'ico' => 'image/x-icon', 29 'png' => 'image/png', 30 'bmp' => 'image/bmp', 31 'gif' => 'image/gif', 32 'jpg' => 'image/jpeg', 33 'mng' => 'video/x-mng' 33 34 ); 34 35 … … 50 51 } 51 52 52 private static function faviconHTML(&$set s)53 private static function faviconHTML(&$settings) 53 54 { 54 $favicon_url = $sets->favicon_url; 55 $favicon_mimetype = $sets->favicon_mimetype; 55 $favicon_url = $settings->favicon_url; 56 56 57 if (empty($favicon_url) || empty($favicon_mimetype) 58 || !in_array($favicon_mimetype,self::$allowed_mimetypes)) { 57 if (empty($favicon_url)) { 59 58 return; 60 59 } 61 60 62 return '<link rel="icon" type="'.$favicon_mimetype. 61 $extension = files::getExtension($favicon_url); 62 63 if (!isset(self::$allowed_mimetypes[$extension])) { 64 $mimetype = files::getMimeType($favicon_url); 65 if (!in_array($mimetype,self::$allowed_mimetypes)) { 66 return; 67 } 68 } 69 else { 70 $mimetype = self::$allowed_mimetypes[$extension]; 71 } 72 73 return '<link rel="icon" type="'.$mimetype. 63 74 '" href="'.html::escapeHTML($favicon_url).'" />'; 64 75 }
Note: See TracChangeset
for help on using the changeset viewer.