Commit Graph

719 Commits

Author SHA1 Message Date
SilverFire - Dmitry Naumenko
ecefc2bdfb Fixed typo in CacheSession::destroySession() 2017-02-20 23:13:44 +02:00
SilverFire - Dmitry Naumenko
f496567735 Fixed yii\web\CacheSession::destroySession() to work correctly when session is not written yet
Fixes #13537
2017-02-20 22:34:40 +02:00
SilverFire - Dmitry Naumenko
ab36cb29e1 Updated PHPDocs: marked session-handling methods as internal 2017-02-20 22:13:12 +02:00
Nikolay Oleynikov
323568c2e9 Remove trailing spaces from sources and tests (#13621) [skip ci] 2017-02-19 17:34:22 +03:00
Carsten Brandt
e82b40abee avoid duplicate slashes on empty values
fixes #13522
close #13525
2017-02-08 09:41:04 +01:00
Carsten Brandt
c19b2f7dc8 release version 2.0.11 2017-02-01 17:46:29 +01:00
Alexander Makarov
2c5ab1e07b Used non-regex solution for trimming slashes 2017-01-31 13:42:38 +01:00
Alexander Makarov
f9e83008f4 Prefer strpos to substr 2017-01-31 13:42:37 +01:00
ErickSkrauch
c641513583 Implementation of support UrlRule with relative host definition
close #12697
fixes #12691
2017-01-31 13:42:31 +01:00
Carsten Brandt
8faedcbd7c Refactored UrlManagerTest to cover more use cases
UrlManager is a complex class with a large bunch of options that needs
to be tested
and we had a few regressions in the past even though there are already a
lot of tests
covering it. Test coverage measured by lines does not help us determine
how good it is tested,
we need test coverage for every major path through the code.

I have refactored the UrlManager tests to reflect the different options
and cases to
have a better overview of which cases are covered and which are not.

UrlManager has two main operation modes:

- "default" url format, which is the simple case. These are covered by
  methods in `UrlManagerTest`.

- "pretty" url format. This is the complex case, which involves UrlRules
  and url parsing.
  I have created two separate classes for this case:
  Url creation for "pretty" url format is covered by
`UrlManagerCreateUrlTest`.
  Url parsing for "pretty" url format is covered by
`UrlManagerParseUrlTest`.

Each of the test classes have a `getUrlManager` method that creates a
UrlManager instance
with a specific configuration and certain variations in options.
It is also tested that options that are not relevant in a certain
operation mode have no effect on the result.

To make sure to not remove tests that have existed before, here is a map
of where code has been moved.
The following test methods existed in the [old test
class](4187718c14/tests/framework/web/UrlManagerTest.php):

- `testCreateUrl()` split between UrlManagerTest and
  UrlManagerCreateUrlTest variations should all be covered by
`variationsProvider()`.
- `testCreateUrlWithNullParams()` covered by UrlManagerCreateUrlTest by
  `testWithNullParams()`
- `testCreateUrlWithEmptyPattern()`
- `testCreateAbsoluteUrl()` covered in UrlManagerCreateUrlTest by new
  tests via `variationsProvider()`.
- `testCreateAbsoluteUrlWithSuffix()` covered in UrlManagerCreateUrlTest
  by `testAbsolutePatterns`.

- `testParseRequest()` covered by UrlManagerParseUrlTest, UrlNormalizer
  related parts moved to UrlNormalizerTest.
- `testParseRESTRequest()` moved to UrlManagerParseUrlTest
- `testHash()` covered in different tests in UrlManagerCreateUrlTest.
- `testMultipleHostsRules($host)` kept as is.

Before:

    $ vendor/bin/phpunit tests/framework/web/UrlManagerTest.php
    ...
    OK (12 tests, 89 assertions)

After:

    $ vendor/bin/phpunit tests/framework/web/UrlManager*.php
    ...
    OK (72 tests, 648 assertions)
2017-01-31 02:38:35 +01:00
Brandon Kelly
5609e918de Fixed some malformed @var tags (#13468) [skip ci] 2017-01-30 11:42:52 +03:00
Dmitriy Bashkarev
be4ebdd049 Fixes #13134: Added logging URL rules (bashkarev) 2017-01-27 19:03:45 +03:00
Alexey Rogachev
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
Alexander Makarov
eab3489ec7 Reverted #13393: Removed redundant call to yii\helpers\Url::to() in yii\web\Controller::redirect() (reverted from commit e5d169beb8) 2017-01-24 13:09:57 +03:00
Klimov Paul
c73de31a90 Fixed yii\web\MultipartFormDataParser adds an extra newline to every value 2017-01-23 13:18:31 +02:00
Alexander Makarov
cc37cd626f Fixes #12599: Fixed MSSQL fail to work with nvarbinary. Enhanced SQL scripts compatibility with older versions 2017-01-23 10:31:52 +03:00
Robert Korulczyk
507cc52658 Allow omit default params on URL creation
Fixes #10970
2017-01-22 22:19:13 +02:00
Andrew Nester
21faee5504 Fixes #13212: Fixed DbSession::regenerateID() failure when session_regenerate_id() fails 2017-01-22 20:15:36 +03:00
Vladimir Kuprienko
e5d169beb8 Fixes #13393: Removed redundant call to yii\helpers\Url::to() in yii\web\Controller::redirect() 2017-01-22 11:56:52 +03:00
Alexander Makarov
97171a0db7 Fixes #13401: Fixed lack of escaping of request dump at exception screens 2017-01-18 01:05:50 +03:00
SilverFire - Dmitry Naumenko
24ad05de5b Refactored yii\web\ErrorAction to make it reusable 2016-12-31 21:29:12 +02:00
Alexander Makarov
c33583aede Fixed naming for #13214 as suggested by Paul 2016-12-26 22:42:14 +07:00
Alexander Makarov
8ba78398c7 Handle root tag set to null or false or empty. Fixed version in @since 2016-12-16 02:23:08 +03:00
Alexander Makarov
2f7c1b36b5 Fixes #12419: Added ability to remove root tag and object tags for yii\web\XmlResponseFormatter 2016-12-16 00:27:31 +03:00
mhthnz
1dcc6042b6 Initial work on #12419 2016-12-16 00:12:32 +03:00
zalatov
deea3cf798 Fixes #12854: Added RangeNotSatisfiableHttpException to cover HTTP error 416 file request exceptions 2016-12-02 00:51:49 +03:00
Carsten Brandt
081ee7c5b1 Implemented shortcut methods for returning JSON and XML (#13101)
fixes #13036
2016-12-01 10:33:49 +01:00
Klimov Paul
7da77c3d5a created HostControl filter to prevent Host header attacks
fixes #13050
close #13063
2016-12-01 00:59:26 +01:00
Robert Korulczyk
2d91723934 Add support for creating protocol-relative URLs.
Improve phpdoc for protocol-relative URL creation.
Remove useless `is_string()` check.
2016-11-29 09:53:51 +02:00
Carsten Brandt
a498dedb5c Added documentation about Host header attack (#13073)
* Added documentation about Host header attack

Added info about Host header attack (#13050) to the guide and the Request class.
When we introduce a filter or property to protect against this, these
sections should be updated to link to that option.
2016-11-26 21:57:52 +01:00
Carsten Brandt
b8b3aeeb00 update deprecated phpdoc messages 2016-11-22 16:03:28 +01:00
Evgeniy Tkachenko
bd9e68eb0a Optimize imports (#13033) 2016-11-17 17:12:56 +03:00
Robert Korulczyk
1a70f60332 Merge master into doc-fixes
Conflicts:
	framework/web/AssetManager.php
2016-11-13 15:35:18 +01:00
Robert Korulczyk
7a3a342127 Fix errors reported by apidoc extension. (#12986) 2016-11-13 14:51:21 +01:00
Robert Korulczyk
450eefaa50 Some phpdoc fixes from scrutinizer. 2016-11-12 22:11:30 +01:00
Boudewijn Vahrmeijer
95f2c82009 Fixed the cryptic unstructured doc block (#12978) [skip ci] 2016-11-12 17:05:13 +03:00
Robert Korulczyk
4aa935e69e Fixes #12055: Changed boolean to bool and integer to int in phpdoc 2016-11-07 02:51:39 +03:00
Boudewijn Vahrmeijer
32f4dc8997 Fixes #5385: links created from classes to corresponding guide articles (#12920) 2016-11-04 18:55:14 +03:00
Alexander Makarov
bea7c63664 And another leftover
No pushes to master today anymore. Need more sleep :(
2016-11-02 14:17:56 +03:00
Alexander Makarov
3d9945958d Removed accidentally committed leftovers 2016-11-02 14:13:49 +03:00
Alexander Makarov
dd71fa3958 Fixes #4113: Error page stacktrace was generating links to private methods which are not part of the API docs 2016-11-02 13:42:11 +03:00
Alexander Makarov
0ac321370b Fixes #12856: Fixed yii\web\XmlResponseFormatter to use true and false to represent booleans 2016-10-29 21:57:48 +03:00
Carsten Brandt
11fe407ad0 release version 2.0.10 2016-10-20 14:02:50 +02:00
Carsten Brandt
8d5daef88e more direct link in DbSession comment 2016-10-13 12:28:52 +02:00
SilverFire - Dmitry Naumenko
e23a419732 PHPDocs updated 2016-10-12 20:29:32 +03:00
Alexander Makarov
4b43183df7 Fixes #10563: Fixed forming Content-Disposition header for file downloads (#12721) 2016-10-12 11:41:21 +03:00
Robert Korulczyk
63f95fa3ad Fixes #11309: Added yii\web\Request::getHostName() method that returns hostname of current request 2016-10-07 01:00:14 +03:00
Klimov Paul
7ca2260702 UrlManager::normalizer creation fixed 2016-10-04 17:02:57 +03:00
SilverFire - Dmitry Naumenko
3861108553 Fixed casting of binnary() type for MSSQL. Closes #12599 2016-09-26 13:41:27 +03:00
SilverFire - Dmitry Naumenko
3ec3ce9312 Reverted #10429 because of BC breaking 2016-09-23 12:28:50 +03:00