1
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-10-15 06:04:32 -04:00
gitea/modules
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
..
auth Integrate OAuth2 Provider (#5378) 2019-03-08 11:42:50 -05:00
avatar
base
cache
context Clean up various use of escape/unescape functions for URL generation (#6334) 2019-03-18 10:00:23 -04:00
cron
generate Integrate OAuth2 Provider (#5378) 2019-03-08 11:42:50 -05:00
gzip Pooled and buffered gzip implementation (#5722) 2019-01-23 10:56:51 +02:00
highlight
httplib
indexer fix bug when set indexer as db and add tests (#6173) 2019-02-24 11:16:20 -05:00
lfs Allow markdown files to read from the LFS (#5787) 2019-02-12 15:09:43 +00:00
log Allow Macaron to be set to log through to gitea.log (#5667) 2019-02-05 22:06:41 -05:00
mailer Make log mailer for testing (#5893) 2019-02-02 21:06:52 -05:00
markup Fix reported issue in repo description (#6306) 2019-03-11 22:23:34 -04:00
metrics
minwinsvc
notification refactor issue indexer, add some testing and fix a bug (#6131) 2019-02-21 08:54:05 +08:00
options
pprof
private Clean up various use of escape/unescape functions for URL generation (#6334) 2019-03-18 10:00:23 -04:00
process
public
recaptcha
search
secret Integrate OAuth2 Provider (#5378) 2019-03-08 11:42:50 -05:00
setting split setting.go to multiple files (#6154) 2019-03-16 11:12:44 +08:00
ssh use native golang SSH library but ssh-keygen when enable built-in SSH server to remove dependent on that command lines (#5976) 2019-02-07 02:13:12 -05:00
structs Allow to set organization visibility (public, internal, private) (#1763) 2019-02-18 18:00:27 +02:00
sync
templates
test
uploader Refactor editor upload, update and delete to use git plumbing and add LFS support (#5702) 2019-02-12 15:07:31 +02:00
user
util Clean up various use of escape/unescape functions for URL generation (#6334) 2019-03-18 10:00:23 -04:00
validation