Code Duplication    Length = 3-4 lines in 3 locations

manager/includes/src/Legacy/Modifiers.php 3 locations

@@ 565-568 (lines=4) @@
562
                } else {
563
                    $params = '';
564
                }
565
                if (!strpos($params, '<br>') === false) {
566
                    $value = preg_replace('@(<br[ /]*>)\n@', '$1', $value);
567
                    $value = preg_replace('@<br[ /]*>@', "\n", $value);
568
                }
569
570
                return $this->strip_tags($value, $params);
571
            case 'urlencode':
@@ 1593-1595 (lines=3) @@
1590
    {
1591
        $modx = evolutionCMS();
1592
1593
        if (stripos($params, 'style') === false && stripos($value, '</style>') !== false) {
1594
            $value = preg_replace('@<style.*?>.*?</style>@is', '', $value);
1595
        }
1596
        if (stripos($params, 'script') === false && stripos($value, '</script>') !== false) {
1597
            $value = preg_replace('@<script.*?>.*?</script>@is', '', $value);
1598
        }
@@ 1596-1598 (lines=3) @@
1593
        if (stripos($params, 'style') === false && stripos($value, '</style>') !== false) {
1594
            $value = preg_replace('@<style.*?>.*?</style>@is', '', $value);
1595
        }
1596
        if (stripos($params, 'script') === false && stripos($value, '</script>') !== false) {
1597
            $value = preg_replace('@<script.*?>.*?</script>@is', '', $value);
1598
        }
1599
1600
        return trim(strip_tags($value, $params));
1601
    }