1
0
mirror of https://github.com/meineerde/redmine.git synced 2026-01-31 19:47:14 +00:00

Stop appending the utf8 checkmark parameter to form URLs (#40190).

Patch by Go MAEDA (@maeda).

git-svn-id: https://svn.redmine.org/redmine/trunk@22709 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Marius Balteanu 2024-02-13 23:13:49 +00:00
parent 9155b777e6
commit 353ac52d47
3 changed files with 3 additions and 32 deletions

View File

@ -475,11 +475,6 @@ class ApplicationController < ActionController::Base
url = params[:back_url]
if url.nil? && referer = request.env['HTTP_REFERER']
url = CGI.unescape(referer.to_s)
# URLs that contains the utf8=[checkmark] parameter added by Rails are
# parsed as invalid by URI.parse so the redirect to the back URL would
# not be accepted (ApplicationController#validate_back_url would return
# false)
url.gsub!(/(\?|&)utf8=\u2713&?/, '\1')
end
url
end

View File

@ -45,6 +45,9 @@ module RedmineApp
config.action_mailer.delivery_job = "ActionMailer::MailDeliveryJob"
# Stop appending "utf8=✓" to form URLs
config.action_view.default_enforce_utf8 = false
# Set Time.zone default to the specified zone and make Active Record auto-convert to this zone.
# Run "rake -D time" for a list of tasks for finding time zone names. Default is UTC.
# config.time_zone = 'Central Time (US & Canada)'

View File

@ -1,27 +0,0 @@
# frozen_string_literal: true
# Redmine - project management software
# Copyright (C) 2006-2023 Jean-Philippe Lang
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
require_relative '../test_helper'
class ApplicationControllerTest < Redmine::ControllerTest
def test_back_url_should_remove_utf8_checkmark_from_referer
@request.set_header 'HTTP_REFERER', "/path?utf8=\u2713&foo=bar"
assert_equal "/path?foo=bar", @controller.back_url
end
end