diff options
| author | 2014-10-09 16:02:56 +0200 | |
|---|---|---|
| committer | 2014-10-09 16:02:56 +0200 | |
| commit | ba163baa84c78bbb642a57bbba810ef5e7aa1bc3 (patch) | |
| tree | e2573207c930706045c5c32aa12fca4589156f22 /app | |
| parent | d842f85966b2873f1074c73ad79ec5169e7090f2 (diff) | |
Fix bug with getExtension()
getExtension() is not available on PHP < 5.3.7
Replaced by pathinfo(..., PATHINFO_EXTENSION)
See https://github.com/marienfressinaud/FreshRSS/issues/649
Diffstat (limited to 'app')
| -rwxr-xr-x | app/Controllers/indexController.php | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/Controllers/indexController.php b/app/Controllers/indexController.php index e8e26b142..d3b299f4e 100755 --- a/app/Controllers/indexController.php +++ b/app/Controllers/indexController.php @@ -330,7 +330,8 @@ class FreshRSS_index_Controller extends Minz_ActionController { private static function purgeTokens() { $oldest = time() - 2629744; //1 month //TODO: Use a configuration instead foreach (new DirectoryIterator(DATA_PATH . '/tokens/') as $fileInfo) { - if ($fileInfo->getExtension() === 'txt' && $fileInfo->getMTime() < $oldest) { + $extension = pathinfo($fileInfo->getFilename(), PATHINFO_EXTENSION); + if ($extension === 'txt' && $fileInfo->getMTime() < $oldest) { @unlink($fileInfo->getPathname()); } } |
