Project

General

Profile

Actions

Bug #23994

closed

Incorrect use of is_dir in class.tx_rtehtmlarea_clearrtecache.php

Added by Juergen Deisenroth about 14 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Category:
-
Target version:
-
Start date:
2010-11-09
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

tx_rtehtmlarea_clearrtecache::clearTempDir calls is_dir without path informations. The code

function clearTempDir() {
$tempPath = t3lib_div::resolveBackPath(PATH_typo3.'../typo3temp/rtehtmlarea/');
$handle=opendir($tempPath);
while ($data=readdir($handle)) {
if (!is_dir($data) && $data!="." && $data!="..") {
unlink($tempPath.$data);
}
}
closedir($handle);
}

should be changed to something like this

public static function clearTempDir() {
$tempPath = t3lib_div::resolveBackPath(PATH_typo3.'../typo3temp/rtehtmlarea/');
if (($handle=@opendir($tempPath)) !== false) {
while (($data=readdir($handle)) !== false) {
$tmpFile = $tempPath . $data;
if( is_file($tmpFile) ) unlink($tmpFile);
}
closedir($handle);
}
}

This minor bug is in htmlArea RTE Version 1.8.12 to 2.1.2 (TYPO3 4.3.8 to 4.4.5a3)
(issue imported from #M16314)


Files

Actions

Also available in: Atom PDF