private function generateRedirect(?string $redirectUrl): RedirectResponse {
if ($redirectUrl !== null && $this->userSession->isLoggedIn()) {
- $location = $this->urlGenerator->getAbsoluteURL(urldecode($redirectUrl));
+ $location = $this->urlGenerator->getAbsoluteURL($redirectUrl);
// Deny the redirect if the URL contains a @
// This prevents unvalidated redirects like ?redirect_url=:user@domain.com
if (strpos($location, '@') === false) {
->method('getUID')
->will($this->returnValue('jane'));
$password = 'secret';
- $originalUrl = 'another%20url';
+ $originalUrl = 'another url';
$redirectUrl = 'http://localhost/another url';
$this->request
$this->request,
$user,
$password,
- '%2Fapps%2Fmail'
+ '/apps/mail'
);
$loginResult = LoginResult::success($loginData);
$this->chain->expects($this->once())
->will($this->returnValue($redirectUrl));
$expected = new \OCP\AppFramework\Http\RedirectResponse($redirectUrl);
- $response = $this->loginController->tryLogin($user, $password, '%2Fapps%2Fmail');
+ $response = $this->loginController->tryLogin($user, $password, '/apps/mail');
$this->assertEquals($expected, $response);
}