summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2022-12-19 21:40:32 +0300
committerAndrew Dolgov <[email protected]>2022-12-19 21:40:32 +0300
commitb9470f9a6d99592200682ed42b4ff545761faee4 (patch)
tree04861d6ad2ff66817a5200d09f16b7f39e8c728f
parentc899c39320b5e8c119e9c66eb51dd5e80a1488e9 (diff)
use DiskCache::instance method, switch to Config::get_self_url() instead of deprecated get_self_url_prefix()
-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 {