From 38109665c7a3d60ee4169ce7342f9fcfd50f482d Mon Sep 17 00:00:00 2001 From: Hypolite Petovan Date: Thu, 13 Dec 2018 22:30:43 -0500 Subject: [PATCH] Various improvements/fixes - Fix potential missing variable - Improve replaceMacros doc - Fix CSS value in smoothly --- include/conversation.php | 1 + src/Core/Renderer.php | 26 +++++++++++++------------- view/theme/smoothly/style.css | 2 +- 3 files changed, 15 insertions(+), 14 deletions(-) diff --git a/include/conversation.php b/include/conversation.php index b129b7d14d..d6ad4f11b6 100644 --- a/include/conversation.php +++ b/include/conversation.php @@ -994,6 +994,7 @@ function builtin_activity_puller($item, &$conv_responses) { function format_like($cnt, array $arr, $type, $id) { $o = ''; $expanded = ''; + $phrase = ''; if ($cnt == 1) { $likers = $arr[0]; diff --git a/src/Core/Renderer.php b/src/Core/Renderer.php index 44b56fcba3..2ca91b4b6c 100644 --- a/src/Core/Renderer.php +++ b/src/Core/Renderer.php @@ -48,29 +48,29 @@ class Renderer extends BaseObject 'internal' => '', 'smarty3' => '}}' ]; - - /** - * @brief This is our template processor - * - * @param string|FriendicaSmarty $s The string requiring macro substitution or an instance of FriendicaSmarty - * @param array $r key value pairs (search => replace) - * - * @return string substituted string - */ - public static function replaceMacros($s, $r) + + /** + * @brief This is our template processor + * + * @param string|FriendicaSmarty $s The string requiring macro substitution or an instance of FriendicaSmarty + * @param array $vars key value pairs (search => replace) + * + * @return string substituted string + */ + public static function replaceMacros($s, $vars) { $stamp1 = microtime(true); $a = self::getApp(); // pass $baseurl to all templates - $r['$baseurl'] = System::baseUrl(); + $vars['$baseurl'] = System::baseUrl(); $t = self::getTemplateEngine(); try { - $output = $t->replaceMacros($s, $r); + $output = $t->replaceMacros($s, $vars); } catch (Exception $e) { echo "
" . __FUNCTION__ . ": " . $e->getMessage() . "
"; - killme(); + exit(); } $a->saveTimestamp($stamp1, "rendering"); diff --git a/view/theme/smoothly/style.css b/view/theme/smoothly/style.css index 0907237871..9866bc362a 100644 --- a/view/theme/smoothly/style.css +++ b/view/theme/smoothly/style.css @@ -20,7 +20,7 @@ Orange - #fec01d /* For general iPad layouts */ #body { -moz-background-clip: border; - -moz-background-origin: pdading; + -moz-background-origin: padding; -moz-background-size: auto auto; background-attachment: scroll; background-color: transparent;