2013-12-07, 06:03 AM
The wildcard matches in this plugin are greedy:
Causing the first regex to start matching at the first URL and continue matching all the way to the last one as a single match.
They should be lazy like this:
$message = preg_replace_callback("/<a href=\"(.+)\" (.+)>(.+)<\\/a>/", "replace_external", $message);
Causing the first regex to start matching at the first URL and continue matching all the way to the last one as a single match.
They should be lazy like this:
$message = preg_replace_callback("/<a href=\"(.+?)\" (.+?)>(.+?)<\\/a>/", "replace_external", $message);