Browse Source

Merge pull request #2681 from dizews/buildin-phpserver-fix

fix bug of php buildin webserver https://bugs.php.net/bug.php?id=66606
tags/2.0.0-beta
Alexander Makarov 11 years ago
parent
commit
d4e0bb748c
  1. 1
      framework/CHANGELOG.md
  2. 7
      framework/web/Request.php

1
framework/CHANGELOG.md

@ -53,6 +53,7 @@ Yii Framework 2 Change Log
- Bug #2607: `yii message` tool wasn't updating `message` table (mitalcoi) - Bug #2607: `yii message` tool wasn't updating `message` table (mitalcoi)
- Bug #2624: Html::textArea() should respect "name" option. (qiangxue) - Bug #2624: Html::textArea() should respect "name" option. (qiangxue)
- Bug #2653: Fixed the bug that unsetting an unpopulated AR relation would trigger exception (qiangxue) - Bug #2653: Fixed the bug that unsetting an unpopulated AR relation would trigger exception (qiangxue)
- Bug #2681: Fixed the bug of php build-in server https://bugs.php.net/bug.php?id=66606 (dizews)
- Bug: Fixed `Call to a member function registerAssetFiles() on a non-object` in case of wrong `sourcePath` for an asset bundle (samdark) - Bug: Fixed `Call to a member function registerAssetFiles() on a non-object` in case of wrong `sourcePath` for an asset bundle (samdark)
- Bug: Fixed incorrect event name for `yii\jui\Spinner` (samdark) - Bug: Fixed incorrect event name for `yii\jui\Spinner` (samdark)
- Bug: Json::encode() did not handle objects that implement JsonSerializable interface correctly (cebe) - Bug: Json::encode() did not handle objects that implement JsonSerializable interface correctly (cebe)

7
framework/web/Request.php

@ -956,7 +956,12 @@ class Request extends \yii\base\Request
*/ */
public function getContentType() public function getContentType()
{ {
return isset($_SERVER["CONTENT_TYPE"]) ? $_SERVER["CONTENT_TYPE"] : null; if (isset($_SERVER["CONTENT_TYPE"])) {
return $_SERVER["CONTENT_TYPE"];
} elseif (isset($_SERVER["HTTP_CONTENT_TYPE"])) { //fix bug https://bugs.php.net/bug.php?id=66606
return $_SERVER["HTTP_CONTENT_TYPE"];
}
return null;
} }
private $_languages; private $_languages;

Loading…
Cancel
Save