mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 19:04:27 +02:00
Fixing Issue #118 - muteExpectedErrors would fail non-readable directories
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
===== trunk =====
|
||||
01.11.2012
|
||||
- bugfix muteExcpetedErrors() would screw up for non-readable paths (Issue #118)
|
||||
|
||||
===== Smarty-3.1.12 =====
|
||||
14.09.2012
|
||||
- bugfix template inheritance failed to compile with delimiters {/ and /} (Forum Topic 23008)
|
||||
|
@@ -1392,17 +1392,24 @@ class Smarty extends Smarty_Internal_TemplateBase {
|
||||
// add the SMARTY_DIR to the list of muted directories
|
||||
if (!isset(Smarty::$_muted_directories[SMARTY_DIR])) {
|
||||
$smarty_dir = realpath(SMARTY_DIR);
|
||||
if ($smarty_dir !== false) {
|
||||
Smarty::$_muted_directories[SMARTY_DIR] = array(
|
||||
'file' => $smarty_dir,
|
||||
'length' => strlen($smarty_dir),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// walk the muted directories and test against $errfile
|
||||
foreach (Smarty::$_muted_directories as $key => &$dir) {
|
||||
if (!$dir) {
|
||||
// resolve directory and length for speedy comparisons
|
||||
$file = realpath($key);
|
||||
if ($file === false) {
|
||||
// this directory does not exist, remove and skip it
|
||||
unset(Smarty::$_muted_directories[$key]);
|
||||
continue;
|
||||
}
|
||||
$dir = array(
|
||||
'file' => $file,
|
||||
'length' => strlen($file),
|
||||
|
Reference in New Issue
Block a user