mirror of
https://github.com/gitbucket/gitbucket.git
synced 2025-11-07 14:05:52 +01:00
Use StringUtil#urlEncode() instead of URLEncode#encode().
This commit is contained in:
@@ -6,6 +6,7 @@ import scala.slick.jdbc.{StaticQuery => Q}
|
||||
import Q.interpolation
|
||||
|
||||
import model._
|
||||
import util.StringUtil._
|
||||
import util.Implicits._
|
||||
|
||||
trait IssuesService {
|
||||
@@ -236,7 +237,6 @@ trait IssuesService {
|
||||
}
|
||||
|
||||
object IssuesService {
|
||||
import java.net.URLEncoder
|
||||
import javax.servlet.http.HttpServletRequest
|
||||
|
||||
val IssueLimit = 30
|
||||
@@ -248,8 +248,6 @@ object IssuesService {
|
||||
sort: String = "created",
|
||||
direction: String = "desc"){
|
||||
|
||||
import IssueSearchCondition._
|
||||
|
||||
def toURL: String =
|
||||
"?" + List(
|
||||
if(labels.isEmpty) None else Some("labels=" + urlEncode(labels.mkString(" "))),
|
||||
@@ -265,8 +263,6 @@ object IssuesService {
|
||||
|
||||
object IssueSearchCondition {
|
||||
|
||||
private def urlEncode(value: String): String = URLEncoder.encode(value, "UTF-8")
|
||||
|
||||
private def param(request: HttpServletRequest, name: String, allow: Seq[String] = Nil): Option[String] = {
|
||||
val value = request.getParameter(name)
|
||||
if(value == null || value.isEmpty || (allow.nonEmpty && !allow.contains(value))) None else Some(value)
|
||||
|
||||
Reference in New Issue
Block a user