Code Duplication    Length = 10-14 lines in 3 locations

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

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