diff --git a/classes/article.php b/classes/article.php index 17a40ca4f..1d441dee2 100755 --- a/classes/article.php +++ b/classes/article.php @@ -293,6 +293,7 @@ class Article extends Handler_Protected { } /** + * @param int $id article id * @return array{'formatted': string, 'entries': array>} */ static function _format_enclosures(int $id, bool $always_display_enclosures, string $article_content, bool $hide_images = false): array { diff --git a/classes/config.php b/classes/config.php index a4a42a60a..ab31bc860 100644 --- a/classes/config.php +++ b/classes/config.php @@ -448,13 +448,7 @@ class Config { /** this returns Config::SELF_URL_PATH sans trailing slash */ static function get_self_url() : string { - $self_url_path = self::get(Config::SELF_URL_PATH); - - if (substr($self_url_path, -1) === "/") { - return substr($self_url_path, 0, -1); - } else { - return $self_url_path; - } + return preg_replace("#/*$#", "", self::get(Config::SELF_URL_PATH)); } static function is_server_https() : bool { diff --git a/classes/plugin.php b/classes/plugin.php index f47ab1882..d941a1616 100644 --- a/classes/plugin.php +++ b/classes/plugin.php @@ -482,7 +482,7 @@ abstract class Plugin { /** Invoked for every enclosure entry as article is being rendered * @param array $entry - * @param int $id + * @param int $id article id * @param array{'formatted': string, 'entries': array>} $rv * @return array ($entry) * @see PluginHost::HOOK_ENCLOSURE_ENTRY