@@ -39,7 +39,7 @@ |
||
| 39 | 39 | |
| 40 | 40 | $configArray = Yaml::parse(file_get_contents($this->pathToYml)); |
| 41 | 41 | |
| 42 | - if(true === $purify || true === $configArray['external_link']['purify']) |
|
| 42 | + if (true === $purify || true === $configArray['external_link']['purify']) |
|
| 43 | 43 | { |
| 44 | 44 | $content = ExternalLinkFilter::removeWebLinks($content, $domain); |
| 45 | 45 | } |
@@ -4,7 +4,7 @@ |
||
| 4 | 4 | |
| 5 | 5 | use ExternalLinkPurifier\LinkPurifier; |
| 6 | 6 | |
| 7 | -class LinkPurifierTest extends \PHPUnit_Framework_TestCase{ |
|
| 7 | +class LinkPurifierTest extends \PHPUnit_Framework_TestCase { |
|
| 8 | 8 | |
| 9 | 9 | /** |
| 10 | 10 | * @test |
@@ -13,7 +13,7 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | public static function removeWebLinks($content, $domain) { |
| 15 | 15 | if (!empty($content)) { |
| 16 | - if(!empty($domain)) { |
|
| 16 | + if (!empty($domain)) { |
|
| 17 | 17 | $pattern = '#<a [^>]*\bhref=([\'"])http.?://((?!$domain)[^\'"])+\1 *>.*?</a>#i'; |
| 18 | 18 | $filteredString = preg_replace($pattern, '', $content); |
| 19 | 19 | } else { |