Skip to content

Commit

Permalink
Move isset
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeDombo committed Feb 21, 2018
1 parent c4b2bd1 commit ba60c40
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/classes/GlobalFunctions.php
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,14 @@ public static function userIsLoggedIn(){
public static function generatePug($view, $title, $options = [], $prettyPrint = false){
$verified = true;

$csrfToken = isset($_COOKIE["AD_CSRF"]) ? $_COOKIE["AD_CSRF"] : "";
$initialOptions = [
'title' => $title,
'subdir' => SUBDIR,
'loggedIn' => "false",
'localurl' => LOCAL_URL,
'emailEnabled' => EMAIL_ENABLED,
'csrf' => isset($_COOKIE["AD_CSRF"]) ? $_COOKIE["AD_CSRF"] : ""
'csrf' => $csrfToken
];

if(self::userIsLoggedIn()){
Expand Down Expand Up @@ -265,7 +266,8 @@ public static function verifySameOriginHeader(){
$url = parse_url($_SERVER["HTTP_REFERER"]);
}

$url = $url["host"] . isset($url["port"]) ? $url["port"]: "";
$port = isset($url["port"]) ? $url["port"] : "";
$url = $url["host"] . $port;
return mb_strpos(mb_strtolower($url), LOCAL_URL) >= 0;
}

Expand Down

0 comments on commit ba60c40

Please sign in to comment.