From eb147ad0c3da382d991ae542720a36910f988d60 Mon Sep 17 00:00:00 2001 From: knut <> Date: Tue, 19 Jun 2007 05:52:54 +0000 Subject: fixed #655 --- HISTORY | 1 + framework/Web/TAssetManager.php | 7 ++++--- tests/unit/Web/TAssetManagerTest.php | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/HISTORY b/HISTORY index b6784596..bc61deef 100644 --- a/HISTORY +++ b/HISTORY @@ -7,6 +7,7 @@ BUG: Ticket#651 - TUserManager Roles names (from config) should be trimmed (Qian BUG: Ticket#652 - OFFSET must be specified together with LIMIT for TScaffoldView (Qiang) BUG: TWizard Sidebar using TDataListItemRenderer has error (Qiang) BUG: Ticket#654 - TAssetManager::copyDirectory() do not run closedir on an invalid resource (Knut) +BUG: Ticket#655 - TAssetManager::publishTarFile() exception for 'assetmanager_tarchecksum_invalid' is not thrown on BSD systems (Knut) ENH: Ticket#625 - Added @ to represent authenticated users in auth rules (Qiang) ENH: Ticket#631 - Make TQueue implement Countable as the other collection classes (Knut) ENH: Ticket#634 - Override __toString for TXmlElement and TXmlDocument (Knut) diff --git a/framework/Web/TAssetManager.php b/framework/Web/TAssetManager.php index c71ea449..3b535efe 100644 --- a/framework/Web/TAssetManager.php +++ b/framework/Web/TAssetManager.php @@ -286,13 +286,14 @@ class TAssetManager extends TModule * as published asset assumes that the tar file has already been extracted. * @param string tar filename * @param string MD5 checksum for the corresponding tar file. + * @param boolean Wether or not to check the time stamp of the file for publishing. Defaults to false. * @return string URL path to the directory where the tar file was extracted. */ public function publishTarFile($tarfile, $md5sum, $checkTimestamp=false) - { + { if(isset($this->_published[$md5sum])) return $this->_published[$md5sum]; - else if(($fullpath=realpath($md5sum))===false) + else if(($fullpath=realpath($md5sum))===false || !is_file($fullpath)) throw new TInvalidDataValueException('assetmanager_tarchecksum_invalid',$md5sum); else { @@ -320,7 +321,7 @@ class TAssetManager extends TModule */ protected function deployTarFile($path,$destination) { - if(($fullpath=realpath($path))===false) + if(($fullpath=realpath($path))===false || !is_file($fullpath)) throw new TIOException('assetmanager_tarfile_invalid',$path); else { diff --git a/tests/unit/Web/TAssetManagerTest.php b/tests/unit/Web/TAssetManagerTest.php index fde11ac4..f5485822 100644 --- a/tests/unit/Web/TAssetManagerTest.php +++ b/tests/unit/Web/TAssetManagerTest.php @@ -168,7 +168,7 @@ class TAssetManagerTest extends PHPUnit_Framework_TestCase { // First, try with bad md5 try { $manager->publishTarFile($tarFile, 'badMd5File'); - self::fail('Expected Expected TInvalidDataValueException not thrown'); + self::fail('Expected TInvalidDataValueException not thrown'); } catch (TInvalidDataValueException $e) {} // Then, try with real md5 file -- cgit v1.2.3