Code Duplication    Length = 10-14 lines in 3 locations

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

@@ 6072-6081 (lines=10) @@
6069
        } else {
6070
            return false;
6071
        }
6072
    } elseif ($format == 'ogg' || $format == 'ogx' || $format == 'ogv' || $format == 'oga') {
6073
        //native ogg, ogv,oga support
6074
        if (($current_browser == 'Firefox' && $current_majorver >= 3) ||
6075
            ($current_browser == 'Chrome' && $current_majorver >= 3) ||
6076
            ($current_browser == 'Opera' && $current_majorver >= 9)) {
6077
            return true;
6078
        } else {
6079
            return false;
6080
        }
6081
    } elseif ($format == 'mpg' || $format == 'mpeg') {
6082
        //native mpg support
6083
        if (($current_browser == 'Safari' && $current_majorver >= 5)) {
6084
            return true;
@@ 6116-6128 (lines=13) @@
6113
        } else {
6114
            return false;
6115
        }
6116
    } elseif ($format == 'webm') {
6117
        //native webm support (TODO:check IE9, Chrome9, Android)
6118
        if (($current_browser == 'Firefox' && $current_majorver >= 4) ||
6119
            ($current_browser == 'Opera' && $current_majorver >= 9) ||
6120
            ($current_browser == 'Internet Explorer' && $current_majorver >= 9) ||
6121
            ($current_browser == 'Chrome' && $current_majorver >= 9) ||
6122
            $current_browser == 'Android'
6123
        ) {
6124
            return true;
6125
        } else {
6126
            return false;
6127
        }
6128
    } elseif ($format == 'wav') {
6129
        //native wav support (only some codecs !)
6130
        if (($current_browser == 'Firefox' && $current_majorver >= 4) ||
6131
            ($current_browser == 'Safari' && $current_majorver >= 5) ||
@@ 6163-6176 (lines=14) @@
6160
        } else {
6161
            return false;
6162
        }
6163
    } elseif ($format == 'mp3') {
6164
        //native mp3 support (TODO:check Android, iPhone)
6165
        if (($current_browser == 'Safari' && $current_majorver >= 5) ||
6166
            ($current_browser == 'Chrome' && $current_majorver >= 6) ||
6167
            ($current_browser == 'Internet Explorer' && $current_majorver >= 9) ||
6168
            $current_browser == 'Android' ||
6169
            $current_browser == 'iPhone' ||
6170
            $current_browser == 'Firefox'
6171
        ) {
6172
            return true;
6173
        } else {
6174
            return false;
6175
        }
6176
    } elseif ($format == "check_browser") {
6177
        $array_check_browser = array($current_browser, $current_majorver);
6178
        return $array_check_browser;
6179
    } else {