Skip to content

Link is not being escaped, breaking the github search querry #172

@FFY00

Description

@FFY00

<%= link_to "https://github.com/search?q=user:#{@user.login}+language:#{user_rank.language}", target: '_blank' do %>

Here, the link is not being escaped. This breaks the github search query for some languages like C#. I'm not a rails developer but as far as I know, this should be escaped by default.

Reproduce
Go to http://git-awards.com/users/ffy00 and click in Repos on the C# section.
This will open https://github.com/search?q=user:ffy00+language:c# which shows the C repositories, not C#. The # is being used as html id identifier, not as a part of the string.
If you change the link to https://github.com/search?q=user:ffy00+language:c%23, it works.

Note
You can also use the l param (ex. &l=c%23) to specify the language.

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