From 3c1ff667a8fb7f177234f44e0d742da66e463669 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Sat, 10 Jul 2021 17:50:10 +0200 Subject: unshorturl: And do the actual replacement + typo --- unshorturl/unshorturl.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'unshorturl/unshorturl.php') diff --git a/unshorturl/unshorturl.php b/unshorturl/unshorturl.php index 70d7cf6..e8c747a 100644 --- a/unshorturl/unshorturl.php +++ b/unshorturl/unshorturl.php @@ -28,12 +28,12 @@ function unshorturl_prepare_body(&$body) { } $matches = []; - $num_matches = preg_match_all('/https?:\/\/bit\.ly\/\w+/', $body['html'], $links); + $num_matches = preg_match_all('/https?:\/\/bit\.ly\/\w+/', $body['html'], $matches); if ($num_matches > 0) { foreach ($matches as $links) { error_log('unshorturl: Links found: ' . implode(', ', $links)); foreach($links as $l) { - str_replace($l, '[filtered bit.ly url]', $body['html']); + $body['html'] = str_replace($l, '[filtered bit.ly url]', $body['html']); } } } -- cgit v1.2.3