Apply fix for #1003 to validateAttribute.
Merge branch 'master' of github.com:yiisoft/yii2