Code Duplication    Length = 11-11 lines in 3 locations

htdocs/lib2/translationHandler.class.php 1 location

@@ 133-143 (lines=11) @@
130
     *
131
     * @return string
132
     */
133
    private function prepare_text($text)
134
    {
135
        $text = mb_ereg_replace("\t", ' ', $text);
136
        $text = mb_ereg_replace("\r", ' ', $text);
137
        $text = mb_ereg_replace("\n", ' ', $text);
138
        while (mb_strpos($text, '  ') !== false) {
139
            $text = mb_ereg_replace('  ', ' ', $text);
140
        }
141
142
        return $text;
143
    }
144
145
    /**
146
     * add text to database

htdocs/lib2/translate.class.php 1 location

@@ 100-110 (lines=11) @@
97
     *
98
     * @return string
99
     */
100
    protected function prepare_text($text)
101
    {
102
        $text = mb_ereg_replace("\t", ' ', $text);
103
        $text = mb_ereg_replace("\r", ' ', $text);
104
        $text = mb_ereg_replace("\n", ' ', $text);
105
        while (mb_strpos($text, '  ') !== false) {
106
            $text = mb_ereg_replace('  ', ' ', $text);
107
        }
108
109
        return $text;
110
    }
111
112
    /**
113
     * @param $message

htdocs/lib/common.inc.php 1 location

@@ 697-707 (lines=11) @@
694
 * @param $text
695
 * @return string
696
 */
697
function t_prepare_text($text)
698
{
699
    $text = mb_ereg_replace("\t", ' ', $text);
700
    $text = mb_ereg_replace("\r", ' ', $text);
701
    $text = mb_ereg_replace("\n", ' ', $text);
702
    while (mb_strpos($text, '  ') !== false) {
703
        $text = mb_ereg_replace('  ', ' ', $text);
704
    }
705
706
    return $text;
707
}
708
709
/**
710
 * @return mixed|null|string