Code Duplication    Length = 10-14 lines in 3 locations

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

@@ 6285-6294 (lines=10) @@
6282
        } else {
6283
            return false;
6284
        }
6285
    } elseif ($format == 'ogg' || $format == 'ogx' || $format == 'ogv' || $format == 'oga') {
6286
        //native ogg, ogv,oga support
6287
        if (($current_browser == 'Firefox' && $current_majorver >= 3) ||
6288
            ($current_browser == 'Chrome' && $current_majorver >= 3) ||
6289
            ($current_browser == 'Opera' && $current_majorver >= 9)) {
6290
            return true;
6291
        } else {
6292
            return false;
6293
        }
6294
    } elseif ($format == 'mpg' || $format == 'mpeg') {
6295
        //native mpg support
6296
        if (($current_browser == 'Safari' && $current_majorver >= 5)) {
6297
            return true;
@@ 6329-6341 (lines=13) @@
6326
        } else {
6327
            return false;
6328
        }
6329
    } elseif ($format == 'webm') {
6330
        //native webm support (TODO:check IE9, Chrome9, Android)
6331
        if (($current_browser == 'Firefox' && $current_majorver >= 4) ||
6332
            ($current_browser == 'Opera' && $current_majorver >= 9) ||
6333
            ($current_browser == 'Internet Explorer' && $current_majorver >= 9) ||
6334
            ($current_browser == 'Chrome' && $current_majorver >= 9) ||
6335
            $current_browser == 'Android'
6336
        ) {
6337
            return true;
6338
        } else {
6339
            return false;
6340
        }
6341
    } elseif ($format == 'wav') {
6342
        //native wav support (only some codecs !)
6343
        if (($current_browser == 'Firefox' && $current_majorver >= 4) ||
6344
            ($current_browser == 'Safari' && $current_majorver >= 5) ||
@@ 6376-6389 (lines=14) @@
6373
        } else {
6374
            return false;
6375
        }
6376
    } elseif ($format == 'mp3') {
6377
        //native mp3 support (TODO:check Android, iPhone)
6378
        if (($current_browser == 'Safari' && $current_majorver >= 5) ||
6379
            ($current_browser == 'Chrome' && $current_majorver >= 6) ||
6380
            ($current_browser == 'Internet Explorer' && $current_majorver >= 9) ||
6381
            $current_browser == 'Android' ||
6382
            $current_browser == 'iPhone' ||
6383
            $current_browser == 'Firefox'
6384
        ) {
6385
            return true;
6386
        } else {
6387
            return false;
6388
        }
6389
    } elseif ($format == "check_browser") {
6390
        $array_check_browser = array($current_browser, $current_majorver);
6391
        return $array_check_browser;
6392
    } else {