gitea/routers/repo
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
..
activity.go
attachment.go
branch.go
commit.go
download.go Allow markdown files to read from the LFS (#5787) 2019-02-12 15:09:43 +00:00
editor.go Refactor editor upload, update and delete to use git plumbing and add LFS support (#5702) 2019-02-12 15:07:31 +02:00
editor_test.go Refactor editor upload, update and delete to use git plumbing and add LFS support (#5702) 2019-02-12 15:07:31 +02:00
http.go In basic auth check for tokens before call UserSignIn (#5725) 2019-02-12 11:20:08 +02:00
issue.go refactor issue indexer, add some testing and fix a bug (#6131) 2019-02-21 08:54:05 +08:00
issue_dependency.go
issue_label.go Allow labels to contain emoji (#6063) 2019-02-16 19:33:09 +02:00
issue_label_test.go
issue_lock.go Implement "conversation lock" for issue comments (#5073) 2019-02-18 22:55:04 +02:00
issue_stopwatch.go Automatically clear stopwatch on merging a PR (#4327) 2019-02-05 13:38:11 +02:00
issue_timetrack.go
issue_watch.go
main_test.go
middlewares.go
milestone.go Add same changes from issues page to milestone->issues page (#6328) 2019-03-15 11:50:27 -04:00
pull.go Clean up various use of escape/unescape functions for URL generation (#6334) 2019-03-18 10:00:23 -04:00
pull_review.go
release.go
release_test.go
repo.go fix bug when migrate repository 500 when repo is existed (#6188) 2019-02-26 09:28:56 -05:00
search.go
setting.go Create a repo redirect when transferring ownership (#6210) (#6211) 2019-02-28 11:51:46 +08:00
setting_protected_branch.go
settings_test.go
topic.go
view.go update git vendor to fix wrong release commit id and add migrations (#6224) 2019-03-11 11:44:58 +08:00
webhook.go
wiki.go Fix serving of raw wiki files other than .md (#5814) 2019-02-05 20:58:55 -05:00
wiki_test.go Fix serving of raw wiki files other than .md (#5814) 2019-02-05 20:58:55 -05:00