mirror of
https://github.com/koel/koel
synced 2024-11-24 13:13:05 +00:00
a8a3baa478
This reverts commit 7cd5b230d4
.
22 lines
571 B
PHP
22 lines
571 B
PHP
<?php
|
|
|
|
namespace App\Values;
|
|
|
|
trait FormatsLastFmText
|
|
{
|
|
/**
|
|
* Correctly format a value returned by Last.fm.
|
|
*/
|
|
private static function formatLastFmText(?string $value): string
|
|
{
|
|
$artifacts = [
|
|
'Read more on Last.fm.',
|
|
'Read more on Last.fm',
|
|
'User-contributed text is available under the Creative Commons By-SA License; additional terms may apply.',
|
|
];
|
|
|
|
return $value
|
|
? trim(str_replace($artifacts, '', nl2br(strip_tags(html_entity_decode($value)))))
|
|
: '';
|
|
}
|
|
}
|