Revert "MDL-40931 useragent: separated user agent functionality into a lib"
This reverts commitaf62237d0e. This reverts commit87a4194fdc. This reverts commitb2c66eb60c. Conflicts: version.php
This commit is contained in:
+6
-6
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user