mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-05 10:54:27 +02:00
bugfix PHP5.2 compatibility compromised by SplFileInfo::getBasename() (Issue 110)
This commit is contained in:
@@ -1,4 +1,7 @@
|
|||||||
===== trunk =====
|
===== trunk =====
|
||||||
|
14.08.2012
|
||||||
|
- bugfix PHP5.2 compatibility compromised by SplFileInfo::getBasename() (Issue 110)
|
||||||
|
|
||||||
01.08.2012
|
01.08.2012
|
||||||
- bugfix avoid PHP error on $smarty->configLoad(...) with invalid section specification (Forum Topic 22608)
|
- bugfix avoid PHP error on $smarty->configLoad(...) with invalid section specification (Forum Topic 22608)
|
||||||
|
|
||||||
|
@@ -178,7 +178,7 @@ class Smarty_Internal_CacheResource_File extends Smarty_CacheResource {
|
|||||||
$_cacheDirs = new RecursiveDirectoryIterator($_dir);
|
$_cacheDirs = new RecursiveDirectoryIterator($_dir);
|
||||||
$_cache = new RecursiveIteratorIterator($_cacheDirs, RecursiveIteratorIterator::CHILD_FIRST);
|
$_cache = new RecursiveIteratorIterator($_cacheDirs, RecursiveIteratorIterator::CHILD_FIRST);
|
||||||
foreach ($_cache as $_file) {
|
foreach ($_cache as $_file) {
|
||||||
if (substr($_file->getBasename(),0,1) == '.' || strpos($_file, '.svn') !== false) continue;
|
if (substr(basename($_file->getPathname()),0,1) == '.' || strpos($_file, '.svn') !== false) continue;
|
||||||
// directory ?
|
// directory ?
|
||||||
if ($_file->isDir()) {
|
if ($_file->isDir()) {
|
||||||
if (!$_cache->isDot()) {
|
if (!$_cache->isDot()) {
|
||||||
|
@@ -72,7 +72,7 @@ class Smarty_Internal_Utility {
|
|||||||
$_compileDirs = new RecursiveDirectoryIterator($_dir);
|
$_compileDirs = new RecursiveDirectoryIterator($_dir);
|
||||||
$_compile = new RecursiveIteratorIterator($_compileDirs);
|
$_compile = new RecursiveIteratorIterator($_compileDirs);
|
||||||
foreach ($_compile as $_fileinfo) {
|
foreach ($_compile as $_fileinfo) {
|
||||||
if (substr($_fileinfo->getBasename(),0,1) == '.' || strpos($_fileinfo, '.svn') !== false) continue;
|
if (substr(basename($_file->getPathname()),0,1) == '.' || strpos($_fileinfo, '.svn') !== false) continue;
|
||||||
$_file = $_fileinfo->getFilename();
|
$_file = $_fileinfo->getFilename();
|
||||||
if (!substr_compare($_file, $extention, - strlen($extention)) == 0) continue;
|
if (!substr_compare($_file, $extention, - strlen($extention)) == 0) continue;
|
||||||
if ($_fileinfo->getPath() == substr($_dir, 0, -1)) {
|
if ($_fileinfo->getPath() == substr($_dir, 0, -1)) {
|
||||||
@@ -136,7 +136,7 @@ class Smarty_Internal_Utility {
|
|||||||
$_compileDirs = new RecursiveDirectoryIterator($_dir);
|
$_compileDirs = new RecursiveDirectoryIterator($_dir);
|
||||||
$_compile = new RecursiveIteratorIterator($_compileDirs);
|
$_compile = new RecursiveIteratorIterator($_compileDirs);
|
||||||
foreach ($_compile as $_fileinfo) {
|
foreach ($_compile as $_fileinfo) {
|
||||||
if (substr($_fileinfo->getBasename(),0,1) == '.' || strpos($_fileinfo, '.svn') !== false) continue;
|
if (substr(basename($_fileinfo->getPathname()),0,1) == '.' || strpos($_fileinfo, '.svn') !== false) continue;
|
||||||
$_file = $_fileinfo->getFilename();
|
$_file = $_fileinfo->getFilename();
|
||||||
if (!substr_compare($_file, $extention, - strlen($extention)) == 0) continue;
|
if (!substr_compare($_file, $extention, - strlen($extention)) == 0) continue;
|
||||||
if ($_fileinfo->getPath() == substr($_dir, 0, -1)) {
|
if ($_fileinfo->getPath() == substr($_dir, 0, -1)) {
|
||||||
@@ -231,7 +231,7 @@ class Smarty_Internal_Utility {
|
|||||||
}
|
}
|
||||||
$_compile = new RecursiveIteratorIterator($_compileDirs, RecursiveIteratorIterator::CHILD_FIRST);
|
$_compile = new RecursiveIteratorIterator($_compileDirs, RecursiveIteratorIterator::CHILD_FIRST);
|
||||||
foreach ($_compile as $_file) {
|
foreach ($_compile as $_file) {
|
||||||
if (substr($_file->getBasename(), 0, 1) == '.' || strpos($_file, '.svn') !== false)
|
if (substr(basename($_file->getPathname()), 0, 1) == '.' || strpos($_file, '.svn') !== false)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
$_filepath = (string) $_file;
|
$_filepath = (string) $_file;
|
||||||
|
Reference in New Issue
Block a user