diff --git a/clickat.php b/clickat.php index 4a26088..cd973e6 100644 --- a/clickat.php +++ b/clickat.php @@ -15,11 +15,13 @@ function hook_clickat_render_linklist($data) '/\ @([\w\d]+).bsky.social/' => ' @\1.bsky.social', '/\ @([\w\d]+)@([\w\d_\-\.]+)/' => ' @\1', '/\ @([\w\d]+)/' => ' @\1' - ); - 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; } -