diff options
| author | 2014-12-12 18:58:34 +0100 | |
|---|---|---|
| committer | 2014-12-12 18:58:34 +0100 | |
| commit | eabcf90f5266b746503fef5c438971d7d6a1689e (patch) | |
| tree | 7f2d6d38d297a0f4c4b4e7d52e0d59ce7f7f025b /lib/lib_rss.php | |
| parent | 99763412c2f49e4e52b5a0343bb465141be76188 (diff) | |
| parent | 6078888de631ea105410079888838503fd7acb3d (diff) | |
Merge branch 'dev' into beta
Conflicts:
app/i18n/en.php
app/i18n/fr.php
Diffstat (limited to 'lib/lib_rss.php')
| -rw-r--r-- | lib/lib_rss.php | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/lib/lib_rss.php b/lib/lib_rss.php index e7ca95aba..264c69d58 100644 --- a/lib/lib_rss.php +++ b/lib/lib_rss.php @@ -79,11 +79,11 @@ function format_bytes($bytes, $precision = 2, $system = 'IEC') { } function timestamptodate ($t, $hour = true) { - $month = _t(date('M', $t)); + $month = _t('gen.date.' . date('M', $t)); if ($hour) { - $date = _t('format_date_hour', $month); + $date = _t('gen.date.format_date_hour', $month); } else { - $date = _t('format_date', $month); + $date = _t('gen.date.format_date', $month); } return @date ($date, $t); @@ -110,7 +110,7 @@ function html_only_entity_decode($text) { function customSimplePie() { $limits = Minz_Configuration::limits(); $simplePie = new SimplePie(); - $simplePie->set_useragent(_t('freshrss') . '/' . FRESHRSS_VERSION . ' (' . PHP_OS . '; ' . FRESHRSS_WEBSITE . ') ' . SIMPLEPIE_NAME . '/' . SIMPLEPIE_VERSION); + $simplePie->set_useragent(_t('gen.freshrss') . '/' . FRESHRSS_VERSION . ' (' . PHP_OS . '; ' . FRESHRSS_WEBSITE . ') ' . SIMPLEPIE_NAME . '/' . SIMPLEPIE_VERSION); $simplePie->set_cache_location(CACHE_PATH); $simplePie->set_cache_duration($limits['cache_duration']); $simplePie->set_timeout($limits['timeout']); @@ -242,11 +242,14 @@ function is_referer_from_same_domain() { $host = parse_url(((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on') ? 'https://' : 'http://') . (empty($_SERVER['HTTP_HOST']) ? $_SERVER['SERVER_NAME'] : $_SERVER['HTTP_HOST'])); $referer = parse_url($_SERVER['HTTP_REFERER']); - if (empty($host['scheme']) || empty($referer['scheme']) || $host['scheme'] !== $referer['scheme'] || - empty($host['host']) || empty($referer['host']) || $host['host'] !== $referer['host']) { + if (empty($host['host']) || empty($referer['host']) || $host['host'] !== $referer['host']) { return false; } - return (isset($host['port']) ? $host['port'] : 0) === (isset($referer['port']) ? $referer['port'] : 0); + //TODO: check 'scheme', taking into account the case of a proxy + if ((isset($host['port']) ? $host['port'] : 0) !== (isset($referer['port']) ? $referer['port'] : 0)) { + return false; + } + return true; } |
