Do not use the DIRECTORY_SEPARATOR constant for URLs

The constant DIRECTORY_SEPARATOR is "\" on windows and therefore the favicon urls are invalid for php on windows.

Renamed the FAVICON_PUBLIC_DIRECTORY constant to a more descriptive name.
This commit is contained in:
Mathias Kresin 2015-12-09 20:19:52 +01:00
parent fce8d09bfc
commit 6d36e1cb16
4 changed files with 6 additions and 6 deletions

View File

@ -16,7 +16,7 @@ defined('ROOT_DIRECTORY') or define('ROOT_DIRECTORY', __DIR__);
defined('DATA_DIRECTORY') or define('DATA_DIRECTORY', ROOT_DIRECTORY.DIRECTORY_SEPARATOR.'data');
defined('FAVICON_DIRECTORY') or define('FAVICON_DIRECTORY', DATA_DIRECTORY.DIRECTORY_SEPARATOR.'favicons');
defined('FAVICON_PUBLIC_DIRECTORY') or define('FAVICON_PUBLIC_DIRECTORY', 'data'.DIRECTORY_SEPARATOR.'favicons');
defined('FAVICON_URL_PATH') or define('FAVICON_URL_PATH', 'data/favicons');
defined('ENABLE_MULTIPLE_DB') or define('ENABLE_MULTIPLE_DB', true);
defined('DB_FILENAME') or define('DB_FILENAME', 'db.sqlite');

View File

@ -12,8 +12,8 @@ define('DATA_DIRECTORY', __DIR__.'/data');
// FAVICON_DIRECTORY => default is favicons (writable directory)
define('FAVICON_DIRECTORY', DATA_DIRECTORY.DIRECTORY_SEPARATOR.'favicons');
// FAVICON_PUBLIC_DIRECTORY => default is data/favicons/
define('FAVICON_PUBLIC_DIRECTORY', 'data'.DIRECTORY_SEPARATOR.'favicons');
// FAVICON_URL_PATH => default is data/favicons/
define('FAVICON_URL_PATH', 'data/favicons');
// DB_FILENAME => default value is db.sqlite (default database filename)
define('DB_FILENAME', 'db.sqlite');

View File

@ -26,8 +26,8 @@ define('DATA_DIRECTORY', __DIR__.'/data');
// FAVICON_DIRECTORY => default is favicons (writable directory)
define('FAVICON_DIRECTORY', DATA_DIRECTORY.DIRECTORY_SEPARATOR.'favicons');
// FAVICON_PUBLIC_DIRECTORY => default is data/favicons/
define('FAVICON_PUBLIC_DIRECTORY', 'data'.DIRECTORY_SEPARATOR.'favicons');
// FAVICON_URL_PATH => default is data/favicons/
define('FAVICON_URL_PATH', 'data/favicons');
// DB_FILENAME => default value is db.sqlite (default database filename)
define('DB_FILENAME', 'db.sqlite');

View File

@ -52,7 +52,7 @@ function favicon_extension($type)
function favicon(array $favicons, $feed_id)
{
if (! empty($favicons[$feed_id])) {
return '<img src="'.FAVICON_PUBLIC_DIRECTORY.DIRECTORY_SEPARATOR.$favicons[$feed_id].'" class="favicon"/>';
return '<img src="'.FAVICON_URL_PATH.'/'.$favicons[$feed_id].'" class="favicon"/>';
}
return '';