Skip to content

Commit

Permalink
Merge remote-tracking branch 'klimov-paul/126-CWebUser-incorrectly-de…
Browse files Browse the repository at this point in the history
…termines-returnUrl'

Conflicts:
	CHANGELOG
  • Loading branch information
samdark committed Sep 8, 2012
2 parents 3604558 + 0d47eef commit ed1f770
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ Version 1.1.13 work in progress
- Bug #110: MSSQL: fixed empty $primaryKey value after saving CActiveRecord model (resurtm)
- Bug #112: MSSQL: database abstraction layer now uses native transaction support of the SQLSRV driver (resurtm)
- Bug #124: Added CMysqlCommandBuilder to handle JOIN directive on update commands correctly (cebe, DaSourcerer)
- Bug #126: Fixed CWebUser::getReturnUrl(), allowing to determine default URL correctly, if CUrlManager::showScriptName is set to false (klimov-paul)
- Bug #962: Fixed handling of negative timestamps in CDateFormatter::format() (johnmendonca)
- Bug #1249: CHttpRequest::sendFile() outputs malformed file content in some specific circumstances (andyhu)
- Bug #1330: SQLite column default value was incorrect for column of type string and DEFAULT NULL (cebe)
Expand Down
10 changes: 9 additions & 1 deletion framework/web/auth/CWebUser.php
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,15 @@ public function setName($value)
*/
public function getReturnUrl($defaultUrl=null)
{
return $this->getState('__returnUrl', $defaultUrl===null ? Yii::app()->getRequest()->getScriptUrl() : CHtml::normalizeUrl($defaultUrl));
if($defaultUrl===null)
{
$defaultReturnUrl=Yii::app()->getUrlManager()->showScriptName ? Yii::app()->getRequest()->getScriptUrl() : Yii::app()->getRequest()->getBaseUrl().'/';
}
else
{
$defaultReturnUrl=CHtml::normalizeUrl($defaultUrl);
}
return $this->getState('__returnUrl',$defaultReturnUrl);
}

/**
Expand Down

0 comments on commit ed1f770

Please sign in to comment.