Merge pull request #11356 from owncloud/redirect-only-to-the-same-domain

Redirect only to absolute URL
This commit is contained in:
Lukas Reschke 2014-10-01 12:47:43 +02:00
commit e762ff2bbd
1 changed files with 4 additions and 2 deletions

View File

@ -847,8 +847,10 @@ class OC_Util {
*/
public static function getDefaultPageUrl() {
$urlGenerator = \OC::$server->getURLGenerator();
if (isset($_REQUEST['redirect_url'])) {
$location = urldecode($_REQUEST['redirect_url']);
// Deny the redirect if the URL contains a @
// This prevents unvalidated redirects like ?redirect_url=:user@domain.com
if (isset($_REQUEST['redirect_url']) && strpos($_REQUEST['redirect_url'], '@') === false) {
$location = $urlGenerator->getAbsoluteURL(urldecode($_REQUEST['redirect_url']));
} else {
$defaultPage = OC_Appconfig::getValue('core', 'defaultpage');
if ($defaultPage) {