Code Duplication    Length = 10-14 lines in 3 locations

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

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