gitea/models
mrsdizzie ca46385637 Clean up various use of escape/unescape functions for URL generation (#6334)
* Use PathUnescape instead of QueryUnescape when working with branch names

Currently branch names with a '+' fail in certain situations because
QueryUnescape replaces the + character with a blank space.

Using PathUnescape should be better since it is defined as:

// PathUnescape is identical to QueryUnescape except that it does not
// unescape '+' to ' ' (space).

Fixes #6333

* Change error to match new function name

* Add new util function PathEscapeSegments

This function simply runs PathEscape on each segment of a path without
touching the forward slash itself. We want to use this instead of
PathEscape/QueryEscape in most cases because a forward slash is a valid name for a
branch etc... and we don't want that escaped in a URL.

Putting this in new file url.go and also moving a couple similar
functions into that file as well.

* Use EscapePathSegments where appropriate

Replace various uses of EscapePath/EscapeQuery with new
EscapePathSegments. Also remove uncessary uses of various
escape/unescape functions when the text had already been escaped or was
not escaped.

* Reformat comment to make drone build happy

* Remove no longer used url library

* Requested code changes
2019-03-18 10:00:23 -04:00
..
fixtures
migrations update git vendor to fix wrong release commit id and add migrations (#6224) 2019-03-11 11:44:58 +08:00
access_test.go
access.go
action_list.go
action_test.go
action.go
admin_test.go
admin.go
attachment_test.go
attachment.go
branches_test.go
branches.go
consistency.go
error_oauth2.go
error.go
external_login_user.go
git_diff_test.go Fix ParsePatch function to work with quoted diff --git strings (#6323) 2019-03-14 18:09:53 +02:00
git_diff.go Fix ParsePatch function to work with quoted diff --git strings (#6323) 2019-03-14 18:09:53 +02:00
gpg_key_test.go
gpg_key.go
graph_test.go
graph.go
helper.go
issue_assignees_test.go
issue_assignees.go
issue_comment_list.go Improve performance of dashboard (#4977) 2018-12-13 10:55:43 -05:00
issue_comment_test.go
issue_comment.go
issue_dependency_test.go
issue_dependency.go
issue_label_test.go
issue_label.go
issue_list_test.go
issue_list.go Refactor issue indexer (#5363) 2019-02-19 09:39:39 -05:00
issue_lock.go Implement "conversation lock" for issue comments (#5073) 2019-02-18 22:55:04 +02:00
issue_mail.go
issue_milestone_test.go
issue_milestone.go
issue_reaction_test.go
issue_reaction.go
issue_stopwatch_test.go
issue_stopwatch.go
issue_test.go
issue_tracked_time_test.go
issue_tracked_time.go
issue_user_test.go
issue_user.go
issue_watch_test.go
issue_watch.go
issue.go
lfs_lock.go
lfs.go
login_source.go
mail.go
main_test.go
models_sqlite.go
models_test.go
models.go
notification_test.go
notification.go
oauth2_application_test.go
oauth2_application.go
oauth2.go
org_team_test.go
org_team.go
org_test.go
org.go
pull_test.go
pull.go
release_test.go
release.go
repo_activity.go Add issue closed time column to fix activity closed issues list (#3537) 2018-02-19 10:39:26 +08:00
repo_branch.go update git vendor to fix wrong release commit id and add migrations (#6224) 2019-03-11 11:44:58 +08:00
repo_collaboration_test.go
repo_collaboration.go
repo_indexer.go
repo_issue.go
repo_list_test.go
repo_list.go
repo_mirror.go
repo_permission_test.go
repo_permission.go fix bug when update owner team then visit team's repo return 404 (#6119) 2019-02-22 11:14:45 -05:00
repo_redirect_test.go
repo_redirect.go
repo_tag.go
repo_test.go
repo_unit.go
repo_watch_test.go
repo_watch.go
repo.go Clean up various use of escape/unescape functions for URL generation (#6334) 2019-03-18 10:00:23 -04:00
review_test.go Show review summary in pull requests (#5132) 2018-11-22 15:17:36 +02:00
review.go
ssh_key_test.go
ssh_key.go
star_test.go
star.go
status_test.go
status.go
test_fixtures.go
token_test.go
token.go
topic_test.go
topic.go
twofactor.go
u2f_test.go
u2f.go
unit_tests.go
unit.go
update_test.go
update.go
upload.go
user_follow_test.go
user_follow.go
user_heatmap_test.go
user_heatmap.go
user_mail_test.go
user_mail.go
user_openid_test.go
user_openid.go
user_test.go
user.go
webhook_dingtalk.go
webhook_discord.go
webhook_slack.go
webhook_test.go
webhook.go
wiki_test.go
wiki.go