Commit 7e5c55ea authored by Malcolm Blaney's avatar Malcolm Blaney

Bad copypasta in microformats.php, full path to image handler needs

to be resolved via $_SERVER. Also missed adding full url to image.php.
parent a728439b
Pipeline #34772058 passed with stage
in 1 minute and 13 seconds
......@@ -131,8 +131,9 @@ function discover_endpoint($url, $rels) {
// Use SimplePie to cache images.
include_once 'autoloader.php';
$simple_pie = new SimplePie();
$scheme = $this->user->config->Secure() ? 'https://' : 'http://';
$handler = $scheme . $this->user->config->ServerName() . '/php/image.php';
$scheme = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== '' ?
'https://' : 'http://';
$handler = $scheme . $_SERVER['SERVER_NAME'] . '/php/image.php';
// The full image handler url is required for Microsub clients.
$simple_pie->set_image_handler($handler);
$simple_pie->init();
......@@ -324,9 +325,9 @@ function parse_hcard($author, $name_only = false) {
// Use SimplePie to cache images.
include_once 'autoloader.php';
$simple_pie = new SimplePie();
$scheme = $this->user->config->Secure() ? 'https://' : 'http://';
$handler = $scheme . $this->user->config->ServerName() .
'/php/image.php';
$scheme = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== '' ?
'https://' : 'http://';
$handler = $scheme . $_SERVER['SERVER_NAME'] . '/php/image.php';
// The full image handler url is required for Microsub clients.
$simple_pie->set_image_handler($handler);
$simple_pie->init();
......
......@@ -24,7 +24,10 @@ if (!preg_match('/^[[:xdigit:]]+$/', $id)) {
include 'autoloader.php';
$simple_pie = new SimplePie();
$simple_pie->set_image_handler('/php/image.php');
$scheme = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== '' ?
'https://' : 'http://';
$handler = $scheme . $_SERVER['SERVER_NAME'] . '/php/image.php';
$simple_pie->set_image_handler($handler);
$simple_pie->init();
$cache_dir = $simple_pie->cache_location;
$cache = $simple_pie->registry->call('Cache', 'get_handler',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment