Skip to content

Unicode characters incorrectly filled into the search bar on 404 pages #1097

@CelDaemon

Description

@CelDaemon

What happened?

When following a link that is no longer valid, a 404 page appears containing a search bar.
This search bar has relevant keywords from the URL pre-filled, however this behaviour is handled incorrectly when the URL contains characters that are represented with URI escape sequences.

In these cases, the keywords are directly filled into the search bar without first being decoded from the escape sequences.

The issue can be easily reproduced by going to a URL such as: http://{host}:{port}/α

Hugo version

0.126.2

Theme version

3.29.0

What browsers are you seeing the problem on?

Firefox

More information about the browser

Firefox 132.0.1, Fedora 41

Relevant log output

Start building sites … 
hugo v0.126.2+extended linux/amd64 BuildDate=2024-07-18T00:00:00+00:00 VendorInfo=Fedora:0.126.2-3.fc41


                   | EN  
-------------------+-----
  Pages            | 37  
  Paginator pages  |  0  
  Non-page files   |  4  
  Static files     |  1  
  Processed images | 14  
  Aliases          | 13  
  Cleaned          |  0  

Total in 68 ms

Link to Minimal Reproducible Example

https://github.com/CelDaemon/unicode-404-repro

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions