Add missing provider url and name
This commit is contained in:
parent
4b12c54345
commit
73c0bff665
1 changed files with 14 additions and 0 deletions
|
@ -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…
Reference in a new issue