]> git.mxchange.org Git - friendica.git/commitdiff
Removed notices in the frio theme (#5610)
authorMichael Vogel <icarus@dabo.de>
Tue, 14 Aug 2018 19:37:44 +0000 (21:37 +0200)
committerHypolite Petovan <mrpetovan@eml.cc>
Tue, 14 Aug 2018 19:37:44 +0000 (19:37 +0000)
* Removed notices in the frio theme

* And fixed notices in the notifications

* And some more in frio

* Null is the default value

* And some small notice in the probing removed

* Added note

* Clarified note

* And a removed notice in OStatus

src/Core/NotificationsManager.php
src/Network/Probe.php
src/Protocol/OStatus.php
view/theme/frio/config.php
view/theme/frio/php/scheme.php
view/theme/frio/style.php

index 734e4eb03095acfa3c8bd2e477444275fc8b2d07..c994755e7a231cd3f54d552a4f7c31f5f79cd83b 100644 (file)
@@ -165,39 +165,41 @@ class NotificationsManager extends BaseObject
         */
        public function getTabs()
        {
+               $selected = defaults(self::getApp()->argv, 1, '');
+
                $tabs = [
                        [
                                'label' => L10n::t('System'),
                                'url'   => 'notifications/system',
-                               'sel'   => ((self::getApp()->argv[1] == 'system') ? 'active' : ''),
+                               'sel'   => (($selected == 'system') ? 'active' : ''),
                                'id'    => 'system-tab',
                                'accesskey' => 'y',
                        ],
                        [
                                'label' => L10n::t('Network'),
                                'url'   => 'notifications/network',
-                               'sel'   => ((self::getApp()->argv[1] == 'network') ? 'active' : ''),
+                               'sel'   => (($selected == 'network') ? 'active' : ''),
                                'id'    => 'network-tab',
                                'accesskey' => 'w',
                        ],
                        [
                                'label' => L10n::t('Personal'),
                                'url'   => 'notifications/personal',
-                               'sel'   => ((self::getApp()->argv[1] == 'personal') ? 'active' : ''),
+                               'sel'   => (($selected == 'personal') ? 'active' : ''),
                                'id'    => 'personal-tab',
                                'accesskey' => 'r',
                        ],
                        [
                                'label' => L10n::t('Home'),
                                'url'   => 'notifications/home',
-                               'sel'   => ((self::getApp()->argv[1] == 'home') ? 'active' : ''),
+                               'sel'   => (($selected == 'home') ? 'active' : ''),
                                'id'    => 'home-tab',
                                'accesskey' => 'h',
                        ],
                        [
                                'label' => L10n::t('Introductions'),
                                'url'   => 'notifications/intros',
-                               'sel'   => ((self::getApp()->argv[1] == 'intros') ? 'active' : ''),
+                               'sel'   => (($selected == 'intros') ? 'active' : ''),
                                'id'    => 'intro-tab',
                                'accesskey' => 'i',
                        ],
index 49c27fb4f2f93957b072dcc1740193a43ab7b354..366853c999d92da33b20729a838bb164946e3a1c 100644 (file)
@@ -232,7 +232,7 @@ class Probe
 
                if (!$lrdd) {
                        $parts = @parse_url($uri);
-                       if (!$parts) {
+                       if (!$parts || empty($parts["host"]) || empty($parts["path"])) {
                                return [];
                        }
 
index 80c6edbe9f2b8614fe884b875f811f1aeda8a531..971a91fa1244642d6e6ece4d9a889d577bd07a05 100644 (file)
@@ -1351,13 +1351,15 @@ class OStatus
 
                switch ($siteinfo["type"]) {
                        case 'photo':
-                               $imgdata = Image::getInfoFromURL($siteinfo["image"]);
-                               if ($imgdata) {
-                                       $attributes = ["rel" => "enclosure",
-                                                       "href" => $siteinfo["image"],
-                                                       "type" => $imgdata["mime"],
-                                                       "length" => intval($imgdata["size"])];
-                                       XML::addElement($doc, $root, "link", "", $attributes);
+                               if (!empty($siteinfo["image"])) {
+                                       $imgdata = Image::getInfoFromURL($siteinfo["image"]);
+                                       if ($imgdata) {
+                                               $attributes = ["rel" => "enclosure",
+                                                               "href" => $siteinfo["image"],
+                                                               "type" => $imgdata["mime"],
+                                                               "length" => intval($imgdata["size"])];
+                                               XML::addElement($doc, $root, "link", "", $attributes);
+                                       }
                                }
                                break;
                        case 'video':
index 55a653696abc832f2fd11b5fe69b6d73b171ea9f..13ab78477c11b6f2dd891f220d3b2e8480036b6f 100644 (file)
@@ -15,14 +15,14 @@ function theme_post(App $a)
        }
 
        if (isset($_POST['frio-settings-submit'])) {
-               PConfig::set(local_user(), 'frio', 'scheme',           $_POST['frio_scheme']);
-               PConfig::set(local_user(), 'frio', 'nav_bg',           $_POST['frio_nav_bg']);
-               PConfig::set(local_user(), 'frio', 'nav_icon_color',   $_POST['frio_nav_icon_color']);
-               PConfig::set(local_user(), 'frio', 'link_color',       $_POST['frio_link_color']);
-               PConfig::set(local_user(), 'frio', 'background_color', $_POST['frio_background_color']);
-               PConfig::set(local_user(), 'frio', 'contentbg_transp', $_POST['frio_contentbg_transp']);
-               PConfig::set(local_user(), 'frio', 'background_image', $_POST['frio_background_image']);
-               PConfig::set(local_user(), 'frio', 'bg_image_option',  $_POST['frio_bg_image_option']);
+               PConfig::set(local_user(), 'frio', 'scheme',           defaults($_POST, 'frio_scheme'));
+               PConfig::set(local_user(), 'frio', 'nav_bg',           defaults($_POST, 'frio_nav_bg'));
+               PConfig::set(local_user(), 'frio', 'nav_icon_color',   defaults($_POST, 'frio_nav_icon_color'));
+               PConfig::set(local_user(), 'frio', 'link_color',       defaults($_POST, 'frio_link_color'));
+               PConfig::set(local_user(), 'frio', 'background_color', defaults($_POST, 'frio_background_color'));
+               PConfig::set(local_user(), 'frio', 'contentbg_transp', defaults($_POST, 'frio_contentbg_transp'));
+               PConfig::set(local_user(), 'frio', 'background_image', defaults($_POST, 'frio_background_image'));
+               PConfig::set(local_user(), 'frio', 'bg_image_option',  defaults($_POST, 'frio_bg_image_option'));
                PConfig::set(local_user(), 'frio', 'css_modified',     time());
        }
 }
index 538839b2c256f8623b3b66a80c7acaa0816082aa..05829bb21f122aede7bcac2f60a5369dd5134ee0 100644 (file)
@@ -46,7 +46,11 @@ function get_scheme_info($scheme)
                foreach ($ll as $l) {
                        $l = trim($l, "\t\n\r */");
                        if ($l != '') {
-                               list($k, $v) = array_map('trim', explode(':', $l, 2));
+                               $values = array_map('trim', explode(':', $l, 2));
+                               if (count($values) < 2) {
+                                       continue;
+                               }
+                               list($k, $v) = $values;
                                $k = strtolower($k);
                                if ($k == 'author') {
                                        $r = preg_match('|([^<]+)<([^>]+)>|', $v, $m);
index 30f8a0d77145e88627925bc1cb999d56ee48bc90..e0f65960f6886e620feafd8a4aad89c019daec15 100644 (file)
@@ -225,7 +225,8 @@ header('ETag: "' . $etag . '"');
 header('Last-Modified: ' . $modified);
 
 // Only send the CSS file if it was changed.
-if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) || isset($_SERVER['HTTP_IF_NONE_MATCH'])) {
+/// @todo Check if this works at all (possibly clients are sending only the one or the other header) - compare with mod/photo.php
+if (isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) && isset($_SERVER['HTTP_IF_NONE_MATCH'])) {
        $cached_modified = gmdate('r', strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']));
        $cached_etag = str_replace(['"', '-gzip'], ['', ''],
                                stripslashes($_SERVER['HTTP_IF_NONE_MATCH']));