Code Duplication    Length = 10-14 lines in 3 locations

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

@@ 6043-6052 (lines=10) @@
6040
        } else {
6041
            return false;
6042
        }
6043
    } elseif ($format == 'ogg' || $format == 'ogx' || $format == 'ogv' || $format == 'oga') {
6044
        //native ogg, ogv,oga support
6045
        if (($current_browser == 'Firefox' && $current_majorver >= 3) ||
6046
            ($current_browser == 'Chrome' && $current_majorver >= 3) ||
6047
            ($current_browser == 'Opera' && $current_majorver >= 9)) {
6048
            return true;
6049
        } else {
6050
            return false;
6051
        }
6052
    } elseif ($format == 'mpg' || $format == 'mpeg') {
6053
        //native mpg support
6054
        if (($current_browser == 'Safari' && $current_majorver >= 5)) {
6055
            return true;
@@ 6087-6099 (lines=13) @@
6084
        } else {
6085
            return false;
6086
        }
6087
    } elseif ($format == 'webm') {
6088
        //native webm support (TODO:check IE9, Chrome9, Android)
6089
        if (($current_browser == 'Firefox' && $current_majorver >= 4) ||
6090
            ($current_browser == 'Opera' && $current_majorver >= 9) ||
6091
            ($current_browser == 'Internet Explorer' && $current_majorver >= 9) ||
6092
            ($current_browser == 'Chrome' && $current_majorver >= 9) ||
6093
            $current_browser == 'Android'
6094
        ) {
6095
            return true;
6096
        } else {
6097
            return false;
6098
        }
6099
    } elseif ($format == 'wav') {
6100
        //native wav support (only some codecs !)
6101
        if (($current_browser == 'Firefox' && $current_majorver >= 4) ||
6102
            ($current_browser == 'Safari' && $current_majorver >= 5) ||
@@ 6134-6147 (lines=14) @@
6131
        } else {
6132
            return false;
6133
        }
6134
    } elseif ($format == 'mp3') {
6135
        //native mp3 support (TODO:check Android, iPhone)
6136
        if (($current_browser == 'Safari' && $current_majorver >= 5) ||
6137
            ($current_browser == 'Chrome' && $current_majorver >= 6) ||
6138
            ($current_browser == 'Internet Explorer' && $current_majorver >= 9) ||
6139
            $current_browser == 'Android' ||
6140
            $current_browser == 'iPhone' ||
6141
            $current_browser == 'Firefox'
6142
        ) {
6143
            return true;
6144
        } else {
6145
            return false;
6146
        }
6147
    } elseif ($format == "check_browser") {
6148
        $array_check_browser = array($current_browser, $current_majorver);
6149
        return $array_check_browser;
6150
    } else {