From f7edd62207d14ea322f4d967640056cde1202f98 Mon Sep 17 00:00:00 2001 From: hickert Date: Wed, 5 Nov 2008 09:26:35 +0000 Subject: [PATCH] Updated template upload behaviour. -Only update filename if it is empty and keep path. git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@12919 594d385d-05f5-0310-b6e9-bd551577e9d8 --- gosa-plugins/fai/admin/fai/class_faiTemplateEntry.inc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gosa-plugins/fai/admin/fai/class_faiTemplateEntry.inc b/gosa-plugins/fai/admin/fai/class_faiTemplateEntry.inc index 7ecd486cf..27de8a512 100644 --- a/gosa-plugins/fai/admin/fai/class_faiTemplateEntry.inc +++ b/gosa-plugins/fai/admin/fai/class_faiTemplateEntry.inc @@ -72,8 +72,8 @@ class faiTemplateEntry extends plugin $this->FAItemplateFile = $str; /* If we don't have a filename set it from upload filename. */ - if( 0 == strlen( $this->FAItemplatePath )){ - $this->FAItemplatePath = $_FILES['FAItemplateFile']['name']; + if( 0 == strlen(preg_replace("/^.*\//","",$this->FAItemplatePath))){ + $this->FAItemplatePath = preg_replace("/[^\/]*$/","",$this->FAItemplatePath).$_FILES['FAItemplateFile']['name']; } session::set('binary',$this->FAItemplateFile); -- 2.30.2