Changeset 1579


Ignore:
Timestamp:
Oct 27, 2006, 2:21:15 AM (18 years ago)
Author:
rvelices
Message:

fix: make_filename for absolute path under windows (c:\)
improvement: you don't have to call assign_block_vars('a' before
calling assign_block_vars('a.b'

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/template.php

    r1568 r1579  
    223223        {
    224224          $str .= '[\'' . $blocks[$i] . '.\']';
    225           eval('$lastiteration = sizeof(' . $str . ') - 1;');
     225          eval('$lastiteration = isset('.$str.') ? sizeof('.$str.')-1:0;');
    226226          $str .= '[' . $lastiteration . ']';
    227227        }
     
    279279    {
    280280      // Check if it's an absolute or relative path.
    281       // if (substr($filename, 0, 1) != '/')
    282       if (preg_match('/^[a-z_]/i', $filename))
     281      if (substr($filename, 0, 1) != '/'
     282          and substr($filename, 0, 1) != '\\' //Windows UNC path
     283          and !preg_match('/^[a-z]:\\\/i', $filename) )
    283284      {
    284285        $filename = $this->root.'/'.$filename;
     
    317318
    318319      $str = implode("", @file($filename));
     320
    319321      if (empty($str))
    320322      {
Note: See TracChangeset for help on using the changeset viewer.