Skip to content

Commit

Permalink
Merge branch 'master' of git://github.com/yiisoft/yii into dev-201505…
Browse files Browse the repository at this point in the history
…29-Kovpak-CRangeValidator-phpdoc
  • Loading branch information
cn007b committed May 29, 2015
2 parents 561308d + 24539dd commit 6e70842
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG
Expand Up @@ -20,6 +20,7 @@ Version 1.1.17 work in progress
- Enh #3738: It is now possible to override the value of 'required' html option in `CHtml::activeLabelEx()` (matteosistisette)
- Enh #3827: Added the $options parameter to be used in stream_socket_client in CRedisCache.
- Chg #3776: Autoloader now doesn't error in case of non-existing namespaced classes so other autoloaders have chance to handle these (alexandernst)
- Bug #3869: jQuery Yii GridView now doesn't fail when refreshing grid via POST request (a-t)

Version 1.1.16 December 21, 2014
--------------------------------
Expand Down
22 changes: 22 additions & 0 deletions UPGRADE
Expand Up @@ -23,6 +23,20 @@ Upgrading from v1.1.16
Upgrading from v1.1.15
----------------------

- CFileValidator now clears attribute after validation in case attribute is marked as `safe` in `rules()` which is default.
The reason is that file uploads were often handled incorrectly by using real database attribute which lead to ability to
write arbitrary data into database column.

If you've followed [wiki article about uploading files](http://www.yiiframework.com/wiki/2/how-to-upload-a-file-using-a-model/),
you need to mark attribute as `unsafe`:

public function rules()
{
return array(
array('image', 'file', 'types'=>'jpg, gif, png', 'safe' => false), // <--- here
);
}

- CErrorHandler now runs errorAction for errors, which appear via AJAX request.
If you use CErrorHandler::errorAction, make sure it handles AJAX request properly.

Expand Down Expand Up @@ -66,6 +80,14 @@ No significant changes, 1.1.15 was a security fix release.
Upgrading from v1.1.13
----------------------

- CUploadedFile::getInstancesByName() now cannot handle a single file upload. Either change your upload field name to
be something like `ImageUpload[]` or, to keep backwards compatibility in your app, handle it like the following:

$this->ImageUpload = CUploadedFile::getInstancesByName('ImageUpload');
if (empty($this->ImageUpload)) {
$this->ImageUpload = array(CUploadedFile::getInstanceByName('ImageUpload'));
}

- CActiveRecord::count() now respects group by and having. If your code relied
on ignoring it your application may break and should be updated.

Expand Down
5 changes: 4 additions & 1 deletion framework/zii/widgets/assets/gridview/jquery.yiigridview.js
Expand Up @@ -327,7 +327,10 @@
}
} else {
if (options.data === undefined) {
options.data = $(settings.filterSelector).serialize();
options.data = {};
$.each($(settings.filterSelector).serializeArray(), function () {
options.data[this.name] = this.value;
});
}
}
if (settings.csrfTokenName && settings.csrfToken) {
Expand Down

0 comments on commit 6e70842

Please sign in to comment.