Browse Source

allow resetting autodetected properties in yii\web\Request

fixes #11336
tags/2.0.8
Carsten Brandt 9 years ago
parent
commit
1f0e24c528
  1. 1
      framework/CHANGELOG.md
  2. 6
      framework/web/Request.php

1
framework/CHANGELOG.md

@ -195,6 +195,7 @@ Yii Framework 2 Change Log
- Enh #10545: `yii\web\XMLResponseFormatter` changed to format models in a proper way (andrewnester)
- Enh #10783: Added migration and unit-tests for `yii\i18n\DbMessageSource` (silverfire)
- Enh #10797: Cleaned up requirements checker CSS (muhammadcahya)
- Enh #11336: Allow resettting `$hostInfo`, `$scriptUrl`, and `$pathInfo` in `yii\web\Request` to `null`, to make Yii determine the value again (cebe)
- Enh: Added last resort measure for `FileHelper::removeDirectory()` fail to unlink symlinks under Windows (samdark)
- Enh: `AttributeBehavior::getValue()` now respects the callable in array format (silverfire)
- Chg #6419: Added `yii\web\ErrorHandler::displayVars` make list of displayed vars customizable. `$_ENV` and `$_SERVER` are not displayed by default anymore (silverfire)

6
framework/web/Request.php

@ -557,7 +557,7 @@ class Request extends \yii\base\Request
*/
public function setHostInfo($value)
{
$this->_hostInfo = rtrim($value, '/');
$this->_hostInfo = $value === null ? null : rtrim($value, '/');
}
private $_baseUrl;
@ -628,7 +628,7 @@ class Request extends \yii\base\Request
*/
public function setScriptUrl($value)
{
$this->_scriptUrl = '/' . trim($value, '/');
$this->_scriptUrl = $value === null ? null : '/' . trim($value, '/');
}
private $_scriptFile;
@ -688,7 +688,7 @@ class Request extends \yii\base\Request
*/
public function setPathInfo($value)
{
$this->_pathInfo = ltrim($value, '/');
$this->_pathInfo = $value === null ? null : ltrim($value, '/');
}
/**

Loading…
Cancel
Save