olegbaturin
e83a86fd30
Fix #18648 : Fix `yii\web\Request` to properly handle HTTP Basic Auth headers
3 years ago
Alexander Makarov
88a7a00458
release version 2.0.42
3 years ago
Bizley
209cf9b2de
Improve docs
3 years ago
Brandon Kelly
f935065bca
Fix #18518 : Add support for ngrok’s `X-Original-Host` header
4 years ago
Alexander Makarov
ccb14ff667
release version 2.0.39
4 years ago
Alexander Makarov
65e5640810
Fix #17932 : Fix regression in detection of AJAX requests ( #17937 )
5 years ago
Igor Tarasov
7f88acb313
Fix #17878 : Detect CORS AJAX requests without `X-Requested-With` in `Request::getIsAjax()`
5 years ago
Alexander Makarov
7ec7fd11ee
Fix #17878 : Added note about fetch() to Request::getIsAjax() phpdoc [skip ci]
5 years ago
Ather Shu
038ce9f77e
Fix #17755 : Fix a bug for web request with `trustedHosts` set to format `['10.0.0.1' => ['X-Forwarded-For']]`
5 years ago
Somogyi Márton
5e71b11d8d
#17733 : Additional fixes for #17665 , `Forwarded` header parsing in Request
...
- Remove header from secure headers
- Regexp and return null fix
- Fix tests, fix in array case sensitivity, rx duplicated group name
- Simplify code
- Add phpdoc
Co-Authored-By: Alexander Makarov <sam@rmcreative.ru>
5 years ago
Mikk Tendermann
83055dcc33
Fix #17665 : Implement RFC 7239 `Forwarded` header parsing in Request
5 years ago
Somogyi Márton
9054cdfdcc
Fixes #17521 : Request::getUserHost() and request::getUserIp() ( #17593 )
5 years ago
Somogyi Márton
c87855b31c
Fix #17573 : `Request::getUserIP()` security fix for the case when `Request::$trustedHost` and `Request::$ipHeaders` are used
5 years ago
Brandon Kelly
55418776d4
Fixes #17215 : Improved security for servers running PHP 7.0.0+
6 years ago
Pavel Dovlatov
bdb7c64910
Update to https protocol for php.net links ( #17168 ) [skip ci]
...
* Updated php.net link for some MemCache properties [skip ci]
* Changed protocol to https for links to php.net in comments
* Changed protocol to https for links to php.net in code
* Changed www.php.net (http) to secure.php.net (https) in comments
* Changed www.php.net (http) to secure.php.net (https) in code
* Changed protocol to https for links to php.net in UPGRADE.md
* Changed protocol to https for links to pecl.php.net in comments
* Changed us.php.net to secure.php.net (https) in comments
* Changed protocol to https for links to php.net in docs
* Changed www.php.net (http) to secure.php.net (https) in docs
* Changed protocol to https for links to pecl.php.net in docs
* Changed ru/jp.php.net to secure.php.net (https) in docs
Don't sure about russian guide: is this links meant to be for guide on russian, or not?
6 years ago
Nikolay
a140b2b468
Fixes #16991 : Removed usage of `utf8_encode()` from `Request::resolvePathInfo()`
6 years ago
SilverFire - Dmitry Naumenko
1e13bfd13d
Fixed CSRF token check bypassing in Request::getMethod()
6 years ago
cuileon
489dd119a5
merge from yiisoft/yii2
6 years ago
Alexander Makarov
15dfbb0875
Fixes #16322 : Fixed strings were not were not compared using timing attack resistant approach while CSRF token validation
6 years ago
Vladimir Reznichenko
6dd2aec011
[minor]: SCA ( #16269 )
...
* Php Inspections (EA Ultimate): minor code tweaks
* Php Inspections (EA Ultimate): code style
* Php Inspections (EA Ultimate): code style
* Php Inspections (EA Ultimate): code style
6 years ago
pgaultier
35ac718110
Fixes #16006 : Handle case when `X-Forwarded-Host` header have multiple hosts separated with a comma
7 years ago
Vladimir Reznichenko
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
7 years ago
Vladimir Reznichenko
f10cb6aeee
SCA with Php Inspections (EA Ultimate)
7 years ago
Carsten Brandt
e493843b1c
improve `@deprecated` annotations
7 years ago
Alexander Makarov
7bafb7bf09
Fixes #14488 : Added support for X-Forwarded-Host to `yii\web\Request`, fixed `getServerPort()` usage
7 years ago
Paul Klimov
acce1db53b
Fixes #14135 : Fixed `yii\web\Request::getBodyParam()` crashes on object type body params
7 years ago
Alexander Makarov
0b413b0e08
Fixed PHP 5.4 compatibility
7 years ago
Sam
4d388f6cd2
Fixes #15317 : Regenerate CSRF token if an empty value is given
7 years ago
Alexander Makarov
2d672b6722
release version 2.0.13
7 years ago
SilverFire - Dmitry Naumenko
d11bed5340
Minor, added strict comparsion
7 years ago
SilverFire - Dmitry Naumenko
ea2c475ea7
Moved `HTTP_AUTHORIZATION` header check to `\yii\web\Request`, added docs
...
Closes #13564
7 years ago
Alexander Makarov
3ee7629f13
Fixes #13486 : Use DI container to instantiate cookies in order to be able to set defaults
7 years ago
SilverFire - Dmitry Naumenko
1ce796ef0f
Removed ability to define a hostname as trusted because of possible security issues
...
Closes #14691
7 years ago
Carsten Brandt
1278b018fa
Add IIS specific header to secure headers ( #14715 )
...
See https://github.com/yiisoft/yii2/issues/14400#issuecomment-324233065
for more details.
7 years ago
Carsten Brandt
9e713dba29
break if a matching trusted host is found
...
fix for https://github.com/yiisoft/yii2/pull/13780#discussion_r134186910
thanks to @krukru !
PR #13780
7 years ago
Robert Korulczyk
5a8c3d537b
Enable `phpdoc_summary` rule in php-cs-fixer config ( #14675 )
...
* Enable `phpdoc_summary` rule in php-cs-fixer config.
* Fix case in "PHPDoc".
7 years ago
Robert Korulczyk
1501c659ac
Add empty lines before return statements. ( #14682 ) [skip ci]
7 years ago
Robert Korulczyk
b99e955627
Fix CS ( #14665 )
...
* Run php-cs-fixer.
* Enable phpdoc_types rule.
7 years ago
Sam
0017d9c660
Fixes #13780 : Added support for trusted proxies in `yii\web\Request`
7 years ago
Alexander Makarov
648971a82b
Fixes #14542 : Ensured only ASCII characters are in CSRF cookie value since binary data causes issues with ModSecurity and some browsers
7 years ago
PowerGamer1
8a6f5829d4
Fix for invalid example in Request phpdoc [skip ci]
7 years ago
Alexander Makarov
d38908fc13
Fixed #14469 : updated RFC links
7 years ago
yyxx9988
46bf3c410a
Add `yii\web\Request::getOrigin()` method that returns HTTP_ORIGIN of current CORS request
...
>The Origin request header indicates where a fetch originates from. It doesn't include any path information, but only the server name. It is sent with CORS requests, as well as with POST requests. It is similar to the Referer header, but, unlike this header, it doesn't disclose the whole path.
From https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Origin
Working code samples
```php
<?php
// We'll be granting access to only the arunranga.com domain
// which we think is safe to access this resource as application/xml
if($_SERVER['HTTP_ORIGIN'] == "http://arunranga.com ") {
header('Access-Control-Allow-Origin: http://arunranga.com ');
header('Content-type: application/xml');
readfile('arunerDotNetResource.xml');
} else {
header('Content-Type: text/html');
echo "<html>";
echo "<head>";
echo " <title>Another Resource</title>";
echo "</head>";
echo "<body>",
"<p>This resource behaves two-fold:";
echo "<ul>",
"<li>If accessed from <code>http://arunranga.com </code> it returns an XML document</li>";
echo "<li>If accessed from any other origin including from simply typing in the URL into the browser's address bar,";
echo "you get this HTML document</li>",
"</ul>",
"</body>",
"</html>";
}
?>
```
See https://developer.mozilla.org/en-US/docs/Web/HTTP/Server-Side_Access_Control for more info.
close #13835
7 years ago
Robert Korulczyk
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.
7 years ago
Carsten Brandt
be658f82bf
release version 2.0.12
7 years ago
Alexander Makarov
b04ff959ce
Fixed misleading docs about encoded URIs [skip ci]
8 years ago
Sam Mousa
183ebc5985
Revert "Moved serialization of `Cookie` to `Cookie`. Added unit test for serialization / deserialization."
...
This reverts commit a2acd88efe
.
8 years ago
Alexander Makarov
43edf24123
Eliminated else branches in yii\web\Request
8 years ago
Sam Mousa
8ae207c3a1
Fixes #13837 : Refactored masking of CSRF tokens
8 years ago
Sam Mousa
a2acd88efe
Moved serialization of `Cookie` to `Cookie`. Added unit test for serialization / deserialization.
8 years ago