Code

Take care about filenames containing a /. Just use the basename then.
authorcajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 27 Jun 2008 07:12:59 +0000 (07:12 +0000)
committercajus <cajus@594d385d-05f5-0310-b6e9-bd551577e9d8>
Fri, 27 Jun 2008 07:12:59 +0000 (07:12 +0000)
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@11462 594d385d-05f5-0310-b6e9-bd551577e9d8

gosa-core/include/functions.inc

index e9444fbf396d664e89ea15d44cd3ee65a04ed68c..52fe8b7914f02de031a4aebdbe0af7e5666adcb1 100644 (file)
@@ -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)) {