Code Duplication    Length = 26-26 lines in 2 locations

htdocs/lib2/util.inc.php 1 location

@@ 197-222 (lines=26) @@
194
    return preg_match("!^$addr_spec$!", $email) ? 1 : 0;
195
}
196
197
function mb_trim($str)
198
{
199
    $bLoop = true;
200
    while ($bLoop == true) {
201
        $sPos = mb_substr($str, 0, 1);
202
203
        if ($sPos == ' ' || $sPos == "\r" || $sPos == "\n" || $sPos == "\t" || $sPos == "\x0B" || $sPos == "\0") {
204
            $str = mb_substr($str, 1, mb_strlen($str) - 1);
205
        } else {
206
            $bLoop = false;
207
        }
208
    }
209
210
    $bLoop = true;
211
    while ($bLoop == true) {
212
        $sPos = mb_substr($str, - 1, 1);
213
214
        if ($sPos == ' ' || $sPos == "\r" || $sPos == "\n" || $sPos == "\t" || $sPos == "\x0B" || $sPos == "\0") {
215
            $str = mb_substr($str, 0, mb_strlen($str) - 1);
216
        } else {
217
            $bLoop = false;
218
        }
219
    }
220
221
    return $str;
222
}
223
224
// explode with more than one separator
225
function explode_multi($str, $sep)

htdocs/lib/clicompatbase.inc.php 1 location

@@ 508-533 (lines=26) @@
505
    return mysql_free_result($rs);
506
}
507
508
function mb_trim($str)
509
{
510
    $bLoop = true;
511
    while ($bLoop == true) {
512
        $sPos = mb_substr($str, 0, 1);
513
514
        if ($sPos == ' ' || $sPos == "\r" || $sPos == "\n" || $sPos == "\t" || $sPos == "\x0B" || $sPos == "\0") {
515
            $str = mb_substr($str, 1, mb_strlen($str) - 1);
516
        } else {
517
            $bLoop = false;
518
        }
519
    }
520
521
    $bLoop = true;
522
    while ($bLoop == true) {
523
        $sPos = mb_substr($str, - 1, 1);
524
525
        if ($sPos == ' ' || $sPos == "\r" || $sPos == "\n" || $sPos == "\t" || $sPos == "\x0B" || $sPos == "\0") {
526
            $str = mb_substr($str, 0, mb_strlen($str) - 1);
527
        } else {
528
            $bLoop = false;
529
        }
530
    }
531
532
    return $str;
533
}
534
535
//disconnect the databse
536
function db_disconnect()