Code Duplication    Length = 15-16 lines in 2 locations

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

@@ 6199-6213 (lines=15) @@
6196
            $result[$format] = false;
6197
            return false;
6198
        }
6199
    } elseif ($format == 'webm') {
6200
        //native webm support (TODO:check IE9, Chrome9, Android)
6201
        if (($current_browser == 'Firefox' && $current_majorver >= 4) ||
6202
            ($current_browser == 'Opera' && $current_majorver >= 9) ||
6203
            ($current_browser == 'Internet Explorer' && $current_majorver >= 9) ||
6204
            ($current_browser == 'Chrome' && $current_majorver >= 9) ||
6205
            $current_browser == 'Android'
6206
        ) {
6207
            $result[$format] = true;
6208
            return true;
6209
        } else {
6210
            $result[$format] = false;
6211
            return false;
6212
        }
6213
    } elseif ($format == 'wav') {
6214
        //native wav support (only some codecs !)
6215
        if (($current_browser == 'Firefox' && $current_majorver >= 4) ||
6216
            ($current_browser == 'Safari' && $current_majorver >= 5) ||
@@ 6256-6271 (lines=16) @@
6253
            $result[$format] = false;
6254
            return false;
6255
        }
6256
    } elseif ($format == 'mp3') {
6257
        //native mp3 support (TODO:check Android, iPhone)
6258
        if (($current_browser == 'Safari' && $current_majorver >= 5) ||
6259
            ($current_browser == 'Chrome' && $current_majorver >= 6) ||
6260
            ($current_browser == 'Internet Explorer' && $current_majorver >= 9) ||
6261
            $current_browser == 'Android' ||
6262
            $current_browser == 'iPhone' ||
6263
            $current_browser == 'Firefox'
6264
        ) {
6265
            $result[$format] = true;
6266
            return true;
6267
        } else {
6268
            $result[$format] = false;
6269
            return false;
6270
        }
6271
    } elseif ($format == "check_browser") {
6272
        $array_check_browser = array($current_browser, $current_majorver);
6273
        return $array_check_browser;
6274
    } else {