From e50565ccb45ac11aa8838425e806d4ea74a51221 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Tue, 14 Jun 2011 08:54:42 +0000 Subject: [PATCH] allow multiple space or comma separated template directories --- etemplate/inc/class.bo_merge.inc.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/etemplate/inc/class.bo_merge.inc.php b/etemplate/inc/class.bo_merge.inc.php index 4645db5dda..192de6bb64 100644 --- a/etemplate/inc/class.bo_merge.inc.php +++ b/etemplate/inc/class.bo_merge.inc.php @@ -867,6 +867,12 @@ abstract class bo_merge { if (!$dir) return array(); + // split multiple comma or whitespace separated directories + // to still allow space or comma in dirnames, we also use the trailing slash of all pathes to split + if (count($dir = preg_split('/[,\s]+\//', $dir)) > 1) + { + foreach($dir as $n => &$d) if ($n) $d = '/'.$d; // re-adding trailing slash removed by split + } $list = array(); if (($files = egw_vfs::find($dir,array('need_mime'=>true),true))) { @@ -911,6 +917,12 @@ abstract class bo_merge ); } + // split multiple comma or whitespace separated directories + // to still allow space or comma in dirnames, we also use the trailing slash of all pathes to split + if ($dir && count($dir = preg_split('/[,\s]+\//', $dir)) > 1) + { + foreach($dir as $n => &$d) if ($n) $d = '/'.$d; // re-adding trailing slash removed by split + } if ($dir && ($files = egw_vfs::find($dir,array( 'need_mime' => true, 'order' => 'fs_name',