~ubuntu-branches/ubuntu/edgy/smarty/edgy-security

« back to all changes in this revision

Viewing changes to libs/Smarty.class.php

  • Committer: Bazaar Package Importer
  • Author(s): Dimitri Fontaine
  • Date: 2005-03-29 11:53:20 UTC
  • mfrom: (0.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050329115320-g3rvndgnn75ogm35
Tags: 2.6.8-1
New upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
 * smarty-general-subscribe@lists.php.net
24
24
 *
25
25
 * @link http://smarty.php.net/
26
 
 * @copyright 2001-2004 ispi of Lincoln, Inc.
27
 
 * @author Monte Ohrt <monte@ispi.net>
 
26
 * @copyright 2001-2005 New Digital Group, Inc.
 
27
 * @author Monte Ohrt <monte at ohrt dot com>
28
28
 * @author Andrei Zmievski <andrei@php.net>
29
29
 * @package Smarty
30
 
 * @version 2.6.2
 
30
 * @version 2.6.8
31
31
 */
32
32
 
33
 
/* $Id: Smarty.class.php,v 1.477 2004/02/17 15:52:02 mohrt Exp $ */
 
33
/* $Id: Smarty.class.php,v 1.513 2005/02/26 21:18:48 messju Exp $ */
34
34
 
35
35
/**
36
36
 * DIR_SEP isn't used anymore, but third party apps might
49
49
    define('SMARTY_DIR', dirname(__FILE__) . DIRECTORY_SEPARATOR);
50
50
}
51
51
 
 
52
if (!defined('SMARTY_CORE_DIR')) {
 
53
    define('SMARTY_CORE_DIR', SMARTY_DIR . 'internals' . DIRECTORY_SEPARATOR);
 
54
}
 
55
 
52
56
define('SMARTY_PHP_PASSTHRU',   0);
53
57
define('SMARTY_PHP_QUOTE',      1);
54
58
define('SMARTY_PHP_REMOVE',     2);
228
232
                                                               'isset', 'empty',
229
233
                                                               'count', 'sizeof',
230
234
                                                               'in_array', 'is_array',
231
 
                                                               'true','false'),
 
235
                                                               'true', 'false', 'null'),
232
236
                                    'INCLUDE_ANY'     => false,
233
237
                                    'PHP_TAGS'        => false,
234
238
                                    'MODIFIER_FUNCS'  => array('count'),
235
 
                                    'ALLOW_CONSTANTS' => false
 
239
                                    'ALLOW_CONSTANTS'  => false
236
240
                                   );
237
241
 
238
242
    /**
264
268
     *
265
269
     * @var string
266
270
     */
267
 
    var $request_vars_order    = "EGPCS";
 
271
    var $request_vars_order    = 'EGPCS';
268
272
 
269
273
    /**
270
274
     * Indicates wether $HTTP_*_VARS[] (request_use_auto_globals=false)
400
404
 * @access private
401
405
 */
402
406
    /**
403
 
     * error messages. true/false
404
 
     *
405
 
     * @var boolean
406
 
     */
407
 
    var $_error_msg            = false;
408
 
 
409
 
    /**
410
407
     * where assigned template vars are kept
411
408
     *
412
409
     * @var array
467
464
     *
468
465
     * @var string
469
466
     */
470
 
    var $_version              = '2.6.2';
 
467
    var $_version              = '2.6.8';
471
468
 
472
469
    /**
473
470
     * current template inclusion depth
917
914
        switch ($type) {
918
915
            case 'output':
919
916
                $_params = array('plugins' => array(array($type . 'filter', $name, null, null, false)));
920
 
                require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.load_plugins.php');
 
917
                require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
921
918
                smarty_core_load_plugins($_params, $this);
922
919
                break;
923
920
 
944
941
        if (!isset($compile_id))
945
942
            $compile_id = $this->compile_id;
946
943
 
947
 
    if (!isset($tpl_file))
948
 
        $compile_id = null;
 
944
        if (!isset($tpl_file))
 
945
            $compile_id = null;
949
946
 
950
 
    $_auto_id = $this->_get_auto_id($cache_id, $compile_id);
 
947
        $_auto_id = $this->_get_auto_id($cache_id, $compile_id);
951
948
 
952
949
        if (!empty($this->cache_handler_func)) {
953
950
            return call_user_func_array($this->cache_handler_func,
957
954
                            'auto_source' => $tpl_file,
958
955
                            'auto_id' => $_auto_id,
959
956
                            'exp_time' => $exp_time);
960
 
            require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.rm_auto.php');
 
957
            require_once(SMARTY_CORE_DIR . 'core.rm_auto.php');
961
958
            return smarty_core_rm_auto($_params, $this);
962
959
        }
963
960
 
972
969
     */
973
970
    function clear_all_cache($exp_time = null)
974
971
    {
975
 
        if (!empty($this->cache_handler_func)) {
976
 
            $dummy = null;
977
 
            call_user_func_array($this->cache_handler_func,
978
 
                           array('clear', &$this, &$dummy, null, null, null, $exp_time));
979
 
        } else {
980
 
            $_params = array('auto_base' => $this->cache_dir,
981
 
                            'auto_source' => null,
982
 
                            'auto_id' => null,
983
 
                            'exp_time' => $exp_time);
984
 
            require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.rm_auto.php');
985
 
            return smarty_core_rm_auto($_params, $this);
986
 
        }
 
972
        return $this->clear_cache(null, null, null, $exp_time);
987
973
    }
988
974
 
989
975
 
1008
994
            'cache_id' => $cache_id,
1009
995
            'compile_id' => $compile_id
1010
996
        );
1011
 
        require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.read_cache_file.php');
 
997
        require_once(SMARTY_CORE_DIR . 'core.read_cache_file.php');
1012
998
        return smarty_core_read_cache_file($_params, $this);
1013
999
    }
1014
1000
 
1042
1028
                        'auto_id' => $compile_id,
1043
1029
                        'exp_time' => $exp_time,
1044
1030
                        'extensions' => array('.inc', '.php'));
1045
 
        require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.rm_auto.php');
 
1031
        require_once(SMARTY_CORE_DIR . 'core.rm_auto.php');
1046
1032
        return smarty_core_rm_auto($_params, $this);
1047
1033
    }
1048
1034
 
1146
1132
                    $this->debugging = true;
1147
1133
                }
1148
1134
            } else {
1149
 
                $_cookie_var = $this->request_use_auto_globals ? $_COOKIE['SMARTY_DEBUG'] : $GLOBALS['HTTP_COOKIE_VARS']['SMARTY_DEBUG'];
1150
 
                $this->debugging = $_cookie_var ? true : false;
 
1135
                $this->debugging = (bool)($this->request_use_auto_globals ? @$_COOKIE['SMARTY_DEBUG'] : @$GLOBALS['HTTP_COOKIE_VARS']['SMARTY_DEBUG']);
1151
1136
            }
1152
1137
        }
1153
1138
 
1154
1139
        if ($this->debugging) {
1155
1140
            // capture time for debugging info
1156
1141
            $_params = array();
1157
 
            require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.get_microtime.php');
 
1142
            require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
1158
1143
            $_debug_start_time = smarty_core_get_microtime($_params, $this);
1159
1144
            $this->_smarty_debug_info[] = array('type'      => 'template',
1160
1145
                                                'filename'  => $resource_name,
1179
1164
                'compile_id' => $compile_id,
1180
1165
                'results' => null
1181
1166
            );
1182
 
            require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.read_cache_file.php');
 
1167
            require_once(SMARTY_CORE_DIR . 'core.read_cache_file.php');
1183
1168
            if (smarty_core_read_cache_file($_params, $this)) {
1184
1169
                $_smarty_results = $_params['results'];
1185
 
                if (@count($this->_cache_info['insert_tags'])) {
 
1170
                if (!empty($this->_cache_info['insert_tags'])) {
1186
1171
                    $_params = array('plugins' => $this->_cache_info['insert_tags']);
1187
 
                    require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.load_plugins.php');
 
1172
                    require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
1188
1173
                    smarty_core_load_plugins($_params, $this);
1189
1174
                    $_params = array('results' => $_smarty_results);
1190
 
                    require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.process_cached_inserts.php');
 
1175
                    require_once(SMARTY_CORE_DIR . 'core.process_cached_inserts.php');
1191
1176
                    $_smarty_results = smarty_core_process_cached_inserts($_params, $this);
1192
1177
                }
1193
 
                if (@count($this->_cache_info['cache_serials'])) {
 
1178
                if (!empty($this->_cache_info['cache_serials'])) {
1194
1179
                    $_params = array('results' => $_smarty_results);
1195
 
                    require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.process_compiled_include.php');
 
1180
                    require_once(SMARTY_CORE_DIR . 'core.process_compiled_include.php');
1196
1181
                    $_smarty_results = smarty_core_process_compiled_include($_params, $this);
1197
1182
                }
1198
1183
 
1202
1187
                    {
1203
1188
                        // capture time for debugging info
1204
1189
                        $_params = array();
1205
 
                        require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.get_microtime.php');
 
1190
                        require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
1206
1191
                        $this->_smarty_debug_info[$_included_tpls_idx]['exec_time'] = smarty_core_get_microtime($_params, $this) - $_debug_start_time;
1207
 
                        require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.display_debug_console.php');
 
1192
                        require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');
1208
1193
                        $_smarty_results .= smarty_core_display_debug_console($_params, $this);
1209
1194
                    }
1210
1195
                    if ($this->cache_modified_check) {
1215
1200
                            && !$this->_cache_serials
1216
1201
                            && $_gmt_mtime == $_last_modified_date) {
1217
1202
                            if (php_sapi_name()=='cgi')
1218
 
                                header("Status: 304 Not Modified");
 
1203
                                header('Status: 304 Not Modified');
1219
1204
                            else
1220
 
                                header("HTTP/1.1 304 Not Modified");
 
1205
                                header('HTTP/1.1 304 Not Modified');
1221
1206
 
1222
1207
                        } else {
1223
 
                            header("Last-Modified: ".$_gmt_mtime);
 
1208
                            header('Last-Modified: '.$_gmt_mtime);
1224
1209
                            echo $_smarty_results;
1225
1210
                        }
1226
1211
                    } else {
1239
1224
            } else {
1240
1225
                $this->_cache_info['template'][$resource_name] = true;
1241
1226
                if ($this->cache_modified_check && $display) {
1242
 
                    header("Last-Modified: ".gmdate('D, d M Y H:i:s', time()).' GMT');
 
1227
                    header('Last-Modified: '.gmdate('D, d M Y H:i:s', time()).' GMT');
1243
1228
                }
1244
1229
            }
1245
1230
        }
1285
1270
                        'cache_id' => $cache_id,
1286
1271
                        'compile_id' => $compile_id,
1287
1272
                        'results' => $_smarty_results);
1288
 
            require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.write_cache_file.php');
 
1273
            require_once(SMARTY_CORE_DIR . 'core.write_cache_file.php');
1289
1274
            smarty_core_write_cache_file($_params, $this);
1290
 
            require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.process_cached_inserts.php');
 
1275
            require_once(SMARTY_CORE_DIR . 'core.process_cached_inserts.php');
1291
1276
            $_smarty_results = smarty_core_process_cached_inserts($_params, $this);
1292
1277
 
1293
1278
            if ($this->_cache_serials) {
1306
1291
            if ($this->debugging) {
1307
1292
                // capture time for debugging info
1308
1293
                $_params = array();
1309
 
                require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.get_microtime.php');
 
1294
                require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
1310
1295
                $this->_smarty_debug_info[$_included_tpls_idx]['exec_time'] = (smarty_core_get_microtime($_params, $this) - $_debug_start_time);
1311
 
                require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.display_debug_console.php');
 
1296
                require_once(SMARTY_CORE_DIR . 'core.display_debug_console.php');
1312
1297
                echo smarty_core_display_debug_console($_params, $this);
1313
1298
            }
1314
1299
            error_reporting($_smarty_old_error_level);
1374
1359
    function _get_plugin_filepath($type, $name)
1375
1360
    {
1376
1361
        $_params = array('type' => $type, 'name' => $name);
1377
 
        require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.assemble_plugin_filepath.php');
 
1362
        require_once(SMARTY_CORE_DIR . 'core.assemble_plugin_filepath.php');
1378
1363
        return smarty_core_assemble_plugin_filepath($_params, $this);
1379
1364
    }
1380
1365
 
1427
1412
        }
1428
1413
 
1429
1414
        $_source_content = $_params['source_content'];
1430
 
        $_resource_timestamp = $_params['resource_timestamp'];
1431
1415
        $_cache_include    = substr($compile_path, 0, -4).'.inc';
1432
1416
 
1433
1417
        if ($this->_compile_source($resource_name, $_source_content, $_compiled_content, $_cache_include)) {
1434
1418
            // if a _cache_serial was set, we also have to write an include-file:
1435
1419
            if ($this->_cache_include_info) {
1436
 
                require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.write_compiled_include.php');
1437
 
                smarty_core_write_compiled_include(array_merge($this->_cache_include_info, array('compiled_content'=>$_compiled_content)),  $this);
 
1420
                require_once(SMARTY_CORE_DIR . 'core.write_compiled_include.php');
 
1421
                smarty_core_write_compiled_include(array_merge($this->_cache_include_info, array('compiled_content'=>$_compiled_content, 'resource_name'=>$resource_name)),  $this);
1438
1422
            }
1439
1423
 
1440
 
            $_params = array('compile_path'=>$compile_path, 'compiled_content' => $_compiled_content, 'resource_timestamp' => $_resource_timestamp);
1441
 
            require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.write_compiled_resource.php');
 
1424
            $_params = array('compile_path'=>$compile_path, 'compiled_content' => $_compiled_content);
 
1425
            require_once(SMARTY_CORE_DIR . 'core.write_compiled_resource.php');
1442
1426
            smarty_core_write_compiled_resource($_params, $this);
1443
1427
 
1444
1428
            return true;
1445
1429
        } else {
1446
 
            $this->trigger_error($smarty_compiler->_error_msg);
1447
1430
            return false;
1448
1431
        }
1449
1432
 
1483
1466
        $smarty_compiler->secure_dir        = $this->secure_dir;
1484
1467
        $smarty_compiler->security_settings = $this->security_settings;
1485
1468
        $smarty_compiler->trusted_dir       = $this->trusted_dir;
 
1469
        $smarty_compiler->use_sub_dirs      = $this->use_sub_dirs;
1486
1470
        $smarty_compiler->_reg_objects      = &$this->_reg_objects;
1487
1471
        $smarty_compiler->_plugins          = &$this->_plugins;
1488
1472
        $smarty_compiler->_tpl_vars         = &$this->_tpl_vars;
1491
1475
        $smarty_compiler->_config            = $this->_config;
1492
1476
        $smarty_compiler->request_use_auto_globals  = $this->request_use_auto_globals;
1493
1477
 
1494
 
        $smarty_compiler->_cache_serial = null;
 
1478
        if (isset($cache_include_path) && isset($this->_cache_serials[$cache_include_path])) {
 
1479
            $smarty_compiler->_cache_serial = $this->_cache_serials[$cache_include_path];
 
1480
        }
1495
1481
        $smarty_compiler->_cache_include = $cache_include_path;
1496
1482
 
1497
1483
 
1546
1532
        $_params = array('resource_name' => $params['resource_name']) ;
1547
1533
        if (isset($params['resource_base_path']))
1548
1534
            $_params['resource_base_path'] = $params['resource_base_path'];
 
1535
        else
 
1536
            $_params['resource_base_path'] = $this->template_dir;
1549
1537
 
1550
1538
        if ($this->_parse_resource_name($_params)) {
1551
1539
            $_resource_type = $_params['resource_type'];
1596
1584
                $this->trigger_error('unable to read resource: "' . $params['resource_name'] . '"');
1597
1585
            }
1598
1586
        } else if ($_return && $this->security) {
1599
 
            require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.is_secure.php');
 
1587
            require_once(SMARTY_CORE_DIR . 'core.is_secure.php');
1600
1588
            if (!smarty_core_is_secure($_params, $this)) {
1601
1589
                if (!$params['quiet'])
1602
1590
                    $this->trigger_error('(secure mode) accessing "' . $params['resource_name'] . '" is not allowed');
1641
1629
        }
1642
1630
 
1643
1631
        if ($params['resource_type'] == 'file') {
1644
 
            if (!preg_match("/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/", $params['resource_name'])) {
 
1632
            if (!preg_match('/^([\/\\\\]|[a-zA-Z]:[\/\\\\])/', $params['resource_name'])) {
1645
1633
                // relative pathname to $params['resource_base_path']
1646
1634
                // use the first directory where the file is found
1647
 
                if (isset($params['resource_base_path'])) {
1648
 
                    $_resource_base_path = (array)$params['resource_base_path'];
1649
 
                } else {
1650
 
                    $_resource_base_path = (array)$this->template_dir;
1651
 
                    $_resource_base_path[] = '.';
1652
 
                }
1653
 
                foreach ($_resource_base_path as $_curr_path) {
 
1635
                foreach ((array)$params['resource_base_path'] as $_curr_path) {
1654
1636
                    $_fullpath = $_curr_path . DIRECTORY_SEPARATOR . $params['resource_name'];
1655
1637
                    if (file_exists($_fullpath) && is_file($_fullpath)) {
1656
1638
                        $params['resource_name'] = $_fullpath;
1658
1640
                    }
1659
1641
                    // didn't find the file, try include_path
1660
1642
                    $_params = array('file_path' => $_fullpath);
1661
 
                    require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.get_include_path.php');
 
1643
                    require_once(SMARTY_CORE_DIR . 'core.get_include_path.php');
1662
1644
                    if(smarty_core_get_include_path($_params, $this)) {
1663
1645
                        $params['resource_name'] = $_params['new_file_path'];
1664
1646
                        return true;
1665
1647
                    }
1666
1648
                }
1667
1649
                return false;
 
1650
            } else {
 
1651
                /* absolute path */
 
1652
                return file_exists($params['resource_name']);
1668
1653
            }
1669
1654
        } elseif (empty($this->_plugins['resource'][$params['resource_type']])) {
1670
1655
            $_params = array('type' => $params['resource_type']);
1671
 
            require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.load_resource_plugin.php');
 
1656
            require_once(SMARTY_CORE_DIR . 'core.load_resource_plugin.php');
1672
1657
            smarty_core_load_resource_plugin($_params, $this);
1673
1658
        }
1674
1659
 
1715
1700
 
1716
1701
 
1717
1702
    /**
1718
 
     * read in a file from line $start for $lines.
1719
 
     * read the entire file if $start and $lines are null.
 
1703
     * read in a file
1720
1704
     *
1721
1705
     * @param string $filename
1722
 
     * @param integer $start
1723
 
     * @param integer $lines
1724
1706
     * @return string
1725
1707
     */
1726
 
    function _read_file($filename, $start=null, $lines=null)
 
1708
    function _read_file($filename)
1727
1709
    {
1728
 
        if (!($fd = @fopen($filename, 'r'))) {
 
1710
        if ( file_exists($filename) && ($fd = @fopen($filename, 'rb')) ) {
 
1711
            $contents = ($size = filesize($filename)) ? fread($fd, $size) : '';
 
1712
            fclose($fd);
 
1713
            return $contents;
 
1714
        } else {
1729
1715
            return false;
1730
1716
        }
1731
 
        flock($fd, LOCK_SH);
1732
 
        if ($start == null && $lines == null) {
1733
 
            // read the entire file
1734
 
            $contents = fread($fd, filesize($filename));
1735
 
        } else {
1736
 
            if ( $start > 1 ) {
1737
 
                // skip the first lines before $start
1738
 
                for ($loop=1; $loop < $start; $loop++) {
1739
 
                    fgets($fd, 65536);
1740
 
                }
1741
 
            }
1742
 
            if ( $lines == null ) {
1743
 
                // read the rest of the file
1744
 
                while (!feof($fd)) {
1745
 
                    $contents .= fgets($fd, 65536);
1746
 
                }
1747
 
            } else {
1748
 
                // read up to $lines lines
1749
 
                for ($loop=0; $loop < $lines; $loop++) {
1750
 
                    $contents .= fgets($fd, 65536);
1751
 
                    if (feof($fd)) {
1752
 
                        break;
1753
 
                    }
1754
 
                }
1755
 
            }
1756
 
        }
1757
 
        fclose($fd);
1758
 
        return $contents;
1759
1717
    }
1760
1718
 
1761
1719
    /**
1771
1729
    function _get_auto_filename($auto_base, $auto_source = null, $auto_id = null)
1772
1730
    {
1773
1731
        $_compile_dir_sep =  $this->use_sub_dirs ? DIRECTORY_SEPARATOR : '^';
1774
 
 
1775
 
        if(@is_dir($auto_base)) {
1776
 
            $_return = $auto_base . DIRECTORY_SEPARATOR;
1777
 
        } else {
1778
 
            // auto_base not found, try include_path
1779
 
            $_params = array('file_path' => $auto_base);
1780
 
            require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.get_include_path.php');
1781
 
            smarty_core_get_include_path($_params, $this);
1782
 
            $_return = isset($_params['new_file_path']) ? $_params['new_file_path'] . DIRECTORY_SEPARATOR : null;
1783
 
        }
 
1732
        $_return = $auto_base . DIRECTORY_SEPARATOR;
1784
1733
 
1785
1734
        if(isset($auto_id)) {
1786
1735
            // make auto_id safe for directory names
1792
1741
        if(isset($auto_source)) {
1793
1742
            // make source name safe for filename
1794
1743
            $_filename = urlencode(basename($auto_source));
1795
 
            $_crc32 = crc32($auto_source) . $_compile_dir_sep;
 
1744
            $_crc32 = sprintf('%08X', crc32($auto_source));
1796
1745
            // prepend %% to avoid name conflicts with
1797
1746
            // with $params['auto_id'] names
1798
 
            $_crc32 = '%%' . substr($_crc32,0,3) . $_compile_dir_sep . '%%' . $_crc32;
1799
 
            $_return .= $_crc32 . $_filename;
 
1747
            $_crc32 = substr($_crc32, 0, 2) . $_compile_dir_sep .
 
1748
                      substr($_crc32, 0, 3) . $_compile_dir_sep . $_crc32;
 
1749
            $_return .= '%%' . $_crc32 . '%%' . $_filename;
1800
1750
        }
1801
1751
 
1802
1752
        return $_return;
1888
1838
    {
1889
1839
        if ($this->debugging) {
1890
1840
            $_params = array();
1891
 
            require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.get_microtime.php');
 
1841
            require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
1892
1842
            $debug_start_time = smarty_core_get_microtime($_params, $this);
1893
1843
            $this->_smarty_debug_info[] = array('type'      => 'template',
1894
1844
                                                  'filename'  => $params['smarty_include_tpl_file'],
1919
1869
        if ($this->debugging) {
1920
1870
            // capture time for debugging info
1921
1871
            $_params = array();
1922
 
            require_once(SMARTY_DIR . 'core' . DIRECTORY_SEPARATOR . 'core.get_microtime.php');
 
1872
            require_once(SMARTY_CORE_DIR . 'core.get_microtime.php');
1923
1873
            $this->_smarty_debug_info[$included_tpls_idx]['exec_time'] = smarty_core_get_microtime($_params, $this) - $debug_start_time;
1924
1874
        }
1925
1875