From 2e8e1d924bd21aa49569f07c7627f26011509259 Mon Sep 17 00:00:00 2001 From: "keyboard.idol@gmail.com" Date: Thu, 13 Jan 2011 08:33:10 +0000 Subject: [PATCH] (Fixes issue 1975) --- CHANGELOG | 1 + framework/web/CAssetManager.php | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index 14f51f2aa5..a75046690c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -21,6 +21,7 @@ Version 1.1.6 to be released - Bug #1942: Fixed the bug that CSecurityManager::computeHMAC() generates non-standard HMAC (Qiang) - Bug #1945: Fixed the bug that user-supplied form ID is not honored when building a form using CForm with a model (Qiang) - Bug #1948: Fixed a bug in generating the number symbols of I18N data from CLDR (Qiang) +- Bug #1975: Fixed the bug that caused a PHP error when CAssetManager::publish() tried to create a symlink in a non-existing directory (Y!!) - Bug: Fixed the bug that CActiveForm generates unnecessary js code about setting focus (Qiang) - Bug: Fixed CDateTimeParser::parse() default hour, minute and second handling when they are not used in pattern (Sam Dark) - Enh #1733: Updated multifile plugin used by CMultiFileUpload to version 1.47 (mdomba) diff --git a/framework/web/CAssetManager.php b/framework/web/CAssetManager.php index efd47b9c95..4d58ed4395 100644 --- a/framework/web/CAssetManager.php +++ b/framework/web/CAssetManager.php @@ -165,7 +165,14 @@ public function publish($path,$hashByName=false,$level=-1,$forceCopy=false) if($this->linkAssets) { if(!is_file($dstFile)) + { + if(!is_dir($dstDir)) + { + mkdir($dstDir); + @chmod($dstDir,0777); + } symlink($src,$dstFile); + } } else if(@filemtime($dstFile)<@filemtime($src) || $forceCopy) {