diff --git a/feed.php b/feed.php index 298777eb9ac1e05d05f42ade89f6ad7dac45b1cd..a7fa95620fc5af07a2a57d6563c8c02eb0c5f698 100644 --- a/feed.php +++ b/feed.php @@ -50,7 +50,7 @@ $rss->cssStyleSheet = DOKU_URL.'lib/exe/css.php?s=feed'; $image = new FeedImage(); $image->title = $conf['title']; -$image->url = tpl_getFavicon(true); +$image->url = tpl_getMediaFile('favicon.ico', true); $image->link = DOKU_URL; $rss->image = $image; diff --git a/inc/template.php b/inc/template.php index d6b7af1e8b8c24adff2a281eb94805bd918bd04b..f7a49f002500a792db461bcfa40e5a22b82eed2b 100644 --- a/inc/template.php +++ b/inc/template.php @@ -1458,16 +1458,15 @@ function tpl_flush(){ flush(); } - /** - * Returns icon from data/media root directory if it exists, otherwise - * the one in the template's image directory. + * Returns link to media file from data/media root directory if it exists, + * otherwise the one in the template's image directory. * - * @param bool $abs - if to use absolute URL * @param string $fileName - file name of icon + * @param bool $abs - if to use absolute URL * @author Anika Henke <anika@selfthinker.org> */ -function tpl_getFavicon($abs=false, $fileName='favicon.ico') { +function tpl_getMediaFile($fileName, $abs=false) { if (file_exists(mediaFN($fileName))) { return ml($fileName, '', true, '', $abs); } @@ -1478,6 +1477,17 @@ function tpl_getFavicon($abs=false, $fileName='favicon.ico') { return DOKU_TPL.'images/'.$fileName; } +/** + * Returns icon from data/media root directory if it exists, otherwise + * the one in the template's image directory. + * + * @deprecated Use tpl_getMediaFile() instead + * @author Anika Henke <anika@selfthinker.org> + */ +function tpl_getFavicon($abs=false, $fileName='favicon.ico') { + return tpl_getMediaFile($fileName, $abs); +} + /** * Returns <link> tag for various icon types (favicon|mobile|generic) * @@ -1491,14 +1501,14 @@ function tpl_favicon($types=array('favicon')) { foreach ($types as $type) { switch($type) { case 'favicon': - $return .= '<link rel="shortcut icon" href="'.tpl_getFavicon().'" />'.NL; + $return .= '<link rel="shortcut icon" href="'.tpl_getMediaFile('favicon.ico').'" />'.NL; break; case 'mobile': - $return .= '<link rel="apple-touch-icon" href="'.tpl_getFavicon(false, 'apple-touch-icon.png').'" />'.NL; + $return .= '<link rel="apple-touch-icon" href="'.tpl_getMediaFile('apple-touch-icon.png').'" />'.NL; break; case 'generic': // ideal world solution, which doesn't work in any browser yet - $return .= '<link rel="icon" href="'.tpl_getFavicon(false, 'icon.svg').'" type="image/svg+xml" />'.NL; + $return .= '<link rel="icon" href="'.tpl_getMediaFile('icon.svg').'" type="image/svg+xml" />'.NL; break; } }