Added some details
This commit is contained in:
parent
4188fcf064
commit
aadfeccab1
10 changed files with 48 additions and 5 deletions
|
|
@ -91,9 +91,19 @@ class Wrappers {
|
|||
return UrlBuilder::download($url, $username, $id, $watermark);
|
||||
});
|
||||
|
||||
$latte->addFunction('bool_to_str', function (bool $cond): string {
|
||||
return $cond ? 'yes' : 'no';
|
||||
});
|
||||
|
||||
// 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) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue