Fix empty string comparison issues in the codebase (#16686)
Automatic Merge
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
200a56fa5a
Коммит
94c24eea20
@@ -312,7 +312,7 @@ func ParseSearchParams(text string, timeZoneOffset int) []*SearchParams {
|
||||
|
||||
paramsList := []*SearchParams{}
|
||||
|
||||
if len(plainTerms) > 0 || len(excludedPlainTerms) > 0 {
|
||||
if plainTerms != "" || excludedPlainTerms != "" {
|
||||
paramsList = append(paramsList, &SearchParams{
|
||||
Terms: plainTerms,
|
||||
ExcludedTerms: excludedPlainTerms,
|
||||
@@ -333,7 +333,7 @@ func ParseSearchParams(text string, timeZoneOffset int) []*SearchParams {
|
||||
})
|
||||
}
|
||||
|
||||
if len(hashtagTerms) > 0 || len(excludedHashtagTerms) > 0 {
|
||||
if hashtagTerms != "" || excludedHashtagTerms != "" {
|
||||
paramsList = append(paramsList, &SearchParams{
|
||||
Terms: hashtagTerms,
|
||||
ExcludedTerms: excludedHashtagTerms,
|
||||
@@ -355,8 +355,8 @@ func ParseSearchParams(text string, timeZoneOffset int) []*SearchParams {
|
||||
}
|
||||
|
||||
// special case for when no terms are specified but we still have a filter
|
||||
if len(plainTerms) == 0 && len(hashtagTerms) == 0 &&
|
||||
len(excludedPlainTerms) == 0 && len(excludedHashtagTerms) == 0 &&
|
||||
if plainTerms == "" && hashtagTerms == "" &&
|
||||
excludedPlainTerms == "" && excludedHashtagTerms == "" &&
|
||||
(len(inChannels) != 0 || len(fromUsers) != 0 ||
|
||||
len(excludedChannels) != 0 || len(excludedUsers) != 0 ||
|
||||
len(extensions) != 0 || len(excludedExtensions) != 0 ||
|
||||
|
||||
Ссылка в новой задаче
Block a user