Several more warnings ... (#5340)
* Some more warnings removed * Even more warnings ... * Will it ever end? ;-) * Avoid warning in dbstructure * Origin and OStatus ... * There are more warnings solved ... yeah! * And again ... * We are not done yet * And more ... * And some new places ... * And more in the feeds * Avoid some more * And some backend stuff * Notifications cleared * Some more stuff * and again ... * It's getting fewer ... * Some warnings had been hidden in the notifications * Fix the fix * And another missing one ... * We need the owner here, not the user * Forgotten user * And more ... * And some more warnings disappeared ... * Some more frontend warnings * Some backend warnings removed * Fixed sidebar for "vier" * And more ... * Some more ... * And something for "remote self" * Am I stuck in an endless loop? * Fix: Clear tag and file field on update * Preset page content
This commit is contained in:
committed by
Hypolite Petovan
parent
32ef5623ab
commit
0360f7197a
@@ -101,7 +101,7 @@ class Network
|
||||
$a = get_app();
|
||||
|
||||
$parts = parse_url($url);
|
||||
$path_parts = explode('/', $parts['path']);
|
||||
$path_parts = explode('/', defaults($parts, 'path', ''));
|
||||
foreach ($path_parts as $part) {
|
||||
if (strlen($part) <> mb_strlen($part)) {
|
||||
$parts2[] = rawurlencode($part);
|
||||
@@ -250,7 +250,7 @@ class Network
|
||||
|
||||
$newurl = $curl_info['redirect_url'];
|
||||
|
||||
if (($new_location_info['path'] == '') && ($new_location_info['host'] != '')) {
|
||||
if (empty($new_location_info['path']) && !empty($new_location_info['host'])) {
|
||||
$newurl = $new_location_info['scheme'] . '://' . $new_location_info['host'] . $old_location_info['path'];
|
||||
}
|
||||
|
||||
@@ -890,8 +890,8 @@ class Network
|
||||
$i = 0;
|
||||
$path = "";
|
||||
do {
|
||||
$path1 = $pathparts1[$i];
|
||||
$path2 = $pathparts2[$i];
|
||||
$path1 = defaults($pathparts1, $i, '');
|
||||
$path2 = defaults($pathparts2, $i, '');
|
||||
|
||||
if ($path1 == $path2) {
|
||||
$path .= $path1."/";
|
||||
|
||||
+19
-17
@@ -159,19 +159,21 @@ class ParseUrl
|
||||
if ($do_oembed) {
|
||||
$oembed_data = OEmbed::fetchURL($url);
|
||||
|
||||
if (!in_array($oembed_data->type, ["error", "rich", ""])) {
|
||||
$siteinfo["type"] = $oembed_data->type;
|
||||
}
|
||||
if (!empty($oembed_data->type)) {
|
||||
if (!in_array($oembed_data->type, ["error", "rich", ""])) {
|
||||
$siteinfo["type"] = $oembed_data->type;
|
||||
}
|
||||
|
||||
if (($oembed_data->type == "link") && ($siteinfo["type"] != "photo")) {
|
||||
if (isset($oembed_data->title)) {
|
||||
$siteinfo["title"] = trim($oembed_data->title);
|
||||
}
|
||||
if (isset($oembed_data->description)) {
|
||||
$siteinfo["text"] = trim($oembed_data->description);
|
||||
}
|
||||
if (isset($oembed_data->thumbnail_url)) {
|
||||
$siteinfo["image"] = $oembed_data->thumbnail_url;
|
||||
if (($oembed_data->type == "link") && ($siteinfo["type"] != "photo")) {
|
||||
if (isset($oembed_data->title)) {
|
||||
$siteinfo["title"] = trim($oembed_data->title);
|
||||
}
|
||||
if (isset($oembed_data->description)) {
|
||||
$siteinfo["text"] = trim($oembed_data->description);
|
||||
}
|
||||
if (isset($oembed_data->thumbnail_url)) {
|
||||
$siteinfo["image"] = $oembed_data->thumbnail_url;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -251,9 +253,9 @@ class ParseUrl
|
||||
}
|
||||
}
|
||||
|
||||
$attr["content"] = trim(html_entity_decode($attr["content"], ENT_QUOTES, "UTF-8"));
|
||||
if (!empty($attr["content"])) {
|
||||
$attr["content"] = trim(html_entity_decode($attr["content"], ENT_QUOTES, "UTF-8"));
|
||||
|
||||
if ($attr["content"] != "") {
|
||||
switch (strtolower($attr["name"])) {
|
||||
case "fulltitle":
|
||||
$siteinfo["title"] = trim($attr["content"]);
|
||||
@@ -319,9 +321,9 @@ class ParseUrl
|
||||
}
|
||||
}
|
||||
|
||||
$attr["content"] = trim(html_entity_decode($attr["content"], ENT_QUOTES, "UTF-8"));
|
||||
if (!empty($attr["content"])) {
|
||||
$attr["content"] = trim(html_entity_decode($attr["content"], ENT_QUOTES, "UTF-8"));
|
||||
|
||||
if ($attr["content"] != "") {
|
||||
switch (strtolower($attr["property"])) {
|
||||
case "og:image":
|
||||
$siteinfo["image"] = $attr["content"];
|
||||
@@ -363,7 +365,7 @@ class ParseUrl
|
||||
"height" => $photodata[1]];
|
||||
}
|
||||
}
|
||||
} elseif ($siteinfo["image"] != "") {
|
||||
} elseif (!empty($siteinfo["image"])) {
|
||||
$src = self::completeUrl($siteinfo["image"], $url);
|
||||
|
||||
unset($siteinfo["image"]);
|
||||
|
||||
@@ -446,4 +446,19 @@ class XML
|
||||
|
||||
return $first_item->nodeValue;
|
||||
}
|
||||
|
||||
public static function getFirstAttributes($xpath, $element, $context = null)
|
||||
{
|
||||
$result = $xpath->query($element, $context);
|
||||
if (!is_object($result)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$first_item = $result->item(0);
|
||||
if (!is_object($first_item)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $first_item->attributes;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user