diff options
author | Mario <mario@mariovavti.com> | 2023-03-12 22:04:37 +0000 |
---|---|---|
committer | Mario <mario@mariovavti.com> | 2023-03-12 22:04:37 +0000 |
commit | 3a3fd38e3a6d8d3afa17248fd5083ec582a74bad (patch) | |
tree | 07abba13754708fac931b19cf59b59cb4b8b550e | |
parent | e7c529f2c3a346a15dbc278432952c905577f9ac (diff) | |
parent | 63a861157993e78e85df10b8dc8292be5d24f5d1 (diff) | |
download | volse-hubzilla-3a3fd38e3a6d8d3afa17248fd5083ec582a74bad.tar.gz volse-hubzilla-3a3fd38e3a6d8d3afa17248fd5083ec582a74bad.tar.bz2 volse-hubzilla-3a3fd38e3a6d8d3afa17248fd5083ec582a74bad.zip |
Merge branch 'dev' into 8.2RC
-rw-r--r-- | include/event.php | 4 | ||||
-rw-r--r-- | include/oembed.php | 11 | ||||
-rw-r--r-- | include/text.php | 1 |
3 files changed, 10 insertions, 6 deletions
diff --git a/include/event.php b/include/event.php index b27504296..6273279c2 100644 --- a/include/event.php +++ b/include/event.php @@ -1389,8 +1389,8 @@ function event_store_item($arr, $event) { // 'summary' => bbcode($arr['summary']), // RFC3339 Section 4.3 'startTime' => (($arr['adjust']) ? datetime_convert('UTC', 'UTC', $arr['dtstart'], ATOM_TIME) : datetime_convert('UTC', 'UTC', $arr['dtstart'], 'Y-m-d\\TH:i:s-00:00')), - 'content' => bbcode($arr['description']), - 'location' => [ 'type' => 'Place', 'name' => bbcode($arr['location']) ], + 'content' => $arr['description'], + 'location' => [ 'type' => 'Place', 'name' => $arr['location'] ], 'source' => [ 'content' => format_event_bbcode($arr), 'mediaType' => 'text/bbcode' ], 'url' => [ [ 'mediaType' => 'text/calendar', 'href' => z_root() . '/events/ical/' . $event['event_hash'] ] ], 'actor' => Activity::encode_person($z, false), diff --git a/include/oembed.php b/include/oembed.php index bcf5d525c..fbe6a573b 100644 --- a/include/oembed.php +++ b/include/oembed.php @@ -147,6 +147,7 @@ function oembed_fetch_url($embedurl){ $txt = Cache::get('[' . App::$videowidth . '] ' . $furl); } + if(strpos(strtolower($embedurl),'.pdf') !== false && get_config('system','inline_pdf')) { $action = 'allow'; $j = [ @@ -158,7 +159,6 @@ function oembed_fetch_url($embedurl){ // set $txt to something so that we don't attempt to fetch what could be a lengthy pdf. $txt = EMPTY_STR; } - if(is_null($txt)) { $txt = EMPTY_STR; @@ -177,12 +177,17 @@ function oembed_fetch_url($embedurl){ $headers = get_headers($furl, true); - if (isset($headers['Content-Length']) && $headers['Content-Length'] > $max_oembed_size) { - $action = 'block'; + if (isset($headers['Content-Length'])) { + $content_length = ((is_array($headers['Content-Length'])) ? array_key_last($headers['Content-Length']) : $headers['Content-Length']); + + if ($content_length > $max_oembed_size) { + $action = 'block'; + } } } if ($action !== 'block') { + // try oembed autodiscovery $redirects = 0; $result = z_fetch_url($furl, false, $redirects, diff --git a/include/text.php b/include/text.php index 5dc894d11..705147e93 100644 --- a/include/text.php +++ b/include/text.php @@ -1795,7 +1795,6 @@ function prepare_body(&$item,$attach = false,$opts = false) { } $event = (($item['obj_type'] === ACTIVITY_OBJ_EVENT) ? format_event_obj($item['obj']) : []); - $prep_arr = [ 'item' => $item, 'html' => $event ? $event['content'] : $s, |