126 Commits

Author SHA1 Message Date
52e4a3e645 release version 2.0.50 2024-05-30 20:23:31 +03:00
e2a167028b Upgrade to PSR12 coding standard (#20121) 2024-03-19 17:21:27 +03:00
73902f0730 Added support for string and DateTimeInterface as Cookie::$expire (#19920)
* Added support for string as Cookie::$expire

* Updated changelog for #19920 (Broadened the accepted type of `Cookie::$expire` from `int` to `int|string|null`)

* Fixed `\yiiunit\framework\web\ResponseTest::parseHeaderCookies()` to overwrite existing cookie.

* Added support for `\DateTimeInterface` in `\yii\web\Cookie::$expire`

* Fixed `\yiiunit\framework\web\ResponseTest::cookiesTestProvider()` for PHP 5.4 and commited missing code for \DateTimeInterface processing in `\yii\web\Response::sendCookies()`
2023-08-15 18:38:10 +02:00
87f05afb8a Prevent redirection with new line character in the route (#19800)
* Prevent redirection with new line character in the route

* Remove escape

* Remove import

* Changelog

* Remove \
2023-03-31 14:40:31 +02:00
473ead8e46 Optimize: simplified regexp (#19541) 2022-09-06 09:42:58 +03:00
161526cd41 HTTPS everywhere (#19503) 2022-08-03 12:32:18 +03:00
34708b4cf4 Fix #19400: Fix passing null in yii\web\Response::redirect() 2022-06-21 00:15:07 +03:00
a87c02c712 Fix more types (#19333)
* Migration::upsert() returns void

* Unneeded `@property` tags

* Add missing `null` param/return types

* Null types for db\Query + db\ActiveQuery

* Fixed testSelect

* Null types for Validator

* Several more null types

* One more

* Make AccessRule::$allow always a boolean

It doesn't have any special null handling, so it's safe to default to false

* Validator::$skipOnEmpty is always a boolean

* Catch all throwable from Widget::widget()

* Don't limit $previous args to \Exception

The actual \Exception allows $previous to be any throwable in PHP 7+

* Add Throwable catch block to Instance::get()

* Throwable cleanup

Comment changes only.

- Document \Throwable instead of \Exception wherever appropriate
- Removed redundant exception/error classes when \Throwable is referenced

* Yii::setlogger() accepts null

* ArrayHelper::removeValue() can remove any type of value

* Change default $allow value to false
2022-04-03 11:20:21 +02:00
4628b91e73 Fix types (#19332)
* Migration::upsert() returns void

* Unneeded `@property` tags

* Add missing `null` param/return types

* Null types for db\Query + db\ActiveQuery

* Fixed testSelect
2022-03-30 18:40:10 +02:00
1271bc419f Fix #19041: Fix PHP 8.1 issues 2022-01-14 13:52:01 +03:00
655786b7ed release version 2.0.44 2021-12-30 10:50:56 +03:00
629133f1bf Fix #18619: Do not modify yii\web\Cookie::$path on yii\web\Response::sendCookies() 2021-04-27 21:10:13 +03:00
6b33ddf441 Fix #18199: Fix content body response on 304 HTTP status code, according to RFC 7232 2020-11-23 23:05:04 +03:00
279f59a3d4 Fix #18394: Add support for setting yii\web\Response::$stream to a callable 2020-11-23 22:56:59 +03:00
ccb14ff667 release version 2.0.39 2020-11-10 13:58:35 +03:00
88e79d3f8e Fix #18290: Fix response with non-seekable streams 2020-10-02 11:48:02 +03:00
03da5bb689 Updates to ErrorHandler, add missing type hint \Throwable (#18302)
* Updated phpdoc so it has \Throwable

- `abstract protected function renderException($exception);` is extended in web/ErrorHandler to also have `\Error`.
- `public static function convertExceptionToError($exception)` is called from widgets/ActiveField.php with 
```
/**
     * PHP magic method that returns the string representation of this object.
     * @return string the string representation of this object.
     */
    public function __toString()
    {
        // __toString cannot throw exception
        // use trigger_error to bypass this limitation
        try {
            return $this->render();
        } catch (\Exception $e) {
            ErrorHandler::convertExceptionToError($e);
            return '';
        } catch (\Throwable $e) {
            ErrorHandler::convertExceptionToError($e);
            return '';
        }
    }
```

* Add \Throwable to phpdoc in response.php 

The ErrorHandler has been updated in phpdoc to have throwable, this complets that change.

* Update ErrorHandler.php

fixed missing `|`
2020-09-30 02:34:23 +03:00
975937e531 Fix #18006: Allow SameSite cookie pre PHP 7.3 2020-05-01 13:28:23 +03:00
13c14292c2 Fix #17948: Ignore errors caused by set_time_limit(0) 2020-04-05 11:55:26 +03:00
f8d417c42a Fixed usage of non-existing ResponseEvent in yii\web\Response docs (#17939) 2020-03-26 15:45:39 +03:00
6c1b2db9de Fix #17434: IE Ajax redirect fix for non 11.0 versions 2019-11-18 12:45:35 +03:00
c75ef05539 Fix #17434: Fix regular expression illegal character; Repeated fix for Internet Explorer 11 AJAX redirect bug in case of 301 and 302 response codes (XMLHttpRequest: Network Error 0x800c0008) 2019-09-10 13:52:08 +03:00
37df938338 Fix #16531: Fix error in Response::sendContent() when set_time_limit() is disabled 2019-09-03 19:40:44 +03:00
10a069a3a4 Fix #17434: Fixed Internet Explorer 11 AJAX redirect bug in case of 301 and 302 response codes (XMLHttpRequest: Network Error 0x800c0008) 2019-09-03 17:54:14 +03:00
3601d512c2 Fixes #17070: Strip invalid character from fallback file name 2019-06-12 23:41:40 +03:00
1ed6ec1e5c Fixes #17353: Added sameSite support for yii\web\Cookie and yii\web\Session::cookieParams 2019-06-11 00:33:36 +03:00
81f7d381e5 Fixes #17180: Do not populate yii\web\Response::$response when response code is 204 2019-03-05 12:34:40 +03:00
fd3eb699d4 Fixes #17094: Fixed response on 204 status. Now it is empty 2019-02-04 00:10:47 +03:00
1a74b3d4f8 [minor] SCA with Php Inspections (EA Ultimate) (#15871)
* Php Inspections (EA Ultimate): use type casting where applicable

* Php Inspections (EA Ultimate): use constants where applicable

* Php Inspections (EA Ultimate): CS

* Php Inspections (EA Ultimate): address some of one-time used variables

* Php Inspections (EA Ultimate): address some of performance-related findings

* Php Inspections (EA Ultimate): address some of performance-related findings

* Php Inspections (EA Ultimate): revert a constant usage

* Php Inspections (EA Ultimate): revert sequential assignments

* Php Inspections (EA Ultimate): build is green again

* Php Inspections (EA Ultimate): revert array_merge tweaks

* Php Inspections (EA Ultimate): revert BC-incompatible one-time used variable tweak

* Update description [skip ci]

* Php Inspections (EA Ultimate): CS
2018-03-12 01:37:19 +03:00
e6f5c46cdc Fixes #15633: Deprecate some things going away/changing in 2.1
- Deprecated `yii\base\BaseObject::className()` in favor of native PHP syntax `::class`, which does not trigger autoloading
- Deprecated XCache and Zend data cache support as caching backends
- Deprecated `yii\BaseYii::powered()` method
- Added `yii\base\InvalidArgumentException` and deprecated `yii\base\InvalidParamException`
- Added `yii\BaseYii::debug()` and deprecated `yii\BaseYii::trace()`
2018-02-11 01:48:29 +03:00
28e7f31a37 Fixes #15046: Throw an yii\web\HeadersAlreadySentException if headers were sent before web response 2017-12-20 00:31:59 +03:00
5a8c3d537b Enable phpdoc_summary rule in php-cs-fixer config (#14675)
* Enable `phpdoc_summary` rule in php-cs-fixer config.

* Fix case in "PHPDoc".
2017-08-21 11:19:35 +02:00
1501c659ac Add empty lines before return statements. (#14682) [skip ci] 2017-08-21 01:58:49 +03:00
Sam
0017d9c660 Fixes #13780: Added support for trusted proxies in yii\web\Request 2017-08-17 13:14:51 +03:00
d38908fc13 Fixed #14469: updated RFC links 2017-07-17 16:21:49 +03:00
fe8a0a6a2e Enable no_useless_else rule in php-cs-fixer (#14420) 2017-07-10 11:26:21 +03:00
6f03e8b692 Fixes #14298: The default response formatter configs defined by yii\web\Response::defaultFormatters() now use the array syntax 2017-06-21 02:04:39 +03:00
ba0ab403b5 Added php-cs-fixer coding standards validation to Travis CI (#14100)
* php-cs-fixer: PSR2 rule.

* php-cs-fixer: PSR2 rule - fix views.

* Travis setup refactoring.

* Add php-cs-fixer to travis cs tests.

* Fix tests on hhvm-3.12

* improve travis config

* composer update

* revert composer update

* improve travis config

* Fix CS.

* Extract config to separate classes.

* Extract config to separate classes.

* Add file header.

* Force short array syntax.

* binary_operator_spaces fixer

* Fix broken tests

* cast_spaces fixer

* concat_space fixer

* dir_constant fixer

* ereg_to_preg fixer

* function_typehint_space fixer

* hash_to_slash_comment fixer

* is_null fixer

* linebreak_after_opening_tag fixer

* lowercase_cast fixer

* magic_constant_casing fixer

* modernize_types_casting fixer

* native_function_casing fixer

* new_with_braces fixer

* no_alias_functions fixer

* no_blank_lines_after_class_opening fixer

* no_blank_lines_after_phpdoc fixer

* no_empty_comment fixer

* no_empty_phpdoc fixer

* no_empty_statement fixer

* no_extra_consecutive_blank_lines fixer

* no_leading_import_slash fixer

* no_leading_namespace_whitespace fixer

* no_mixed_echo_print fixer

* no_multiline_whitespace_around_double_arrow fixer

* no_multiline_whitespace_before_semicolons fixer

* no_php4_constructor fixer

* no_short_bool_cast fixer

* no_singleline_whitespace_before_semicolons fixer

* no_spaces_around_offset fixer

* no_trailing_comma_in_list_call fixer

* no_trailing_comma_in_singleline_array fixer

* no_unneeded_control_parentheses fixer

* no_unused_imports fixer

* no_useless_return fixer

* no_whitespace_before_comma_in_array fixer

* no_whitespace_in_blank_line fixer

* not_operator_with_successor_space fixer

* object_operator_without_whitespace fixer

* ordered_imports fixer

* php_unit_construct fixer

* php_unit_dedicate_assert fixer

* php_unit_fqcn_annotation fixer

* phpdoc_indent fixer

* phpdoc_no_access fixer

* phpdoc_no_empty_return fixer

* phpdoc_no_package fixer

* phpdoc_no_useless_inheritdoc fixer

* Fix broken tests

* phpdoc_return_self_reference fixer

* phpdoc_single_line_var_spacing fixer

* phpdoc_single_line_var_spacing fixer

* phpdoc_to_comment fixer

* phpdoc_trim fixer

* phpdoc_var_without_name fixer

* psr4 fixer

* self_accessor fixer

* short_scalar_cast fixer

* single_blank_line_before_namespace fixer

* single_quote fixer

* standardize_not_equals fixer

* ternary_operator_spaces fixer

* trailing_comma_in_multiline_array fixer

* trim_array_spaces fixer

* protected_to_private fixer

* unary_operator_spaces fixer

* whitespace_after_comma_in_array fixer

* `parent::setRules()` -> `$this->setRules()`

* blank_line_after_opening_tag fixer

* Update finder config.

* Revert changes for YiiRequirementChecker.

* Fix array formatting.

* Add missing import.

* Fix CS for new code merged from master.

* Fix some indentation issues.
2017-06-12 12:25:45 +03:00
be658f82bf release version 2.0.12 2017-06-05 16:33:41 +02:00
8eabff0698 #13975: make documentation of current behaviour more clear [skip ci] 2017-04-16 00:55:35 +03:00
5bbf372f85 cleanup some phpdoc 2017-04-04 10:33:30 +02:00
ea75068a92 Fixes #13813: Fixed PHP 7 compatibiltiy by adding support for passing instances of Error to the yii\web\Response::setStatusCodeByException() 2017-03-23 01:20:42 +03:00
0770863209 Fixes #13820: Add new HTTP status code 451 2017-03-22 13:29:40 +03:00
bc59d5da85 Fixes #13707: Fixed \yii\web\ErrorHandler and \yii\web\ErrorAction not setting correct response code to response object before rendering error view 2017-03-16 12:03:23 +03:00
0b3c066bd2 Fixes #13695: \yii\web\Response::setStatusCode() method now returns the Response object itself 2017-03-04 18:55:17 +03:00
c19b2f7dc8 release version 2.0.11 2017-02-01 17:46:29 +01:00
37f19a0256 Fixes #13300, #13307, #13310, #13312
- Bug #13300: Allow pjax with "data-pjax" with no value in `yii.js`.
- Bug #13307: Preventing of race conditions in script filter in `yii.js` works incorrectly.
- Bug #13310: Handle relative and absolute URLs coincidence in CSS filter in `yii.js`.
- Bug #13312: `skipOuterContainers` option was incorrectly passed to pjax in `handleAction` in `yii.js`.
- Partially fixes #13299.

Adds tests for #8014, #11921, #10974, #11494, #10358, #10097.
2017-01-25 11:00:13 +03:00
deea3cf798 Fixes #12854: Added RangeNotSatisfiableHttpException to cover HTTP error 416 file request exceptions 2016-12-02 00:51:49 +03:00
4aa935e69e Fixes #12055: Changed boolean to bool and integer to int in phpdoc 2016-11-07 02:51:39 +03:00
32f4dc8997 Fixes #5385: links created from classes to corresponding guide articles (#12920) 2016-11-04 18:55:14 +03:00