Defect #31831

Back url parse in validation

Added by Tibinko H 4 months ago. Updated 4 months ago.

Status:NewStart date:
Priority:NormalDue date:
Assignee:-% Done:

0%

Category:-
Target version:Candidate for next minor release
Resolution: Affected version:4.0.4

Description

Hello,

for example on issues screen, when you apply filters, it generates an url containing:

utf8=✓

Because of this bulk_edit (for instance) is unable to redirect back to this url.
The reason is a function in application_controller.rb - validate_back_url

URI.parse(back_url) is unable to parse the special character mentioned above.

The quicke workaround would be

URI.parse(URI.encode(back_url))

but i am not sure that is sufficient.


Related issues

Related to Redmine - Defect #31552: View switches from gantt to list after editing an issue Closed

History

#1 Updated by Mizuki ISHIKAWA 4 months ago

It looks good.
I have also suggested the same fix (#31552#note-2).

#2 Updated by Tibinko H 4 months ago

Oh, ok. Did not see that, I am going to put this isssue to resolved then.

#3 Updated by Tibinko H 4 months ago

  • Status changed from New to Resolved

#4 Updated by Marius BALTEANU 4 months ago

  • Status changed from Resolved to New

Tibinko H wrote:

Oh, ok. Did not see that, I am going to put this isssue to resolved then.

It was committed another solution in that ticket.

#5 Updated by Tibinko H 4 months ago

Marius BALTEANU wrote:

Tibinko H wrote:

Oh, ok. Did not see that, I am going to put this isssue to resolved then.

It was committed another solution in that ticket.

Is it not exactly the same as I wrote above?

#6 Updated by Mizuki ISHIKAWA 4 months ago

Tibinko H wrote:

Oh, ok. Did not see that, I am going to put this isssue to resolved then.

I think this problem has not been solved yet.

Sorry, my comment(#31831#note-1) may have misled you.
In #31552 issue, #31552#note-3 changes were finally committed, not #31552#note-2 changes.
#31552#note-3 changes were a partial fix and does not solve the bulk_edit probrem.

URI.parse(URI.encode(back_url))

I thought that your suggestion for solving the problem that occurs with bulk_edit is good.

#7 Updated by Go MAEDA 4 months ago

  • Target version set to Candidate for next minor release

Tibinko H, thank you for reporting this issue.

Here is a diff of your workaround.

diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 06e2d702c..afbb30f3e 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -440,7 +440,7 @@ class ApplicationController < ActionController::Base
     end

     begin
-      uri = URI.parse(back_url)
+      uri = URI.parse(URI.encode(back_url))
     rescue URI::InvalidURIError
       return false
     end

#8 Updated by Go MAEDA 4 months ago

  • Related to Defect #31552: View switches from gantt to list after editing an issue added

Also available in: Atom PDF