Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yii2
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PSDI Army
yii2
Commits
109c4b44
Commit
109c4b44
authored
Jun 25, 2014
by
Carsten Brandt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
attempt to fix multiple header issue
fixes #3893
parent
48f6e380
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
2 deletions
+6
-2
CHANGELOG.md
framework/CHANGELOG.md
+1
-0
HeaderCollection.php
framework/web/HeaderCollection.php
+1
-0
Response.php
framework/web/Response.php
+4
-2
No files found.
framework/CHANGELOG.md
View file @
109c4b44
...
@@ -50,6 +50,7 @@ Yii Framework 2 Change Log
...
@@ -50,6 +50,7 @@ Yii Framework 2 Change Log
-
Bug #3817:
`yii\rbac\PhpManager::getChildren()`
returns null instead of expected empty array (qiangxue)
-
Bug #3817:
`yii\rbac\PhpManager::getChildren()`
returns null instead of expected empty array (qiangxue)
-
Bug #3843: Fixed Menu bug when using
`template`
with
`encodeLabel`
=> false (creocoder, umneeq)
-
Bug #3843: Fixed Menu bug when using
`template`
with
`encodeLabel`
=> false (creocoder, umneeq)
-
Bug #3863: Fixed incorrect js selector for
`\yii\widgets\ActiveForm::errorSummaryCssClass`
when it contains multiple classes (creocoder, umneeq)
-
Bug #3863: Fixed incorrect js selector for
`\yii\widgets\ActiveForm::errorSummaryCssClass`
when it contains multiple classes (creocoder, umneeq)
-
Bug #3893: Headers did not overwrite default setting by webserver (cebe)
-
Bug #3909:
`Html::to()`
should not prefix base URL to URLs that already contain scheme (qiangxue)
-
Bug #3909:
`Html::to()`
should not prefix base URL to URLs that already contain scheme (qiangxue)
-
Bug #3934: yii.handleAction() in yii.js does not correctly detect if a hyperlink contains useful URL or not (joni-jones, qiangxue)
-
Bug #3934: yii.handleAction() in yii.js does not correctly detect if a hyperlink contains useful URL or not (joni-jones, qiangxue)
-
Bug #3968: Messages logged in shutdown functions are not handled (qiangxue)
-
Bug #3968: Messages logged in shutdown functions are not handled (qiangxue)
...
...
framework/web/HeaderCollection.php
View file @
109c4b44
...
@@ -28,6 +28,7 @@ class HeaderCollection extends Object implements \IteratorAggregate, \ArrayAcces
...
@@ -28,6 +28,7 @@ class HeaderCollection extends Object implements \IteratorAggregate, \ArrayAcces
*/
*/
private
$_headers
=
[];
private
$_headers
=
[];
/**
/**
* Returns an iterator for traversing the headers in the collection.
* Returns an iterator for traversing the headers in the collection.
* This method is required by the SPL interface `IteratorAggregate`.
* This method is required by the SPL interface `IteratorAggregate`.
...
...
framework/web/Response.php
View file @
109c4b44
...
@@ -296,7 +296,6 @@ class Response extends \yii\base\Response
...
@@ -296,7 +296,6 @@ class Response extends \yii\base\Response
if
(
$this
->
_headers
===
null
)
{
if
(
$this
->
_headers
===
null
)
{
$this
->
_headers
=
new
HeaderCollection
;
$this
->
_headers
=
new
HeaderCollection
;
}
}
return
$this
->
_headers
;
return
$this
->
_headers
;
}
}
...
@@ -346,8 +345,11 @@ class Response extends \yii\base\Response
...
@@ -346,8 +345,11 @@ class Response extends \yii\base\Response
$headers
=
$this
->
getHeaders
();
$headers
=
$this
->
getHeaders
();
foreach
(
$headers
as
$name
=>
$values
)
{
foreach
(
$headers
as
$name
=>
$values
)
{
$name
=
str_replace
(
' '
,
'-'
,
ucwords
(
str_replace
(
'-'
,
' '
,
$name
)));
$name
=
str_replace
(
' '
,
'-'
,
ucwords
(
str_replace
(
'-'
,
' '
,
$name
)));
// set replace for first occurance of header but false afterwards to allow multiple
$replace
=
true
;
foreach
(
$values
as
$value
)
{
foreach
(
$values
as
$value
)
{
header
(
"
$name
:
$value
"
,
false
);
header
(
"
$name
:
$value
"
,
$replace
);
$replace
=
false
;
}
}
}
}
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment