Conditions | 3 |
Paths | 3 |
Total Lines | 12 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
13 | public static function removeWebLinks($content, $domain = '') { |
||
14 | if (!empty($content)) { |
||
15 | if (!empty($domain)) { |
||
16 | $pattern = '#<a [^>]*\bhref=([\'"])http.?://((?<!'. $domain .')[^\'"])+\1 *.*?</a>#i'; |
||
17 | $filteredString = preg_replace($pattern, '', $content); |
||
18 | } else { |
||
19 | $filteredString = preg_replace('#<a.*?>.*?</a>#i', '', $content); |
||
20 | } |
||
21 | |||
22 | return $filteredString; |
||
23 | } |
||
24 | } |
||
25 | } |
||
26 |