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 =====
|
===== trunk =====
|
||||||
|
01.11.2012
|
||||||
|
- bugfix muteExcpetedErrors() would screw up for non-readable paths (Issue #118)
|
||||||
|
|
||||||
===== Smarty-3.1.12 =====
|
===== Smarty-3.1.12 =====
|
||||||
14.09.2012
|
14.09.2012
|
||||||
- bugfix template inheritance failed to compile with delimiters {/ and /} (Forum Topic 23008)
|
- bugfix template inheritance failed to compile with delimiters {/ and /} (Forum Topic 23008)
|
||||||
|
@@ -1392,10 +1392,12 @@ class Smarty extends Smarty_Internal_TemplateBase {
|
|||||||
// add the SMARTY_DIR to the list of muted directories
|
// add the SMARTY_DIR to the list of muted directories
|
||||||
if (!isset(Smarty::$_muted_directories[SMARTY_DIR])) {
|
if (!isset(Smarty::$_muted_directories[SMARTY_DIR])) {
|
||||||
$smarty_dir = realpath(SMARTY_DIR);
|
$smarty_dir = realpath(SMARTY_DIR);
|
||||||
Smarty::$_muted_directories[SMARTY_DIR] = array(
|
if ($smarty_dir !== false) {
|
||||||
'file' => $smarty_dir,
|
Smarty::$_muted_directories[SMARTY_DIR] = array(
|
||||||
'length' => strlen($smarty_dir),
|
'file' => $smarty_dir,
|
||||||
);
|
'length' => strlen($smarty_dir),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// walk the muted directories and test against $errfile
|
// walk the muted directories and test against $errfile
|
||||||
@@ -1403,6 +1405,11 @@ class Smarty extends Smarty_Internal_TemplateBase {
|
|||||||
if (!$dir) {
|
if (!$dir) {
|
||||||
// resolve directory and length for speedy comparisons
|
// resolve directory and length for speedy comparisons
|
||||||
$file = realpath($key);
|
$file = realpath($key);
|
||||||
|
if ($file === false) {
|
||||||
|
// this directory does not exist, remove and skip it
|
||||||
|
unset(Smarty::$_muted_directories[$key]);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
$dir = array(
|
$dir = array(
|
||||||
'file' => $file,
|
'file' => $file,
|
||||||
'length' => strlen($file),
|
'length' => strlen($file),
|
||||||
|
Reference in New Issue
Block a user