]> git.mxchange.org Git - friendica.git/blobdiff - mod/profile.php
Bugfix for pull request 3125
[friendica.git] / mod / profile.php
index 28b508dc0e7b25ee0e9f90a4e6cf72041d022c05..5dd8293c7fd0613d083f6b93dfcbb5a5f4df502e 100644 (file)
@@ -4,7 +4,7 @@ require_once('include/contact_widgets.php');
 require_once('include/redir.php');
 
 
-function profile_init(App &$a) {
+function profile_init(App $a) {
 
        if(! x($a->page,'aside'))
                $a->page['aside'] = '';
@@ -41,14 +41,15 @@ function profile_init(App &$a) {
        if((x($a->profile,'page-flags')) && ($a->profile['page-flags'] == PAGE_COMMUNITY)) {
                $a->page['htmlhead'] .= '<meta name="friendica.community" content="true" />';
        }
-       if(x($a->profile,'openidserver'))
+       if (x($a->profile,'openidserver')) {
                $a->page['htmlhead'] .= '<link rel="openid.server" href="' . $a->profile['openidserver'] . '" />' . "\r\n";
-       if(x($a->profile,'openid')) {
+       }
+       if (x($a->profile,'openid')) {
                $delegate = ((strstr($a->profile['openid'],'://')) ? $a->profile['openid'] : 'https://' . $a->profile['openid']);
                $a->page['htmlhead'] .= '<link rel="openid.delegate" href="' . $delegate . '" />' . "\r\n";
        }
        // site block
-       if((! $blocked) && (! $userblock)) {
+       if ((! $blocked) && (! $userblock)) {
                $keywords = ((x($a->profile,'pub_keywords')) ? $a->profile['pub_keywords'] : '');
                $keywords = str_replace(array('#',',',' ',',,'),array('',' ',',',','),$keywords);
                if(strlen($keywords))
@@ -62,11 +63,7 @@ function profile_init(App &$a) {
        header('Link: <' . App::get_baseurl() . '/xrd/?uri=' . $uri . '>; rel="lrdd"; type="application/xrd+xml"', false);
 
        $dfrn_pages = array('request', 'confirm', 'notify', 'poll');
-<<<<<<< upstream/develop
        foreach ($dfrn_pages as $dfrn) {
-=======
-       foreach($dfrn_pages as $dfrn) {
->>>>>>> HEAD~65
                $a->page['htmlhead'] .= "<link rel=\"dfrn-{$dfrn}\" href=\"".App::get_baseurl()."/dfrn_{$dfrn}/{$which}\" />\r\n";
        }
        $a->page['htmlhead'] .= "<link rel=\"dfrn-poco\" href=\"".App::get_baseurl()."/poco/{$which}\" />\r\n";
@@ -74,7 +71,7 @@ function profile_init(App &$a) {
 }
 
 
-function profile_content(&$a, $update = 0) {
+function profile_content(App $a, $update = 0) {
 
        $category = $datequery = $datequery2 = '';
 
@@ -85,6 +82,7 @@ function profile_content(&$a, $update = 0) {
                                        $datequery2 = escape_tags($a->argv[$x]);
                                } else {
                                        $datequery = escape_tags($a->argv[$x]);
+                               }
                        } else {
                                $category = $a->argv[$x];
                        }
@@ -113,10 +111,8 @@ function profile_content(&$a, $update = 0) {
        if ($update) {
                // Ensure we've got a profile owner if updating.
                $a->profile['profile_uid'] = $update;
-       } else {
-               if ($a->profile['profile_uid'] == local_user()) {
-                       nav_set_selected('home');
-               }
+       } elseif ($a->profile['profile_uid'] == local_user()) {
+               nav_set_selected('home');
        }
 
        $contact = null;
@@ -160,12 +156,12 @@ function profile_content(&$a, $update = 0) {
        }
 
        if (! $update) {
-               if (x($_GET,'tab'))
+               if (x($_GET,'tab')) {
                        $tab = notags(trim($_GET['tab']));
+               }
 
                $o.=profile_tabs($a, $is_owner, $a->profile['nickname']);
 
-
                if ($tab === 'profile') {
                        $o .= advanced_profile($a);
                        call_hooks('profile_advanced',$o);
@@ -203,14 +199,12 @@ function profile_content(&$a, $update = 0) {
 
                $o .= status_editor($a,$x);
                }
-
        }
 
 
        /**
         * Get permissions SQL - if $remote_contact is true, our remote user has been pre-verified and we already have fetched his/her groups
         */
-
        $sql_extra = item_permissions_sql($a->profile['profile_uid'],$remote_contact,$groups);