Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
O
OHR Support
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
97
Issues
97
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
image/svg+xml
Discourse
Discourse
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Projects
OHR Support
Commits
92dd2934
Commit
92dd2934
authored
Oct 29, 2011
by
Felix Schäfer
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request
#106
from finnlabs/pulls/652/fixes_redirect_containing_umlaute
[#652] fixes wrong redirect after login
parents
3cc95353
34dc06a8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
1 deletion
+10
-1
application_controller.rb
app/controllers/application_controller.rb
+1
-1
account_test.rb
test/integration/account_test.rb
+9
-0
No files found.
app/controllers/application_controller.rb
View file @
92dd2934
...
...
@@ -262,7 +262,7 @@ class ApplicationController < ActionController::Base
end
def
redirect_back_or_default
(
default
)
back_url
=
CGI
.
unescape
(
params
[
:back_url
].
to_s
)
back_url
=
URI
.
escape
(
CGI
.
unescape
(
params
[
:back_url
].
to_s
)
)
if
!
back_url
.
blank?
begin
uri
=
URI
.
parse
(
back_url
)
...
...
test/integration/account_test.rb
View file @
92dd2934
...
...
@@ -32,6 +32,15 @@ class AccountTest < ActionController::IntegrationTest
assert_template
"my/account"
end
def
test_redirect_after_login
target_url
=
"/my/account?q=%C3%A4"
get
target_url
post
"/login"
,
:username
=>
'jsmith'
,
:password
=>
'jsmith'
,
:back_url
=>
@response
.
redirected_to
[
:back_url
]
assert_redirected_to
target_url
end
def
test_autologin
user
=
User
.
find
(
1
)
Setting
.
autologin
=
"7"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment