Removed notices in the frio theme (#5610)

* 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
This commit is contained in:
Michael Vogel 2018-08-14 21:37:44 +02:00 committed by Hypolite Petovan
parent 576aea124c
commit 1283b99c6f
6 changed files with 32 additions and 23 deletions

View file

@ -165,39 +165,41 @@ class NotificationsManager extends BaseObject
*/ */
public function getTabs() public function getTabs()
{ {
$selected = defaults(self::getApp()->argv, 1, '');
$tabs = [ $tabs = [
[ [
'label' => L10n::t('System'), 'label' => L10n::t('System'),
'url' => 'notifications/system', 'url' => 'notifications/system',
'sel' => ((self::getApp()->argv[1] == 'system') ? 'active' : ''), 'sel' => (($selected == 'system') ? 'active' : ''),
'id' => 'system-tab', 'id' => 'system-tab',
'accesskey' => 'y', 'accesskey' => 'y',
], ],
[ [
'label' => L10n::t('Network'), 'label' => L10n::t('Network'),
'url' => 'notifications/network', 'url' => 'notifications/network',
'sel' => ((self::getApp()->argv[1] == 'network') ? 'active' : ''), 'sel' => (($selected == 'network') ? 'active' : ''),
'id' => 'network-tab', 'id' => 'network-tab',
'accesskey' => 'w', 'accesskey' => 'w',
], ],
[ [
'label' => L10n::t('Personal'), 'label' => L10n::t('Personal'),
'url' => 'notifications/personal', 'url' => 'notifications/personal',
'sel' => ((self::getApp()->argv[1] == 'personal') ? 'active' : ''), 'sel' => (($selected == 'personal') ? 'active' : ''),
'id' => 'personal-tab', 'id' => 'personal-tab',
'accesskey' => 'r', 'accesskey' => 'r',
], ],
[ [
'label' => L10n::t('Home'), 'label' => L10n::t('Home'),
'url' => 'notifications/home', 'url' => 'notifications/home',
'sel' => ((self::getApp()->argv[1] == 'home') ? 'active' : ''), 'sel' => (($selected == 'home') ? 'active' : ''),
'id' => 'home-tab', 'id' => 'home-tab',
'accesskey' => 'h', 'accesskey' => 'h',
], ],
[ [
'label' => L10n::t('Introductions'), 'label' => L10n::t('Introductions'),
'url' => 'notifications/intros', 'url' => 'notifications/intros',
'sel' => ((self::getApp()->argv[1] == 'intros') ? 'active' : ''), 'sel' => (($selected == 'intros') ? 'active' : ''),
'id' => 'intro-tab', 'id' => 'intro-tab',
'accesskey' => 'i', 'accesskey' => 'i',
], ],

View file

@ -232,7 +232,7 @@ class Probe
if (!$lrdd) { if (!$lrdd) {
$parts = @parse_url($uri); $parts = @parse_url($uri);
if (!$parts) { if (!$parts || empty($parts["host"]) || empty($parts["path"])) {
return []; return [];
} }

View file

@ -1351,6 +1351,7 @@ class OStatus
switch ($siteinfo["type"]) { switch ($siteinfo["type"]) {
case 'photo': case 'photo':
if (!empty($siteinfo["image"])) {
$imgdata = Image::getInfoFromURL($siteinfo["image"]); $imgdata = Image::getInfoFromURL($siteinfo["image"]);
if ($imgdata) { if ($imgdata) {
$attributes = ["rel" => "enclosure", $attributes = ["rel" => "enclosure",
@ -1359,6 +1360,7 @@ class OStatus
"length" => intval($imgdata["size"])]; "length" => intval($imgdata["size"])];
XML::addElement($doc, $root, "link", "", $attributes); XML::addElement($doc, $root, "link", "", $attributes);
} }
}
break; break;
case 'video': case 'video':
$attributes = ["rel" => "enclosure", $attributes = ["rel" => "enclosure",

View file

@ -15,14 +15,14 @@ function theme_post(App $a)
} }
if (isset($_POST['frio-settings-submit'])) { if (isset($_POST['frio-settings-submit'])) {
PConfig::set(local_user(), 'frio', 'scheme', $_POST['frio_scheme']); PConfig::set(local_user(), 'frio', 'scheme', defaults($_POST, 'frio_scheme'));
PConfig::set(local_user(), 'frio', 'nav_bg', $_POST['frio_nav_bg']); PConfig::set(local_user(), 'frio', 'nav_bg', defaults($_POST, 'frio_nav_bg'));
PConfig::set(local_user(), 'frio', 'nav_icon_color', $_POST['frio_nav_icon_color']); PConfig::set(local_user(), 'frio', 'nav_icon_color', defaults($_POST, 'frio_nav_icon_color'));
PConfig::set(local_user(), 'frio', 'link_color', $_POST['frio_link_color']); PConfig::set(local_user(), 'frio', 'link_color', defaults($_POST, 'frio_link_color'));
PConfig::set(local_user(), 'frio', 'background_color', $_POST['frio_background_color']); PConfig::set(local_user(), 'frio', 'background_color', defaults($_POST, 'frio_background_color'));
PConfig::set(local_user(), 'frio', 'contentbg_transp', $_POST['frio_contentbg_transp']); PConfig::set(local_user(), 'frio', 'contentbg_transp', defaults($_POST, 'frio_contentbg_transp'));
PConfig::set(local_user(), 'frio', 'background_image', $_POST['frio_background_image']); PConfig::set(local_user(), 'frio', 'background_image', defaults($_POST, 'frio_background_image'));
PConfig::set(local_user(), 'frio', 'bg_image_option', $_POST['frio_bg_image_option']); PConfig::set(local_user(), 'frio', 'bg_image_option', defaults($_POST, 'frio_bg_image_option'));
PConfig::set(local_user(), 'frio', 'css_modified', time()); PConfig::set(local_user(), 'frio', 'css_modified', time());
} }
} }

View file

@ -46,7 +46,11 @@ function get_scheme_info($scheme)
foreach ($ll as $l) { foreach ($ll as $l) {
$l = trim($l, "\t\n\r */"); $l = trim($l, "\t\n\r */");
if ($l != '') { 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); $k = strtolower($k);
if ($k == 'author') { if ($k == 'author') {
$r = preg_match('|([^<]+)<([^>]+)>|', $v, $m); $r = preg_match('|([^<]+)<([^>]+)>|', $v, $m);

View file

@ -225,7 +225,8 @@ header('ETag: "' . $etag . '"');
header('Last-Modified: ' . $modified); header('Last-Modified: ' . $modified);
// Only send the CSS file if it was changed. // 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_modified = gmdate('r', strtotime($_SERVER['HTTP_IF_MODIFIED_SINCE']));
$cached_etag = str_replace(['"', '-gzip'], ['', ''], $cached_etag = str_replace(['"', '-gzip'], ['', ''],
stripslashes($_SERVER['HTTP_IF_NONE_MATCH'])); stripslashes($_SERVER['HTTP_IF_NONE_MATCH']));