X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=boot.php;h=aad8813766002d0cd265b0eeabb6f5f580ae43c3;hb=55ee80338f4e02f9330bfcccccee6ea6e3e2036a;hp=b282f8d48e0b64577860cfcad7da20c4d943a75d;hpb=52f12ee28db97b29ce0f10c8ecf76144b80d4216;p=friendica.git diff --git a/boot.php b/boot.php index b282f8d48e..aad8813766 100644 --- a/boot.php +++ b/boot.php @@ -38,7 +38,7 @@ define ( 'FRIENDICA_PLATFORM', 'Friendica'); define ( 'FRIENDICA_CODENAME', 'Asparagus'); define ( 'FRIENDICA_VERSION', '3.5.1-dev' ); define ( 'DFRN_PROTOCOL_VERSION', '2.23' ); -define ( 'DB_UPDATE_VERSION', 1209 ); +define ( 'DB_UPDATE_VERSION', 1211 ); /** * @brief Constant with a HTML line break. @@ -670,22 +670,23 @@ class App { #set_include_path("include/$this->hostname" . PATH_SEPARATOR . get_include_path()); - if((x($_SERVER,'QUERY_STRING')) && substr($_SERVER['QUERY_STRING'],0,9) === "pagename=") { + if ((x($_SERVER,'QUERY_STRING')) && substr($_SERVER['QUERY_STRING'],0,9) === "pagename=") { $this->query_string = substr($_SERVER['QUERY_STRING'],9); // removing trailing / - maybe a nginx problem if (substr($this->query_string, 0, 1) == "/") $this->query_string = substr($this->query_string, 1); - } elseif((x($_SERVER,'QUERY_STRING')) && substr($_SERVER['QUERY_STRING'],0,2) === "q=") { + } elseif ((x($_SERVER,'QUERY_STRING')) && substr($_SERVER['QUERY_STRING'],0,2) === "q=") { $this->query_string = substr($_SERVER['QUERY_STRING'],2); // removing trailing / - maybe a nginx problem if (substr($this->query_string, 0, 1) == "/") $this->query_string = substr($this->query_string, 1); } - if (x($_GET,'pagename')) + if (x($_GET,'pagename')) { $this->cmd = trim($_GET['pagename'],'/\\'); - elseif (x($_GET,'q')) + } elseif (x($_GET,'q')) { $this->cmd = trim($_GET['q'],'/\\'); + } // fix query_string @@ -694,13 +695,15 @@ class App { // unix style "homedir" - if(substr($this->cmd,0,1) === '~') + if (substr($this->cmd,0,1) === '~') { $this->cmd = 'profile/' . substr($this->cmd,1); + } // Diaspora style profile url - if(substr($this->cmd,0,2) === 'u/') + if (substr($this->cmd,0,2) === 'u/') { $this->cmd = 'profile/' . substr($this->cmd,2); + } /* @@ -806,7 +809,7 @@ class App { function get_baseurl($ssl = false) { // Is the function called statically? - if (!is_object($this)) { + if (!(isset($this) && get_class($this) == __CLASS__)) { return self::$a->get_baseurl($ssl); } @@ -1028,7 +1031,7 @@ class App { } else { $r = q("SELECT `contact`.`avatar-date` AS picdate FROM `contact` WHERE `contact`.`thumb` like '%%/%s'", $common_filename); - if(! dbm::is_result($r)){ + if (! dbm::is_result($r)) { $this->cached_profile_image[$avatar_image] = $avatar_image; } else { $this->cached_profile_picdate[$common_filename] = "?rev=".urlencode($r[0]['picdate']); @@ -1050,7 +1053,7 @@ class App { function remove_baseurl($orig_url){ // Is the function called statically? - if (!is_object($this)) { + if (!(isset($this) && get_class($this) == __CLASS__)) { return(self::$a->remove_baseurl($orig_url)); } @@ -1548,9 +1551,9 @@ function check_url(&$a) { // We will only change the url to an ip address if there is no existing setting if(! x($url)) - $url = set_config('system','url',$a->get_baseurl()); - if((! link_compare($url,$a->get_baseurl())) && (! preg_match("/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/",$a->get_hostname))) - $url = set_config('system','url',$a->get_baseurl()); + $url = set_config('system','url',App::get_baseurl()); + if((! link_compare($url,App::get_baseurl())) && (! preg_match("/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/",$a->get_hostname))) + $url = set_config('system','url',App::get_baseurl()); return; }