aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/download/file.php
diff options
context:
space:
mode:
authorDhruv <dhruv.goel92@gmail.com>2013-02-08 00:05:06 +0530
committerDhruv <dhruv.goel92@gmail.com>2013-06-12 20:22:37 +0530
commit9236f12577087e5b800b9c23e988a671702f1a9e (patch)
tree182f3436018e8e52aa41c4630d495606b07e753d /phpBB/download/file.php
parent80d164b12151c3b3d5eb42d1874a0a1d3b288d12 (diff)
downloadforums-9236f12577087e5b800b9c23e988a671702f1a9e.tar
forums-9236f12577087e5b800b9c23e988a671702f1a9e.tar.gz
forums-9236f12577087e5b800b9c23e988a671702f1a9e.tar.bz2
forums-9236f12577087e5b800b9c23e988a671702f1a9e.tar.xz
forums-9236f12577087e5b800b9c23e988a671702f1a9e.zip
[ticket/10820] fix IE check function
Add phpbb_ prefix to function name and return boolean value. PHPBB3-10820
Diffstat (limited to 'phpBB/download/file.php')
-rw-r--r--phpBB/download/file.php16
1 files changed, 8 insertions, 8 deletions
diff --git a/phpBB/download/file.php b/phpBB/download/file.php
index 6764ee7eac..af41951c46 100644
--- a/phpBB/download/file.php
+++ b/phpBB/download/file.php
@@ -285,7 +285,7 @@ else if (($display_cat == ATTACHMENT_CATEGORY_NONE/* || $display_cat == ATTACHME
$db->sql_query($sql);
}
-if ($display_cat == ATTACHMENT_CATEGORY_IMAGE && $mode === 'view' && (strpos($attachment['mimetype'], 'image') === 0) && !is_greater_ie7($user->browser))
+if ($display_cat == ATTACHMENT_CATEGORY_IMAGE && $mode === 'view' && (strpos($attachment['mimetype'], 'image') === 0) && !phpbb_is_greater_ie7($user->browser))
{
wrap_img_in_html(append_sid($phpbb_root_path . 'download/file.' . $phpEx, 'id=' . $attachment['attach_id']), $attachment['real_filename']);
file_gc();
@@ -344,7 +344,7 @@ function send_avatar_to_browser($file, $browser)
$image_data = @getimagesize($file_path);
header('Content-Type: ' . image_type_to_mime_type($image_data[2]));
- if (strpos(strtolower($browser), 'msie') !== false && !is_greater_ie7($browser))
+ if (strpos(strtolower($browser), 'msie') !== false && !phpbb_is_greater_ie7($browser))
{
header('Content-Disposition: attachment; ' . header_filename($file));
@@ -479,7 +479,7 @@ function send_file_to_browser($attachment, $upload_dir, $category)
// Send out the Headers. Do not set Content-Disposition to inline please, it is a security measure for users using the Internet Explorer.
header('Content-Type: ' . $attachment['mimetype']);
- if (is_greater_ie7($user->browser))
+ if (phpbb_is_greater_ie7($user->browser))
{
header('X-Content-Type-Options: nosniff');
}
@@ -491,7 +491,7 @@ function send_file_to_browser($attachment, $upload_dir, $category)
}
else
{
- if (empty($user->browser) || (!is_greater_ie7($user->browser) && (strpos(strtolower($user->browser), 'msie') !== false)))
+ if (empty($user->browser) || (!phpbb_is_greater_ie7($user->browser) && (strpos(strtolower($user->browser), 'msie') !== false)))
{
header('Content-Disposition: attachment; ' . header_filename(htmlspecialchars_decode($attachment['real_filename'])));
if (empty($user->browser) || (strpos(strtolower($user->browser), 'msie 6.0') !== false))
@@ -502,7 +502,7 @@ function send_file_to_browser($attachment, $upload_dir, $category)
else
{
header('Content-Disposition: ' . ((strpos($attachment['mimetype'], 'image') === 0) ? 'inline' : 'attachment') . '; ' . header_filename(htmlspecialchars_decode($attachment['real_filename'])));
- if (is_greater_ie7($user->browser) && (strpos($attachment['mimetype'], 'image') !== 0))
+ if (phpbb_is_greater_ie7($user->browser) && (strpos($attachment['mimetype'], 'image') !== 0))
{
header('X-Download-Options: noopen');
}
@@ -680,7 +680,7 @@ function set_modified_headers($stamp, $browser)
// let's see if we have to send the file at all
$last_load = isset($_SERVER['HTTP_IF_MODIFIED_SINCE']) ? strtotime(trim($_SERVER['HTTP_IF_MODIFIED_SINCE'])) : false;
- if ((strpos(strtolower($browser), 'msie 6.0') === false) && (!is_greater_ie7($browser)))
+ if ((strpos(strtolower($browser), 'msie 6.0') === false) && (!phpbb_is_greater_ie7($browser)))
{
if ($last_load !== false && $last_load >= $stamp)
{
@@ -709,9 +709,9 @@ function file_gc()
exit;
}
-function is_greater_ie7($browser)
+function phpbb_is_greater_ie7($browser)
{
- return preg_match('/msie (\d{2,3}|[89]+).[0-9.]*;/', strtolower($browser));
+ return (bool) preg_match('/msie (\d{2,3}|[89]+).[0-9.]*;/', strtolower($browser));
}
?> \ No newline at end of file