Skip to content

Comments

Sanitize search query operands better#387

Merged
tuomas777 merged 1 commit intomainfrom
PL-210-search-operand-handling-embetterments
Feb 12, 2026
Merged

Sanitize search query operands better#387
tuomas777 merged 1 commit intomainfrom
PL-210-search-operand-handling-embetterments

Conversation

@tuomas777
Copy link
Contributor

@tuomas777 tuomas777 commented Feb 12, 2026

The search query builder now properly handles additional edge cases:

  • Skip empty or whitespace-only operands to prevent malformed queries
  • Skip operands starting with unbalanced single quotes to prevent tsquery syntax errors (e.g., "'r:*") while still allowing valid embedded quotes (e.g., "b'c")

This prevents PostgreSQL tsquery errors when users input malformed search strings with leading quotes or excessive whitespace, avoiding unnecessary Sentry error pollution from user input errors.

Refs: PL-210

@tuomas777 tuomas777 force-pushed the PL-210-search-operand-handling-embetterments branch from 4ef23cb to 2cfc938 Compare February 12, 2026 12:57
@azure-pipelines
Copy link

PALVELUKARTTA-API branch is deployed to platta: https://palvelukartta-api-pr387.dev.hel.ninja 🚀🚀🚀

The search query builder now properly handles additional edge cases:
- Skip empty or whitespace-only operands to prevent malformed queries
- Skip operands starting with unbalanced single quotes to prevent
  tsquery syntax errors (e.g., "'r:*") while still allowing valid
  embedded quotes (e.g., "b'c")

This prevents PostgreSQL tsquery errors when users input malformed
search strings with leading quotes or excessive whitespace, avoiding
unnecessary Sentry error pollution from user input errors.

Refs: PL-210
@tuomas777 tuomas777 force-pushed the PL-210-search-operand-handling-embetterments branch from 2cfc938 to d5936bf Compare February 12, 2026 13:24
@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 12, 2026

@tuomas777 tuomas777 marked this pull request as ready for review February 12, 2026 13:30
@tuomas777 tuomas777 requested a review from a team as a code owner February 12, 2026 13:30
@azure-pipelines
Copy link

PALVELUKARTTA-API branch is deployed to platta: https://palvelukartta-api-pr387.dev.hel.ninja 🚀🚀🚀

@tuomas777 tuomas777 merged commit b5032c6 into main Feb 12, 2026
7 checks passed
@tuomas777 tuomas777 deleted the PL-210-search-operand-handling-embetterments branch February 12, 2026 13:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants