Skip to content

Commit

Permalink
Merge branch 'cjavascript-encode-bug' of git://github.com/resurtm/yii…
Browse files Browse the repository at this point in the history
… into resurtm-cjavascript-encode-bug

Conflicts:
	CHANGELOG
  • Loading branch information
samdark committed Oct 10, 2012
2 parents 3e34f56 + 4b3ea3c commit 15b6028
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Expand Up @@ -25,6 +25,7 @@ Version 1.1.13 work in progress
- Bug #1444: Fixed CGoogleApi::register call to registerScriptFile (mdomba)
- Bug #1465: Fixed CHtml::beginForm() when CActiveForm with method GET and ajaxButton is used (mdomba)
- Bug #1485 CSort does not quote table alias when using CDbCriteria (undsoft)
- Bug #1552: Fixed potential vulnerability in CJavaScript::encode(): $safe parameter didn't used to be passed to the recursive method calls (resurtm)
- Enh #84: Log route categories are now accepted in form of array. Added CLogRoute::except and parameter to CLogRoute::getLogs that allows you to exclude specific categories (paystey)
- Enh #104: Added CWebLogRoute::$collapsedInFireBug property to control whether the log should be collapsed by default in Firebug (marcovtwout)
- Enh #117: Added CPhpMessageSource::$extensionPaths to allow extensions, that do not have a base class to use as category prefix, to register message source (rcoelho, cebe)
Expand Down
6 changes: 3 additions & 3 deletions framework/web/helpers/CJavaScript.php
Expand Up @@ -83,20 +83,20 @@ public static function encode($value,$safe=false)
elseif($value instanceof CJavaScriptExpression)
return $value->__toString();
elseif(is_object($value))
return self::encode(get_object_vars($value));
return self::encode(get_object_vars($value),$safe);
elseif(is_array($value))
{
$es=array();
if(($n=count($value))>0 && array_keys($value)!==range(0,$n-1))
{
foreach($value as $k=>$v)
$es[]="'".self::quote($k)."':".self::encode($v);
$es[]="'".self::quote($k)."':".self::encode($v,$safe);
return '{'.implode(',',$es).'}';
}
else
{
foreach($value as $v)
$es[]=self::encode($v);
$es[]=self::encode($v,$safe);
return '['.implode(',',$es).']';
}
}
Expand Down

0 comments on commit 15b6028

Please sign in to comment.