This commit is contained in:
parent
042dce9ead
commit
1989307a67
1 changed files with 7 additions and 5 deletions
12
clickat.php
12
clickat.php
|
@ -15,11 +15,13 @@ function hook_clickat_render_linklist($data)
|
||||||
'/\ @([\w\d]+).bsky.social/' => ' <a href="https://bsky.app/profile/\1.bsky.social">@\1.bsky.social</a>',
|
'/\ @([\w\d]+).bsky.social/' => ' <a href="https://bsky.app/profile/\1.bsky.social">@\1.bsky.social</a>',
|
||||||
'/\ @([\w\d]+)@([\w\d_\-\.]+)/' => ' <a href="https://\2/@\1">@\1</a>',
|
'/\ @([\w\d]+)@([\w\d_\-\.]+)/' => ' <a href="https://\2/@\1">@\1</a>',
|
||||||
'/\ @([\w\d]+)/' => ' <a href="https://twitter.com/\1">@\1</a>'
|
'/\ @([\w\d]+)/' => ' <a href="https://twitter.com/\1">@\1</a>'
|
||||||
);
|
);
|
||||||
foreach ($data['links'] as &$value)
|
foreach ($data['links'] as &$value) {
|
||||||
if (strpos($value['description'],' @') !== false)
|
if (strpos($value['description'], ' @') !== false) {
|
||||||
foreach($patterns as $nic => $link)
|
foreach($patterns as $nic => $link) {
|
||||||
$value['description'] = preg_replace($nic, $link, $value['description']);
|
$value['description'] = preg_replace($nic, $link, $value['description']);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
return $data;
|
return $data;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue