Browse Source

Add missing provider url and name

pull/10190/head
Michael 3 months ago
parent
commit
73c0bff665
  1. 14
      src/Model/Item.php

14
src/Model/Item.php

@ -2889,6 +2889,20 @@ class Item
DI::profiler()->saveTimestamp($stamp1, 'rendering');
if (isset($data['url']) && !in_array($data['url'], $ignore_links)) {
$parts = parse_url($data['url']);
if (!empty($parts['scheme']) && !empty($parts['host'])) {
if (empty($data['provider_name'])) {
$data['provider_name'] = $parts['host'];
}
if (empty($data['provider_url']) || empty(parse_url($data['provider_url'], PHP_URL_SCHEME))) {
$data['provider_url'] = $parts['scheme'] . '://' . $parts['host'];
if (!empty($parts['port'])) {
$data['provider_url'] .= ':' . $parts['port'];
}
}
}
// @todo Use a template
$rendered = BBCode::convertAttachment('', BBCode::INTERNAL, false, $data);
if ($shared) {

Loading…
Cancel
Save