diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 610a51108..585a1faac 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -24,7 +24,6 @@ Changelog * Fix: Remove duplicate border radius of avatars (Benjamin Thurm) * Fix: Site.get_site_root_paths() preferring other sites over the default when some sites share the same root_page (Andy Babic) * Fix: Pages with missing model definitions no longer crash the API (Abdulmalik Abdulwahab) - * Fix: Strip null characters from paths when checking for redirects (Andrew Crewdson) * Fix: Rich text image chooser no longer skips format selection after a validation error (Matt Westcott) diff --git a/CONTRIBUTORS.rst b/CONTRIBUTORS.rst index b74524f73..1fd837aa3 100644 --- a/CONTRIBUTORS.rst +++ b/CONTRIBUTORS.rst @@ -308,7 +308,6 @@ Contributors * Daniele Procida * Catherine Farman * Abdulmalik Abdulwahab -* Andrew Crewdson * Aram Dulyan Translators diff --git a/docs/releases/2.2.rst b/docs/releases/2.2.rst index 1c2eb3a09..5a3c3f0f5 100644 --- a/docs/releases/2.2.rst +++ b/docs/releases/2.2.rst @@ -37,7 +37,6 @@ Bug fixes * Remove duplicate border radius of avatars (Benjamin Thurm) * Site.get_site_root_paths() preferring other sites over the default when some sites share the same root_page (Andy Babic) * Pages with missing model definitions no longer crash the API (Abdulmalik Abdulwahab) - * Strip null characters from paths when checking for redirects (Andrew Crewdson) * Rich text image chooser no longer skips format selection after a validation error (Matt Westcott) Upgrade considerations diff --git a/wagtail/contrib/redirects/models.py b/wagtail/contrib/redirects/models.py index b9e8152c8..6897d144d 100644 --- a/wagtail/contrib/redirects/models.py +++ b/wagtail/contrib/redirects/models.py @@ -71,12 +71,8 @@ class Redirect(models.Model): parameters_components = parameters.split(';') parameters = ';'.join(sorted(parameters_components)) - query_string = url_parsed[4] - - # Strip Unicode NULLs (U+0000) for safety and Postgres compatibility - query_string = query_string.replace('%00', '') - # Query string components must be sorted alphabetically + query_string = url_parsed[4] query_string_components = query_string.split('&') query_string = '&'.join(sorted(query_string_components)) diff --git a/wagtail/contrib/redirects/tests.py b/wagtail/contrib/redirects/tests.py index b19f5b638..4e9140a1e 100644 --- a/wagtail/contrib/redirects/tests.py +++ b/wagtail/contrib/redirects/tests.py @@ -78,8 +78,6 @@ class TestRedirects(TestCase): self.assertEqual('/', normalise_path('/')) # '/' should stay '/' - self.assertEqual('/foo?bar=baz', normalise_path('/foo?bar=baz%00')) # Strip NULLs - # Normalise some rubbish to make sure it doesn't crash normalise_path('This is not a URL') normalise_path('//////hello/world')