From b587755df69d26204c3d47a2ec02d40f5b58405a Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?C=C3=B4me=20Bernigaud?= <come.bernigaud@laposte.net>
Date: Wed, 22 May 2013 17:02:43 +0200
Subject: [PATCH] Fixes: #2409 fixes a wheezy problem with filePath

---
 contrib/smarty/plugins/function.filePath.php | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/contrib/smarty/plugins/function.filePath.php b/contrib/smarty/plugins/function.filePath.php
index 26c847b3d..d212791f9 100644
--- a/contrib/smarty/plugins/function.filePath.php
+++ b/contrib/smarty/plugins/function.filePath.php
@@ -16,14 +16,18 @@ function smarty_function_filePath($params, &$smarty)
   if (file_exists("themes/$theme/$filename")) {
     return "themes/$theme/$filename";
   }
-  if (file_exists($smarty->template_dir."/themes/$theme/$filename")) {
-    return $smarty->template_dir."/themes/$theme/$filename";
+  $dir = $smarty->template_dir;
+  if (is_array($dir)) {
+    $dir = $dir[0];
+  }
+  if (file_exists("$dir/themes/$theme/$filename")) {
+    return "$dir/themes/$theme/$filename";
   }
   if (file_exists("themes/default/$filename")) {
     return "themes/default/$filename";
   }
-  if (file_exists($smarty->template_dir."/themes/default/$filename")) {
-    return $smarty->template_dir."/themes/default/$filename";
+  if (file_exists("$dir/themes/default/$filename")) {
+    return "$dir/themes/default/$filename";
   }
   return $filename;
 }
-- 
GitLab