replace == "" with .blank?
This commit is contained in:
parent
8ce08f0b79
commit
1cc00624fe
|
@ -19,7 +19,7 @@ CrystalGauntlet.endpoints["/uploadGJComment21.php"] = ->(context : HTTP::Server:
|
|||
return "-1"
|
||||
end
|
||||
|
||||
if comment && comment != ""
|
||||
if comment && !comment.blank?
|
||||
# todo: cap comment size
|
||||
comment_value = Base64.decode_string comment # usual b64, surprisingly
|
||||
next_id = IDs.get_next_id("comments")
|
||||
|
|
|
@ -23,7 +23,7 @@ CrystalGauntlet.endpoints["/getGJLevels21.php"] = ->(context : HTTP::Server::Con
|
|||
|
||||
searchQuery = params["str"]? || ""
|
||||
|
||||
if searchQuery != "" && params["type"] != "5" && params["type"] != "10" && params["type"] != "19"
|
||||
if !searchQuery.blank? && params["type"] != "5" && params["type"] != "10" && params["type"] != "19"
|
||||
if searchQuery.to_i?
|
||||
# we do this to get rid of the initial "unlisted = 0" bit
|
||||
can_see_unlisted = true
|
||||
|
@ -59,7 +59,7 @@ CrystalGauntlet.endpoints["/getGJLevels21.php"] = ->(context : HTTP::Server::Con
|
|||
# $params[] = "levelID IN ($completedLevels)";
|
||||
end
|
||||
if params["song"]?
|
||||
if params["customSong"]? && params["customSong"]? != ""
|
||||
if params["customSong"]? && !params["customSong"].blank?
|
||||
queryParams << "song_id = '#{params["customSong"].to_i}'"
|
||||
else
|
||||
queryParams << "song_id = '#{params["song"].to_i}'"
|
||||
|
|
|
@ -13,7 +13,7 @@ CrystalGauntlet.endpoints["/uploadGJAccComment20.php"] = ->(context : HTTP::Serv
|
|||
|
||||
comment = params["comment"]?
|
||||
|
||||
if comment && comment != ""
|
||||
if comment && !comment.blank?
|
||||
# todo: cap comment size
|
||||
comment_value = Base64.decode_string comment # usual b64, surprisingly
|
||||
next_id = IDs.get_next_id("account_comments")
|
||||
|
|
|
@ -17,7 +17,7 @@ module CrystalGauntlet::Accounts
|
|||
|
||||
# DOESN'T VERIFY PASSWORD
|
||||
def get_ext_id_from_params(params : URI::Params) : Int32 | Nil
|
||||
if params.has_key?("udid") && params["udid"] != ""
|
||||
if params.has_key?("udid") && !params["udid"].blank?
|
||||
params["udid"].to_i32?
|
||||
else
|
||||
get_account_id_from_params(params)
|
||||
|
@ -63,7 +63,7 @@ module CrystalGauntlet::Accounts
|
|||
end
|
||||
|
||||
def verify_gjp(account_id : Int32, gjp : String) : Bool
|
||||
if gjp == ""
|
||||
if gjp.blank?
|
||||
return false
|
||||
end
|
||||
hash = DATABASE.scalar("select password from accounts where id = ?", account_id).as(String)
|
||||
|
|
|
@ -95,7 +95,7 @@ module CrystalGauntlet::Songs
|
|||
if source == "unknown"
|
||||
return UNKNOWN_SONG_AUTHOR
|
||||
end
|
||||
if artist_name == ""
|
||||
if artist_name.blank?
|
||||
return UNKNOWN_SONG_AUTHOR
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue