1
1
Fork 0

Merge pull request #6752 from MrPetovan/bug/notices

Fix various notices
This commit is contained in:
Michael Vogel 2019-02-24 21:30:07 +01:00 committed by GitHub
commit 4c6c5786ad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 32 additions and 32 deletions

View file

@ -769,31 +769,33 @@ class DFRN
*/
private static function addEntryAuthor(DOMDocument $doc, $element, $contact_url, $item)
{
$contact = Contact::getDetailsByURL($contact_url, $item["uid"]);
$author = $doc->createElement($element);
XML::addElement($doc, $author, "name", $contact["name"]);
XML::addElement($doc, $author, "uri", $contact["url"]);
XML::addElement($doc, $author, "dfrn:handle", $contact["addr"]);
/// @Todo
/// - Check real image type and image size
/// - Check which of these boths elements we should use
$attributes = [
$contact = Contact::getDetailsByURL($contact_url, $item["uid"]);
if (!empty($contact)) {
XML::addElement($doc, $author, "name", $contact["name"]);
XML::addElement($doc, $author, "uri", $contact["url"]);
XML::addElement($doc, $author, "dfrn:handle", $contact["addr"]);
/// @Todo
/// - Check real image type and image size
/// - Check which of these boths elements we should use
$attributes = [
"rel" => "photo",
"type" => "image/jpeg",
"media:width" => 80,
"media:height" => 80,
"href" => $contact["photo"]];
XML::addElement($doc, $author, "link", "", $attributes);
XML::addElement($doc, $author, "link", "", $attributes);
$attributes = [
$attributes = [
"rel" => "avatar",
"type" => "image/jpeg",
"media:width" => 80,
"media:height" => 80,
"href" => $contact["photo"]];
XML::addElement($doc, $author, "link", "", $attributes);
XML::addElement($doc, $author, "link", "", $attributes);
}
return $author;
}
@ -1603,6 +1605,7 @@ class DFRN
if (empty($author['avatar'])) {
Logger::log('Empty author: ' . $xml);
$author['avatar'] = '';
}
if (DBA::isResult($contact_old) && !$onlyfetch) {

View file

@ -1763,20 +1763,17 @@ class OStatus
$verb = NAMESPACE_ACTIVITY_SCHEMA."favorite";
self::entryContent($doc, $entry, $item, $owner, "Favorite", $verb, false);
$as_object = $doc->createElement("activity:object");
$parent = Item::selectFirst([], ['uri' => $item["thr-parent"], 'uid' => $item["uid"]]);
if (DBA::isResult($parent)) {
$as_object = $doc->createElement("activity:object");
if (!$parent) {
$parent = [];
XML::addElement($doc, $as_object, "activity:object-type", self::constructObjecttype($parent));
self::entryContent($doc, $as_object, $parent, $owner, "New entry");
$entry->appendChild($as_object);
}
XML::addElement($doc, $as_object, "activity:object-type", self::constructObjecttype($parent));
self::entryContent($doc, $as_object, $parent, $owner, "New entry");
$entry->appendChild($as_object);
self::entryFooter($doc, $entry, $item, $owner);
return $entry;

View file

@ -35,16 +35,16 @@ function theme_admin_post(App $a)
}
if (isset($_POST['frio-settings-submit'])) {
Config::set('frio', 'scheme', $_POST['frio_scheme']);
Config::set('frio', 'nav_bg', $_POST['frio_nav_bg']);
Config::set('frio', 'nav_icon_color', $_POST['frio_nav_icon_color']);
Config::set('frio', 'link_color', $_POST['frio_link_color']);
Config::set('frio', 'background_color', $_POST['frio_background_color']);
Config::set('frio', 'contentbg_transp', $_POST['frio_contentbg_transp']);
Config::set('frio', 'background_image', $_POST['frio_background_image']);
Config::set('frio', 'bg_image_option', $_POST['frio_bg_image_option']);
Config::set('frio', 'login_bg_image', $_POST['frio_login_bg_image']);
Config::set('frio', 'login_bg_color', $_POST['frio_login_bg_color']);
Config::set('frio', 'scheme', defaults($_POST, 'frio_scheme', ''));
Config::set('frio', 'nav_bg', defaults($_POST, 'frio_nav_bg', ''));
Config::set('frio', 'nav_icon_color', defaults($_POST, 'frio_nav_icon_color', ''));
Config::set('frio', 'link_color', defaults($_POST, 'frio_link_color', ''));
Config::set('frio', 'background_color', defaults($_POST, 'frio_background_color', ''));
Config::set('frio', 'contentbg_transp', defaults($_POST, 'frio_contentbg_transp', ''));
Config::set('frio', 'background_image', defaults($_POST, 'frio_background_image', ''));
Config::set('frio', 'bg_image_option', defaults($_POST, 'frio_bg_image_option', ''));
Config::set('frio', 'login_bg_image', defaults($_POST, 'frio_login_bg_image', ''));
Config::set('frio', 'login_bg_color', defaults($_POST, 'frio_login_bg_color', ''));
Config::set('frio', 'css_modified', time());
}
}