From cd5f4de8cfe3b506e563f61dca7f9dae0cccd19f Mon Sep 17 00:00:00 2001 From: cajus Date: Fri, 27 Jun 2008 07:12:59 +0000 Subject: [PATCH] Take care about filenames containing a /. Just use the basename then. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11462 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-core/include/functions.inc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gosa-core/include/functions.inc b/gosa-core/include/functions.inc index e9444fbf3..52fe8b791 100644 --- a/gosa-core/include/functions.inc +++ b/gosa-core/include/functions.inc @@ -2686,6 +2686,11 @@ function send_binary_content($data,$name,$type = "application/octet-stream") header("Content-type: ".$type.""); $HTTP_USER_AGENT = $_SERVER['HTTP_USER_AGENT']; + + /* Strip name if it is a complete path */ + if (preg_match ("/\//", $name)) { + $name= basename($name); + } /* force download dialog */ if (preg_match('/MSIE 5.5/', $HTTP_USER_AGENT) || preg_match('/MSIE 6.0/', $HTTP_USER_AGENT)) { -- 2.30.2