From: hickert Date: Wed, 5 Nov 2008 09:26:35 +0000 (+0000) Subject: Updated template upload behaviour. X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=f7edd62207d14ea322f4d967640056cde1202f98;p=gosa.git 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 --- 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);