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

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