Code Duplication    Length = 10-14 lines in 3 locations

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

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