diff options
| author | 2016-06-12 22:21:57 +0200 | |
|---|---|---|
| committer | 2016-06-12 22:21:57 +0200 | |
| commit | 7bc2ff45009a601550d77007c94ec23e2ced8f19 (patch) | |
| tree | 8f175b55e291a152d2811d85f4a6d085f18f6849 /lib | |
| parent | 8dcc0fd65a36adedb12e5d54bafb39e7e553d38b (diff) | |
| parent | 17de4363b5b0ab3f3ddc703ccf98332770040e17 (diff) | |
Merge pull request #1165 from FreshRSS/dev1.3.2-beta
Release 1.3.2-beta
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/Favicon/DataAccess.php | 3 | ||||
| -rw-r--r-- | lib/Favicon/Favicon.php | 2 | ||||
| -rw-r--r-- | lib/Minz/Request.php | 5 | ||||
| -rw-r--r-- | lib/Minz/Url.php | 12 | ||||
| -rw-r--r-- | lib/SimplePie/SimplePie.php | 1 | ||||
| -rw-r--r-- | lib/lib_rss.php | 4 |
6 files changed, 18 insertions, 9 deletions
diff --git a/lib/Favicon/DataAccess.php b/lib/Favicon/DataAccess.php index 2bfdf640e..17f26b333 100644 --- a/lib/Favicon/DataAccess.php +++ b/lib/Favicon/DataAccess.php @@ -15,7 +15,8 @@ class DataAccess { public function retrieveHeader($url) { $this->set_context(); - return @get_headers($url, TRUE); + $headers = @get_headers($url, 1); + return array_change_key_case($headers); } public function saveCache($file, $data) { diff --git a/lib/Favicon/Favicon.php b/lib/Favicon/Favicon.php index 7ea6ccf16..1912050d6 100644 --- a/lib/Favicon/Favicon.php +++ b/lib/Favicon/Favicon.php @@ -99,7 +99,7 @@ class Favicon switch ($status) { case '301': case '302': - $url = $headers['Location']; + $url = isset($headers['location']) ? $headers['location'] : ''; break; default: $loop = FALSE; diff --git a/lib/Minz/Request.php b/lib/Minz/Request.php index 81457df9e..f80b707d6 100644 --- a/lib/Minz/Request.php +++ b/lib/Minz/Request.php @@ -137,12 +137,11 @@ class Minz_Request { /** * Return the base_url from configuration and add a suffix if given. * - * @param $base_url_suffix a string to add at base_url (default: empty string) * @return the base_url with a suffix. */ - public static function getBaseUrl($base_url_suffix = '') { + public static function getBaseUrl() { $conf = Minz_Configuration::get('system'); - $url = rtrim($conf->base_url, '/\\') . $base_url_suffix; + $url = rtrim($conf->base_url, '/\\'); return filter_var($url, FILTER_SANITIZE_URL); } diff --git a/lib/Minz/Url.php b/lib/Minz/Url.php index 382437e9a..c7c67123e 100644 --- a/lib/Minz/Url.php +++ b/lib/Minz/Url.php @@ -24,11 +24,15 @@ class Minz_Url { $url_string = ''; if ($absolute) { - $url_string = Minz_Request::getBaseUrl(PUBLIC_TO_INDEX_PATH); - if ($url_string === PUBLIC_TO_INDEX_PATH) { + $url_string = Minz_Request::getBaseUrl(); + if ($url_string == '') { $url_string = Minz_Request::guessBaseUrl(); - } else { - $url_string .= '/'; + } + if ($isArray) { + $url_string .= PUBLIC_TO_INDEX_PATH; + } + if ($absolute === 'root') { + $url_string = parse_url($url_string, PHP_URL_PATH); } } else { $url_string = $isArray ? '.' : PUBLIC_RELATIVE; diff --git a/lib/SimplePie/SimplePie.php b/lib/SimplePie/SimplePie.php index a84f6dab3..8af55c9fd 100644 --- a/lib/SimplePie/SimplePie.php +++ b/lib/SimplePie/SimplePie.php @@ -1668,6 +1668,7 @@ class SimplePie $locate = null; } + $file->body = trim($file->body); $this->raw_data = $file->body; $this->permanent_url = $file->permanent_url; $headers = $file->headers; diff --git a/lib/lib_rss.php b/lib/lib_rss.php index 135115ea5..f89baf9b1 100644 --- a/lib/lib_rss.php +++ b/lib/lib_rss.php @@ -548,3 +548,7 @@ function base64url_encode($data) { function base64url_decode($data) { return base64_decode(strtr($data, '-_', '+/')); } + +function _i($icon, $url_only = false) { + return FreshRSS_Themes::icon($icon, $url_only); +} |
