cvs: smarty /libs Smarty.class.php

"Messju Mohr" <[email protected]>
Newsgroups gmane.comp.php.cvs.smarty
Message-ID <cvsmessju1079593529@cvsserver>
messju		Thu Mar 18 02:05:29 2004 EDT

  Modified files:              
    /smarty/libs	Smarty.class.php 
  Log:
  moved setting of a default resource_base_path from
  Smarty::_parse_resource_name() to Smarty::_fetch_resource_info()
  
  this shouldn't affect anything, since all calls to
  _parse_resource_name() that are not done from within
  _fetch_resource_info() all pass their own resource_base_path
  
  
  
http://cvs.php.net/diff.php/smarty/libs/Smarty.class.php?r1=1.481&r2=1.482&ty=u
Index: smarty/libs/Smarty.class.php
diff -u smarty/libs/Smarty.class.php:1.481 smarty/libs/Smarty.class.php:1.482
--- smarty/libs/Smarty.class.php:1.481	Wed Mar 17 10:32:10 2004
+++ smarty/libs/Smarty.class.php	Thu Mar 18 02:05:29 2004
@@ -30,7 +30,7 @@
  * @version 2.6.3-dev
  */
 
-/* $Id: Smarty.class.php,v 1.481 2004/03/17 15:32:10 messju Exp $ */
+/* $Id: Smarty.class.php,v 1.482 2004/03/18 07:05:29 messju Exp $ */
 
 /**
  * DIR_SEP isn't used anymore, but third party apps might
@@ -1535,6 +1535,8 @@
         $_params = array('resource_name' => $params['resource_name']) ;
         if (isset($params['resource_base_path']))
             $_params['resource_base_path'] = $params['resource_base_path'];
+        else
+            $_params['resource_base_path'] = $this->template_dir;
 
         if ($this->_parse_resource_name($_params)) {
             $_resource_type = $_params['resource_type'];
@@ -1633,12 +1635,7 @@
             if (!preg_match("/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/", $params['resource_name'])) {
                 // relative pathname to $params['resource_base_path']
                 // use the first directory where the file is found
-                if (isset($params['resource_base_path'])) {
-                    $_resource_base_path = (array)$params['resource_base_path'];
-                } else {
-                    $_resource_base_path = (array)$this->template_dir;
-                }
-                foreach ($_resource_base_path as $_curr_path) {
+                foreach ((array)$params['resource_base_path'] as $_curr_path) {
                     $_fullpath = $_curr_path . DIRECTORY_SEPARATOR . $params['resource_name'];
                     if (file_exists($_fullpath) && is_file($_fullpath)) {
                         $params['resource_name'] = $_fullpath;

-- 
Smarty CVS Mailing List (http://cvs.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.