Conversation
|
Warning Rate limit exceeded
⌛ How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. 🚦 How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout. Please see our FAQ for further information. ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR prevents empty full-text search binds and improves Unicode-aware sanitization across DB adapters. MariaDB and Postgres now short-circuit empty fulltext queries with trivial SQL fragments, SQL.getFulltextValue gains Unicode filtering, and regression tests for accented/special characters were added (duplicate test present). Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/Database/Adapter/Postgres.php`:
- Around line 1925-1927: The two-step sanitization on $value uses
preg_replace(..., '/u') which can return null for malformed UTF-8 and then
passes that null into the next preg_replace, causing a TypeError; make the
sequence null-safe by checking the result of the first preg_replace (or
coalescing it to an empty string) before calling the second preg_replace/trim so
preg_replace and trim always receive a string; locate the transformations on
$value in Postgres.php (the preg_replace calls on $value) and either guard the
second call with an is_string() check or use a null-coalescing cast to ensure a
string is passed onward.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 47a42995-85a0-4e02-8b90-af200c0840b6
📒 Files selected for processing (4)
src/Database/Adapter/MariaDB.phpsrc/Database/Adapter/Postgres.phpsrc/Database/Adapter/SQL.phptests/e2e/Adapter/Scopes/DocumentTests.php
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@src/Database/Adapter/SQL.php`:
- Around line 1755-1758: The preg_replace call that assigns to $value can return
null on invalid UTF-8 and later calls (another preg_replace and trim) will
error; after the first preg_replace('/[^\p{L}\p{N}_\s]/u', ...) ensure the
result is not null by validating/normalizing UTF-8 and providing a safe
fallback: e.g., detect null and set $value = '' or run
mb_convert_encoding($value, 'UTF-8', 'UTF-8') before the regex, then re-run or
cast the preg_replace result to a string; update the code paths around the
$value variable so subsequent preg_replace('/\s+/', ' ', $value) and
trim($value) always receive a string.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
Run ID: 6fe1d9e4-4f1d-4b35-ade9-ae1fcfb74bda
📒 Files selected for processing (2)
src/Database/Adapter/Postgres.phpsrc/Database/Adapter/SQL.php
Summary by CodeRabbit
Bug Fixes
Tests