Project

General

Profile

Bug #24297 » bug_16685.patch

Administrator Admin, 2011-01-16 06:20

View differences:

typo3_src_trunk.new/t3lib/class.t3lib_stdgraphic.php 2011-01-16 08:15:11.000000000 +0300
// Create a md5 hash of the filename
$md5Hash = md5_file($imageFile);
preg_match('/([^\.]*)$/', $imageFile, $reg);
$res = $TYPO3_DB->exec_SELECTquery('md5hash, imagewidth, imageheight', 'cache_imagesizes', 'md5filename=' . $TYPO3_DB->fullQuoteStr(md5($imageFile), 'cache_imagesizes'));
$res = $TYPO3_DB->exec_SELECTquery('md5hash, md5filename, imagewidth, imageheight', 'cache_imagesizes', 'md5filename=' . $TYPO3_DB->fullQuoteStr(md5($imageFile), 'cache_imagesizes'));
if ($res) {
if ($row = $TYPO3_DB->sql_fetch_assoc($res)) {
if ($row['md5hash'] != $md5Hash) {
// file has changed, delete the row
$TYPO3_DB->exec_DELETEquery('cache_imagesizes', 'md5hash=' . $TYPO3_DB->fullQuoteStr($row['md5hash'], 'cache_imagesizes'));
$TYPO3_DB->exec_DELETEquery('cache_imagesizes', 'md5filename=' . $TYPO3_DB->fullQuoteStr($row['md5filename'], 'cache_imagesizes'));
} else {
return (array((int) $row['imagewidth'], (int) $row['imageheight'], strtolower($reg[0]), $imageFile));
}
(1-1/2)