Skip to content

Commit

Permalink
Speed up regex in emailcloak plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomasz Narloch committed Jul 2, 2018
1 parent 899e7c9 commit 324f140
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion plugins/content/emailcloak/emailcloak.php
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ protected function _cloak(&$text, &$params)
* <img src="..." title="email@example.org"> or <input type="text" placeholder="email@example.org">
* The negative lookahead '(?![^<]*>)' is used to exclude this kind of occurrences
*/
$pattern = '~(?![^<>]*>)' . $searchEmail . '~i';
$pattern = '~<[^<]*>(*SKIP)(*F)|' . $searchEmail . '~i';

while (preg_match($pattern, $text, $regs, PREG_OFFSET_CAPTURE))
{
Expand Down

0 comments on commit 324f140

Please sign in to comment.