diff options
author | wei <> | 2006-02-22 04:28:21 +0000 |
---|---|---|
committer | wei <> | 2006-02-22 04:28:21 +0000 |
commit | aed2fa6fd84390e9509aebd9c745048594a29c1d (patch) | |
tree | 99c294d300930840ab62ec19dfc5ddfbbce15d41 | |
parent | 41c5b7e566c0019d0b8e0c9399b780a95ad44113 (diff) |
Remove empty string values from javascript encoding
-rw-r--r-- | framework/Web/Javascripts/TJavaScript.php | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/framework/Web/Javascripts/TJavaScript.php b/framework/Web/Javascripts/TJavaScript.php index 0d081e02..861b973a 100644 --- a/framework/Web/Javascripts/TJavaScript.php +++ b/framework/Web/Javascripts/TJavaScript.php @@ -32,7 +32,7 @@ class TJavaScript {
$str='';
foreach($files as $file)
- $str.='<script type="text/javascript" src="'.THttpUtility::htmlEncode($file)."\"></script>\n";
+ $str.= $this->renderScriptFile($file);
return $str;
}
@@ -125,7 +125,8 @@ class TJavaScript if($toMap)
{
foreach($value as $k=>$v)
- $results[]="'{$k}':".self::encode($v,$toMap);
+ if(is_string($v) && strlen($v) > 0)
+ $results[]="'{$k}':".self::encode($v,$toMap);
return '{'.implode(',',$results).'}';
}
else
|