]> git.mxchange.org Git - friendica.git/blobdiff - src/App/Page.php
Merge branch 'bug/phpinfo-accessible-hotfix' into 2020.09-rc
[friendica.git] / src / App / Page.php
index 50afac1b4f48df48c85b06e07b198f8e8beea971..c2bfb388788085ccbdbdc176f0a9db74bb32b447 100644 (file)
@@ -165,11 +165,10 @@ class Page implements ArrayAccess
         * The path can be absolute or relative to the Friendica installation base folder.
         *
         * @param string $path
-        *
+        * @param string $media
         * @see Page::initHead()
-        *
         */
-       public function registerStylesheet($path)
+       public function registerStylesheet($path, string $media = 'screen')
        {
                $path = Network::appendQueryParam($path, ['v' => FRIENDICA_VERSION]);
 
@@ -177,7 +176,7 @@ class Page implements ArrayAccess
                        $path = mb_substr($path, mb_strlen($this->basePath . DIRECTORY_SEPARATOR));
                }
 
-               $this->stylesheets[] = trim($path, '/');
+               $this->stylesheets[trim($path, '/')] = $media;
        }
 
        /**
@@ -252,7 +251,7 @@ class Page implements ArrayAccess
                        '$shortcut_icon'   => $shortcut_icon,
                        '$touch_icon'      => $touch_icon,
                        '$block_public'    => intval($config->get('system', 'block_public')),
-                       '$stylesheets'     => array_unique($this->stylesheets),
+                       '$stylesheets'     => $this->stylesheets,
                ]) . $this->page['htmlhead'];
        }
 
@@ -276,7 +275,7 @@ class Page implements ArrayAccess
                // If you're just visiting, let javascript take you home
                if (!empty($_SESSION['visitor_home'])) {
                        $homebase = $_SESSION['visitor_home'];
-               } elseif (local_user()) {
+               } elseif (!empty($app->user['nickname'])) {
                        $homebase = 'profile/' . $app->user['nickname'];
                }