PHP-CS-Fixer fixes
lint / lint (push) Failing after 14s Details

This commit is contained in:
n 2024-02-11 21:50:03 +01:00
parent 042dce9ead
commit 65f203268d
Signed by: n
GPG Key ID: 510227DD6C502CE3
1 changed files with 6 additions and 4 deletions

View File

@ -16,10 +16,12 @@ function hook_clickat_render_linklist($data)
'/\ @([\w\d]+)@([\w\d_\-\.]+)/' => ' <a href="https://\2/@\1">&commat;\1</a>',
'/\ @([\w\d]+)/' => ' <a href="https://twitter.com/\1">&commat;\1</a>'
);
foreach ($data['links'] as &$value)
if (strpos($value['description'],' @') !== false)
foreach($patterns as $nic => $link)
foreach ($data['links'] as &$value) {
if (strpos($value['description'],' @') !== false) {
foreach($patterns as $nic => $link) {
$value['description'] = preg_replace($nic, $link, $value['description']);
}
}
}
return $data;
}