diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2021-07-10 17:50:10 +0200 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2021-07-10 17:50:10 +0200 |
commit | 3c1ff667a8fb7f177234f44e0d742da66e463669 (patch) | |
tree | 3fc714e16fd8b9fb881c70c2b2f965e8e2978d58 | |
parent | 28ea8829a07db685d4d016e1bdd3f320b73e9add (diff) | |
download | volse-hz-addons-3c1ff667a8fb7f177234f44e0d742da66e463669.tar.gz volse-hz-addons-3c1ff667a8fb7f177234f44e0d742da66e463669.tar.bz2 volse-hz-addons-3c1ff667a8fb7f177234f44e0d742da66e463669.zip |
unshorturl: And do the actual replacement + typo
-rw-r--r-- | unshorturl/unshorturl.php | 4 |
1 files changed, 2 insertions, 2 deletions
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']); } } } |