From 244636d26c790ae15b8af105d07b37dac47c6ea4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Roland=20H=C3=A4der?= Date: Tue, 20 Dec 2016 11:14:30 +0100 Subject: [PATCH] added curly braces + space between "if" and brace + added TODO MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- mod/home.php | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/mod/home.php b/mod/home.php index 7289a0fb6d..8bee1aef00 100644 --- a/mod/home.php +++ b/mod/home.php @@ -6,12 +6,13 @@ function home_init(App &$a) { $ret = array(); call_hooks('home_init',$ret); - if(local_user() && ($a->user['nickname'])) + if (local_user() && ($a->user['nickname'])) { goaway(App::get_baseurl()."/network"); - //goaway(App::get_baseurl()."/profile/".$a->user['nickname']); + } - if(strlen(get_config('system','singleuser'))) + if (strlen(get_config('system','singleuser'))) { goaway(App::get_baseurl()."/profile/" . get_config('system','singleuser')); + } }} @@ -21,18 +22,24 @@ function home_content(App &$a) { $o = ''; - if(x($_SESSION,'theme')) + if (x($_SESSION,'theme')) { unset($_SESSION['theme']); - if(x($_SESSION,'mobile-theme')) + } + if (x($_SESSION,'mobile-theme')) { unset($_SESSION['mobile-theme']); + } - if(file_exists('home.html')){ - if(file_exists('home.css')){ - $a->page['htmlhead'] .= '';} + /// @TODO No absolute path used, maybe risky (security) + if (file_exists('home.html')) { + if (file_exists('home.css')) { + $a->page['htmlhead'] .= ''; + } - $o .= file_get_contents('home.html');} + $o .= file_get_contents('home.html');} - else $o .= '

'.((x($a->config,'sitename')) ? sprintf(t("Welcome to %s"), $a->config['sitename']) : "").'

'; + else { + $o .= '

'.((x($a->config,'sitename')) ? sprintf(t("Welcome to %s"), $a->config['sitename']) : "").'

'; + } $o .= login(($a->config['register_policy'] == REGISTER_CLOSED) ? 0 : 1);