Code Duplication    Length = 10-14 lines in 3 locations

main/inc/lib/api.lib.php 3 locations

@@ 6319-6328 (lines=10) @@
6316
        } else {
6317
            return false;
6318
        }
6319
    } elseif ($format == 'ogg' || $format == 'ogx' || $format == 'ogv' || $format == 'oga') {
6320
        //native ogg, ogv,oga support
6321
        if (($current_browser == 'Firefox' && $current_majorver >= 3) ||
6322
            ($current_browser == 'Chrome' && $current_majorver >= 3) ||
6323
            ($current_browser == 'Opera' && $current_majorver >= 9)) {
6324
            return true;
6325
        } else {
6326
            return false;
6327
        }
6328
    } elseif ($format == 'mpg' || $format == 'mpeg') {
6329
        //native mpg support
6330
        if (($current_browser == 'Safari' && $current_majorver >= 5)) {
6331
            return true;
@@ 6363-6375 (lines=13) @@
6360
        } else {
6361
            return false;
6362
        }
6363
    } elseif ($format == 'webm') {
6364
        //native webm support (TODO:check IE9, Chrome9, Android)
6365
        if (($current_browser == 'Firefox' && $current_majorver >= 4) ||
6366
            ($current_browser == 'Opera' && $current_majorver >= 9) ||
6367
            ($current_browser == 'Internet Explorer' && $current_majorver >= 9) ||
6368
            ($current_browser == 'Chrome' && $current_majorver >= 9) ||
6369
            $current_browser == 'Android'
6370
        ) {
6371
            return true;
6372
        } else {
6373
            return false;
6374
        }
6375
    } elseif ($format == 'wav') {
6376
        //native wav support (only some codecs !)
6377
        if (($current_browser == 'Firefox' && $current_majorver >= 4) ||
6378
            ($current_browser == 'Safari' && $current_majorver >= 5) ||
@@ 6410-6423 (lines=14) @@
6407
        } else {
6408
            return false;
6409
        }
6410
    } elseif ($format == 'mp3') {
6411
        //native mp3 support (TODO:check Android, iPhone)
6412
        if (($current_browser == 'Safari' && $current_majorver >= 5) ||
6413
            ($current_browser == 'Chrome' && $current_majorver >= 6) ||
6414
            ($current_browser == 'Internet Explorer' && $current_majorver >= 9) ||
6415
            $current_browser == 'Android' ||
6416
            $current_browser == 'iPhone' ||
6417
            $current_browser == 'Firefox'
6418
        ) {
6419
            return true;
6420
        } else {
6421
            return false;
6422
        }
6423
    } elseif ($format == "check_browser") {
6424
        $array_check_browser = array($current_browser, $current_majorver);
6425
        return $array_check_browser;
6426
    } else {