]> git.mxchange.org Git - friendica.git/commitdiff
Standards: add braces
authorSandro Santilli <strk@kbt.io>
Mon, 13 Mar 2017 22:09:09 +0000 (23:09 +0100)
committerSandro Santilli <strk@kbt.io>
Mon, 13 Mar 2017 22:09:09 +0000 (23:09 +0100)
(thanks @Hypolite)

include/security.php

index 23fc400b3a12f9a34c3d1c8724fb9fea669dd7dd..afb37a72d8ac0e0d456cef00898e10385ec292e8 100644 (file)
@@ -21,15 +21,18 @@ function cookie_hash($user) {
  */
 function new_cookie($time, $user = array()) {
 
-       if ($time != 0)
+       if ($time != 0) {
                $time = $time + time();
+       }
 
-       if ($user)
+       if ($user) {
                $value = json_encode(array("uid" => $user["uid"],
                                        "hash" => cookie_hash($user),
                                        "ip" => $_SERVER['REMOTE_ADDR']));
-       else
+       }
+       else {
                $value = "";
+       }
 
        setcookie("Friendica", $value, $time, "/", "",
                (get_config('system', 'ssl_policy') == SSL_POLICY_FULL), true);