summaryrefslogtreecommitdiff
path: root/init.php
diff options
context:
space:
mode:
Diffstat (limited to 'init.php')
-rw-r--r--init.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/init.php b/init.php
index 484a22d..32adc9e 100644
--- a/init.php
+++ b/init.php
@@ -22,7 +22,7 @@ class Af_Proxy_Http extends Plugin {
function init($host) {
$this->host = $host;
- $this->cache = new DiskCache("images");
+ $this->cache = DiskCache::instance("images");
$host->add_hook($host::HOOK_RENDER_ARTICLE, $this, 150);
$host->add_hook($host::HOOK_RENDER_ARTICLE_CDM, $this, 150);
@@ -56,7 +56,7 @@ class Af_Proxy_Http extends Plugin {
// - called without user context
// - session-spefific token is invalid
if (
- strpos($url, get_self_url_prefix()) === 0 ||
+ strpos($url, Config::get_self_url()) === 0 ||
empty($_SESSION["uid"]) ||
$_REQUEST['af_proxy_http_token'] != $_SESSION['af_proxy_http_token']) {
header("Location: $url");
@@ -109,7 +109,7 @@ class Af_Proxy_Http extends Plugin {
private function rewrite_url_if_needed(string $url, bool $all_remote = false) : string {
/* don't rewrite urls pointing to ourselves */
- if (strpos($url, get_self_url_prefix()) === 0)
+ if (strpos($url, Config::get_self_url()) === 0)
return $url;
/* we don't need to handle URLs where local cache already exists, tt-rss rewrites those automatically */
@@ -119,7 +119,7 @@ class Af_Proxy_Http extends Plugin {
if ($all_remote) {
$host = parse_url($url, PHP_URL_HOST);
- $self_host = parse_url(get_self_url_prefix(), PHP_URL_HOST);
+ $self_host = parse_url(Config::get_self_url(), PHP_URL_HOST);
$is_remote = $host != $self_host;
} else {