Code Duplication    Length = 10-14 lines in 3 locations

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

@@ 6088-6097 (lines=10) @@
6085
        } else {
6086
            return false;
6087
        }
6088
    } elseif ($format == 'ogg' || $format == 'ogx' || $format == 'ogv' || $format == 'oga') {
6089
        //native ogg, ogv,oga support
6090
        if (($current_browser == 'Firefox' && $current_majorver >= 3) ||
6091
            ($current_browser == 'Chrome' && $current_majorver >= 3) ||
6092
            ($current_browser == 'Opera' && $current_majorver >= 9)) {
6093
            return true;
6094
        } else {
6095
            return false;
6096
        }
6097
    } elseif ($format == 'mpg' || $format == 'mpeg') {
6098
        //native mpg support
6099
        if (($current_browser == 'Safari' && $current_majorver >= 5)) {
6100
            return true;
@@ 6132-6144 (lines=13) @@
6129
        } else {
6130
            return false;
6131
        }
6132
    } elseif ($format == 'webm') {
6133
        //native webm support (TODO:check IE9, Chrome9, Android)
6134
        if (($current_browser == 'Firefox' && $current_majorver >= 4) ||
6135
            ($current_browser == 'Opera' && $current_majorver >= 9) ||
6136
            ($current_browser == 'Internet Explorer' && $current_majorver >= 9) ||
6137
            ($current_browser == 'Chrome' && $current_majorver >= 9) ||
6138
            $current_browser == 'Android'
6139
        ) {
6140
            return true;
6141
        } else {
6142
            return false;
6143
        }
6144
    } elseif ($format == 'wav') {
6145
        //native wav support (only some codecs !)
6146
        if (($current_browser == 'Firefox' && $current_majorver >= 4) ||
6147
            ($current_browser == 'Safari' && $current_majorver >= 5) ||
@@ 6179-6192 (lines=14) @@
6176
        } else {
6177
            return false;
6178
        }
6179
    } elseif ($format == 'mp3') {
6180
        //native mp3 support (TODO:check Android, iPhone)
6181
        if (($current_browser == 'Safari' && $current_majorver >= 5) ||
6182
            ($current_browser == 'Chrome' && $current_majorver >= 6) ||
6183
            ($current_browser == 'Internet Explorer' && $current_majorver >= 9) ||
6184
            $current_browser == 'Android' ||
6185
            $current_browser == 'iPhone' ||
6186
            $current_browser == 'Firefox'
6187
        ) {
6188
            return true;
6189
        } else {
6190
            return false;
6191
        }
6192
    } elseif ($format == "check_browser") {
6193
        $array_check_browser = array($current_browser, $current_majorver);
6194
        return $array_check_browser;
6195
    } else {