Compare commits

..

1 commit

Author SHA1 Message Date
n
cf52ed2036
regex fixes 2024-02-25 20:34:47 +01:00

View file

@ -12,9 +12,9 @@ use Shaarli\Render\TemplatePage;
function hook_clickat_render_linklist($data)
{
$patterns = array(
'/([^\S]+)@([\w]+).bsky.social/' => ' <a href="https://bsky.app/profile/\2.bsky.social">&commat;\2.bsky.social</a>',
'/([^\S]+)@([\w]+).bsky.social/' => ' <a href="https://bsky.app/profile/\2.bsky.social">&commat;\2.bsky.social</a>',
'/([^\S]+)@([\w]+)@([\w_\-\.]+)/' => ' <a href="https://\3/@\2">&commat;\2</a>',
'/([^\S]+)@([\w]+)/' => ' <a href="https://twitter.com/\2">&commat;\2</a>'
'/([^\S]+)@([\w]+)/' => ' <a href="https://twitter.com/\2">&commat;\2</a>'
);
foreach ($data['links'] as &$value) {
if (strpos($value['description'], ' @') !== false) {