Fixed isAd crash

This commit is contained in:
Pablo Ferreiro 2023-06-12 15:08:02 +02:00
parent 19a2066fc2
commit 8c769d89d4
No known key found for this signature in database
GPG key ID: 41FBCE65B779FA24
4 changed files with 16 additions and 23 deletions

View file

@ -98,12 +98,6 @@ class Wrappers {
// Add URLs to video descriptions
// TODO: Make it work with unicode characters such as emojis
$latte->addFunction('render_desc', function (string $desc, array $textExtras = []): string {
$bytesCount = strlen($desc);
$charsCount = mb_strlen($desc);
// Skip urlify for now if there is a special char like an emoji to avoid issues
if ($bytesCount !== $charsCount) {
return $desc;
}
$sanitizedDesc = htmlspecialchars($desc);
$out = $sanitizedDesc;
foreach ($textExtras as $extra) {