Commit Graph

146 Commits

Author SHA1 Message Date
Carsten Brandt
fafe5926cb Merge branch 'patch-2' of https://github.com/zvirusz/yii
* 'patch-2' of https://github.com/zvirusz/yii:
  Backport Request::getPreferredLanguage() from yii2
2014-04-22 23:44:08 +02:00
pzaremba
7b68959372 Adding support for the X-HTTP-Method-Override header. 2014-02-04 22:50:38 +01:00
Carsten Brandt
9a1eac10c4 reverted pull request #2671 for issue #2670 2014-01-29 01:40:05 +01:00
Jani Mikkonen
ca25bc19b8 Merge branch 'master' of git://github.com/yiisoft/yii into user_host_address 2014-01-28 15:44:28 +02:00
Carsten Brandt
000a2167a9 Updated Request::getIsSecureConnection()
now works case insensitive

fixes #3147
2014-01-28 14:11:09 +01:00
Carsten Brandt
5555becf7e Added support for HTTP PATCH requests to CHttpRequest
fixes #2664
2014-01-28 13:14:10 +01:00
Carsten Brandt
32b8f82e58 Update CHttpRequest.php
Improved fix in 2cc4a81713
2014-01-07 17:17:56 +01:00
Alexander Makarov
2cc4a81713 Fixed uninitialized string offset: -1 when accessing frontpage w/o slash 2014-01-07 16:35:58 +04:00
Alexander Makarov
3a8e8c58f0 Fixed homepage 404 2014-01-07 13:00:04 +04:00
Alexander Makarov
4e6c118e6e Fixed URL parsing so it's now properly giving 404 for URLs like "http://example.com//////site/about/////" 2014-01-07 04:55:11 +04:00
Andrey Janzen
7e1938fbd7 Backport Request::getPreferredLanguage() from yii2 2013-08-07 10:33:15 +07:00
Carsten Brandt
75eb9f9986 Changed header case Content-type to Content-Type
fixes #2709 fixes #2726
2013-08-03 11:25:20 +02:00
Jani Mikkonen
cee55e82ce Update getUserHostAddress() 2013-07-22 13:11:44 +03:00
Jani Mikkonen
760c95862f Update getUserHostAddress() 2013-07-22 12:37:30 +03:00
Jani Mikkonen
bd51c6fd5f Fix #2670 2013-07-22 12:02:53 +03:00
resurtm
e258247330 Fixed incorrect HTTPS detection. 2013-05-31 09:41:35 +06:00
Ragazzo
7ce904c189 code style fix 2013-05-16 19:35:35 +04:00
Ragazzo
6217048bdb fixed content end 2013-05-16 19:13:42 +04:00
Alexander Makarov
e46fecc19a Added 206 header, code style fixes 2013-05-12 00:59:25 +04:00
Alexander Makarov
1c22d19d57 Merge branch 'http-request-range-enh' of git://github.com/Ragazzo/yii into Ragazzo-http-request-range-enh 2013-05-11 23:58:05 +04:00
Ragazzo
2864d97d49 range-requests added 2013-05-08 15:59:10 +04:00
Carsten Brandt
7d91ceb26d php doc adjustments after #2132 2013-03-27 23:46:00 +01:00
Rupert-RR
2ae1700233 Added unit test file for CHttpRequest for the methods
parseAcceptHeader() and compareAcceptTypes().
Modified the regexp in parseAcceptHeader() to accept wildcards in the
path.
Modified the description of compareAcceptTypes() to better reflect the
comparison result (higher preference returns lower value, so that most
preferred is first in the array).
2013-03-21 20:19:56 +04:00
Rupert-RR
ae6bc4a99a parseAcceptHeader() function description tidy up. 2013-03-21 14:56:03 +04:00
Rupert-RR
57befeead0 Typo corrections and code tidy up. 2013-03-21 14:47:23 +04:00
Rupert-RR
c255592623 Altered parseAcceptHeader() to use only one regexp.
Thanks to Ka on StackExchange for this expression.
2013-03-21 10:23:55 +04:00
Rupert-RR
1c0fb69add Typo corrections 2013-03-18 15:03:25 +04:00
Rupert-RR
e3897e85e2 Separated out parse and compare functions.
Reduced regular expression count to 2 from 3.
Modified MIME type array map structure.
2013-03-18 14:45:39 +04:00
Rupert-RR
a5b8240347 Merge remote-tracking branch 'upstream/master' into
2131-add-accept-header-parsing

Conflicts:
	CHANGELOG
2013-03-15 00:02:17 +04:00
Alexander Makarov
e37a9fe3e2 Refactored CHttpRequest::getDelete and CHttpRequest::getPut not to use _restParams directly 2013-03-06 02:08:13 +04:00
Rupert-RR
6a864f9890 Enh #2131: Added Accept header parsing to CHttpRequest to give an array
of accepted types in order of preference
2013-02-20 18:46:43 +04:00
Etienne Quiel
0324c5d2f7 fix: empty array were not handled 2013-01-22 11:00:04 +01:00
Etienne Quiel
7fd79cee09 using tabs for indentation 2013-01-22 10:48:46 +01:00
Etienne Quiel
2c6dbf21fc CHttpRequest::stripSlashes() changed to modify array keys as well 2013-01-22 10:43:04 +01:00
Abdul Malik Ikhsan
6247adaf26 change copyright symbol 2013-01-15 18:38:02 +07:00
Abdul Malik Ikhsan
46c8ef0d9a update copyright year
from 2011 to 2013
2013-01-15 17:28:17 +07:00
Carsten Brandt
a0c5171706 Merge pull request #1523 from Ragazzo/1279-CHttpRequest-another-fix
Small fix for CHttpRequest to send valid content-length and output
2012-11-28 11:46:41 -08:00
Alexander Makarov
db3e810440 Fixes #1756, Fixes #1673: CHttpRequest::getPreferredLanguage now works according to RFC2616. Added CHttpRequest::getPreferredLanguages that returns all user accepted languages in order of preference. 2012-11-27 23:02:39 +04:00
Alexander Makarov
41ea281f9b Fixed code style, comments and optimized a bit 2012-11-24 18:06:03 +04:00
Alexander Makarov
eb3a0d7898 Merge branch 'master' of git://github.com/Rupert-RR/yii into Rupert-RR-master 2012-11-24 17:45:10 +04:00
Rupert-RR
ac64837f7a Replaced the closure used for the usort with a create_function call
Yii should work under PHP5.1, and closures were only added by PHP5.3, so a create_function call is used instead to preserve compatibility.
2012-11-19 14:56:43 +04:00
Rupert-RR
040af99c39 Update framework/web/CHttpRequest.php
Updated the name of the private property used to store the list of accepted languages (no further need for a store for the preferred language since we just take the first value from this list).
2012-11-19 11:33:24 +04:00
Rupert-RR
6a72da8397 Update framework/web/CHttpRequest.php
Modified sorting logic to use more expensive, but accurate taking into account of each language's position in the header.
For a language that is present more than once, the highest q value will be used (or the highest position if q values are equal).
getPreferredLanguages() will now always return an array (empty if no / incorrect header is set).
2012-11-19 11:28:18 +04:00
Alexander Makarov
9ab8316b57 Fixes #1392: HostInfo was appended to CHttpRequest::redirect() location in case of using protocol relative URLs 2012-11-15 02:15:35 +04:00
Rupert-RR
1da2a6c31e Store parsing of Accept-Language header for public access and correct preferred language order
By convention, when multiple languages are given with the same preference value in the Accept-Language header then the order of preference should correspond to the order in which they are given.
Currently CHttpRequest does not define any preference according to order when sorting languages after having parsed them.
This update creates a new variable to allow access to the sorted list of preferred languages (useful for content negotiation), and adds a very small decremental value to each language when parsing, so that earlier languages are given priority over later ones in the sort rather than relying on PHP's arsort to arbitrarily sort equal values.
Test with an Accept-Language header of "ru, en, en-GB, zh-Hans, ja, zh-Hant, fr, de, nl, it, es" (ru should be the preferred language rather than de).
2012-11-08 17:35:19 +04:00
Carsten Brandt
e8990c6147 Added information on XSendFile bug to CHttpRequest
Problem happens with XSendFile together with SSl.
http://blogs.digitss.com/programming/internet-explorer-was-not-able-to-open-this-internet-site-the-requested-site-is-either-unavailable-or-cannot-be-found/
2012-10-31 15:46:52 +01:00
Ragazzo
b80f229d9e Merge branch 'master' of git://github.com/yiisoft/yii into 1279-CHttpRequest-another-fix 2012-10-11 01:59:22 +04:00
Alexander Makarov
9844c80ddf Fixes #259: CHttpRequest::getRestParams is now public 2012-10-10 21:20:30 +04:00
Ragazzo
73df240c7a Correct fix with #1249 2012-10-03 14:46:50 +04:00
Ragazzo
9b71569a96 Correct tab indent fix 2012-10-03 14:05:44 +04:00