mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-11-04 03:52:04 +00:00 
			
		
		
		
	@@ -14,6 +14,14 @@ import (
 | 
			
		||||
	"strings"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// CleanPath ensure to clean the path
 | 
			
		||||
func CleanPath(p string) string {
 | 
			
		||||
	if strings.HasPrefix(p, "/") {
 | 
			
		||||
		return path.Clean(p)
 | 
			
		||||
	}
 | 
			
		||||
	return path.Clean("/" + p)[1:]
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// EnsureAbsolutePath ensure that a path is absolute, making it
 | 
			
		||||
// relative to absoluteBase if necessary
 | 
			
		||||
func EnsureAbsolutePath(path, absoluteBase string) string {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user