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
Ragazzo
a4513533e0
Some bug fixes
2012-10-03 14:01:08 +04:00
Ragazzo
8a34239cc2
Small fix for CHttpRequest to send valid content-length and output, from issue #1279 and #1249
2012-10-03 13:33:19 +04:00
Alexander Kochetov
486723805e
else if => elseif
2012-10-03 10:20:14 +04:00
Alexander Makarov
60154d50de
Refactored CHttpRequest a bit
2012-09-25 02:11:51 +04:00
Alexander Makarov
c8aa982dff
Fixes #1443 : Added CHttpRequest::getRawBody() that allows reading RAW HTTP request body multiple times
2012-09-25 01:53:41 +04:00
Alexander Makarov
d865a3bab8
Fixes #1057 Removed SVN ids
2012-09-09 22:23:45 +04:00
Alexander Makarov
568a2158b4
Fixes #861 : changed CHttpRequest::redirect docs to match code
2012-09-09 21:39:58 +04:00
Alexander Makarov
50ac7d68f8
Fixes #1299 Added CSRF token validation for PUT and DELETE
2012-09-08 14:52:31 +04:00
Carsten Brandt
87e93f1edf
Merge pull request #1250 from andyhu/patch-1
...
Update framework/web/CHttpRequest.php
2012-09-03 13:36:49 -07:00
Carsten Brandt
ccd32774d2
enhanced doc in CHttpRequest to allow autocomplete $cookie
...
fixes #862
2012-09-03 21:41:44 +02:00
Mikhail Osher
f270eb763e
Spaces to Tabs
2012-08-31 13:59:51 +04:00
Mikhail Osher
6e5f42adc7
CHttpRequest check token on PUT/DELETE requests too.
2012-08-28 15:47:48 +04:00
andyhu
d9dde75fb8
Update framework/web/CHttpRequest.php
...
See issue https://github.com/yiisoft/yii/issues/1249
2012-08-18 21:45:29 +08:00
Suralc
40f813763a
Revert CCookieCollection::add().
2012-08-01 18:21:29 +02:00
speedlog
59f92b567a
Correct misspell #950
2012-07-11 10:25:47 +02:00
Alexander Makarov
e9c5d981d9
Fixes #772 : CHttpRequest::getIsSecureConnection() was failing on some conditions
2012-07-02 01:11:36 +04:00
Qiang Xue
c927e033c8
fixed typo
2012-06-30 22:17:13 -04:00
Maxim Chernyshev
18f6279a8a
Made CCookieCollection::removeCookie() use empty string and expanded the docs for CCookieCollection::remove()
2012-06-26 19:47:11 +08:00
Maxim Chernyshev
abd5b56a69
Added cookie options parameter so that cookies can be removed using the parameters they were set with
2012-05-10 08:14:24 +08:00
mdomba (mdlap)
d3b0bc0d93
Merge branch 'fix120-set-cookie-name-only-once-bc' of https://github.com/suralc/yii into suralc-fix120-set-cookie-name-only-once-bc
...
Conflicts:
CHANGELOG
2012-05-02 17:22:18 +02:00
resurtm
bb19be375e
Proper handling Flash/Flex request when using FireBug WebLogRoute.
2012-02-17 10:17:15 +06:00
Qiang Xue
a1ccd4222f
Merge pull request #338 from musterknabe/master
...
Fixed typo in CHttpRequest
2012-02-16 08:02:06 -08:00