Revert "MDL-40931 useragent: separated user agent functionality into a lib"

This reverts commit af62237d0e.
This reverts commit 87a4194fdc.
This reverts commit b2c66eb60c.

Conflicts:

	version.php
This commit is contained in:
Damyon Wiese
2013-08-22 13:31:25 +08:00
parent 50cb89177e
commit 9ead041cdb
30 changed files with 1045 additions and 1460 deletions
+6 -6
View File
@@ -2101,7 +2101,7 @@ function readstring_accel($string, $mimetype, $accelerate) {
function send_temp_file($path, $filename, $pathisstring=false) {
global $CFG;
if (core_useragent::check_firefox_version('1.5')) {
if (check_browser_version('Firefox', '1.5')) {
// only FF is known to correctly save to disk before opening...
$mimetype = mimeinfo('type', $filename);
} else {
@@ -2121,7 +2121,7 @@ function send_temp_file($path, $filename, $pathisstring=false) {
}
// if user is using IE, urlencode the filename so that multibyte file name will show up correctly on popup
if (core_useragent::check_ie_version()) {
if (check_browser_version('MSIE')) {
$filename = urlencode($filename);
}
@@ -2197,12 +2197,12 @@ function send_file($path, $filename, $lifetime = 'default' , $filter=0, $pathiss
// Use given MIME type if specified, otherwise guess it using mimeinfo.
// IE, Konqueror and Opera open html file directly in browser from web even when directed to save it to disk :-O
// only Firefox saves all files locally before opening when content-disposition: attachment stated
$isFF = core_useragent::check_firefox_version('1.5'); // only FF > 1.5 properly tested
$isFF = check_browser_version('Firefox', '1.5'); // only FF > 1.5 properly tested
$mimetype = ($forcedownload and !$isFF) ? 'application/x-forcedownload' :
($mimetype ? $mimetype : mimeinfo('type', $filename));
// if user is using IE, urlencode the filename so that multibyte file name will show up correctly on popup
if (core_useragent::check_ie_version()) {
if (check_browser_version('MSIE')) {
$filename = rawurlencode($filename);
}
@@ -2361,12 +2361,12 @@ function send_stored_file($stored_file, $lifetime=86400 , $filter=0, $forcedownl
// IE, Konqueror and Opera open html file directly in browser from web even when directed to save it to disk :-O
// only Firefox saves all files locally before opening when content-disposition: attachment stated
$filename = is_null($filename) ? $stored_file->get_filename() : $filename;
$isFF = core_useragent::check_firefox_version('1.5'); // only FF > 1.5 properly tested
$isFF = check_browser_version('Firefox', '1.5'); // only FF > 1.5 properly tested
$mimetype = ($forcedownload and !$isFF) ? 'application/x-forcedownload' :
($stored_file->get_mimetype() ? $stored_file->get_mimetype() : mimeinfo('type', $filename));
// if user is using IE, urlencode the filename so that multibyte file name will show up correctly on popup
if (core_useragent::check_ie_version()) {
if (check_browser_version('MSIE')) {
$filename = rawurlencode($filename);
}