Skip to content

Commit

Permalink
Merge pull request yiisoft#753 from resurtm/fix-chtml-resolve-value-bug
Browse files Browse the repository at this point in the history
Bug: CHtml::resolveValue() ignoring of attribute elements accessor at the begining of the $attribute argument now works properly
  • Loading branch information
qiangxue committed May 26, 2012
2 parents 0d99213 + 86da4d3 commit 2b0db18
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG
Expand Up @@ -21,6 +21,7 @@ Version 1.1.11 work in progress
- Bug: Fixed CMenu::isItemActive() to work properly when there is a hash in the item's url (SlKelevro)
- Bug: Added missing return statement to CAuthItem->revoke() (mdomba)
- Bug #697: Fixed WSDLGenerator now generating proper namespace for certain complexTypes (BBoom)
- Bug: CHtml::resolveValue() ignoring of array elements accessor at the beginning of the $attribute argument now works properly (resurtm)
- Enh #120: Added ability to set cookies in an object based style without specifying the cookie-name twice (suralc)
- Enh #136: Added ability to select database connection in Gii model generator (samdark)
- Enh #165: Allow CCacheDependency to be reusable across multiple cache calls (phpnode)
Expand Down
4 changes: 2 additions & 2 deletions framework/web/helpers/CHtml.php
Expand Up @@ -2123,9 +2123,9 @@ public static function resolveValue($model,$attribute)
{
if(($pos=strpos($attribute,'['))!==false)
{
if($pos===0) // [a]name[b][c], should ignore [a]
if($pos===0) // [a]name[b][c], should ignore [a]
{
if(preg_match('/\](\w+)/',$attribute,$matches))
if(preg_match('/\](.*)/',$attribute,$matches))
$attribute=$matches[1];
if(($pos=strpos($attribute,'['))===false)
return $model->$attribute;
Expand Down

0 comments on commit 2b0db18

Please sign in to comment.