From 7f4159ac258c501f9666efc465a78cb2aec9d177 Mon Sep 17 00:00:00 2001 From: Laria Carolin Chabowski Date: Mon, 21 Sep 2020 21:21:30 +0200 Subject: Code cleanup - Remove unused variables - Remove unused utility functions - Asserting presence and typehinting global variables - Remove unused variables - Add missing global - Add parameter type constraint - Fix some references to nonexisting variables --- ratatoeskr/frontend.php | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'ratatoeskr/frontend.php') diff --git a/ratatoeskr/frontend.php b/ratatoeskr/frontend.php index 51e13f7..de017dc 100644 --- a/ratatoeskr/frontend.php +++ b/ratatoeskr/frontend.php @@ -15,6 +15,9 @@ require_once(dirname(__FILE__) . "/sys/models.php"); require_once(dirname(__FILE__) . "/sys/textprocessors.php"); require_once(dirname(__FILE__) . "/libs/kses.php"); +/** @var \ste\STECore $ste */ +assert(isset($ste)); + /* * Function: section_transform_ste * Transforms an
object to an array, so it can be accessed via a STE template. @@ -140,8 +143,6 @@ function article_transform_ste($article, $lang) */ function comment_transform_ste($comment) { - global $rel_path_to_root, $ratatoeskr_settings; - return [ "id" => $comment->get_id(), "text" => $comment->create_html(), @@ -747,7 +748,7 @@ $on_comment_store = []; */ function frontend_url_handler(&$data, $url_now, &$url_next) { - global $ste, $ratatoeskr_settings, $languages, $metasections, $comment_validators, $on_comment_store; + global $ste, $ratatoeskr_settings, $languages, $comment_validators, $on_comment_store; $path = array_merge([$url_now], $url_next); $url_next = []; -- cgit v1.2.3-54-g00ecf