Skip to content

Conversation

@d0ubIeU
Copy link
Contributor

@d0ubIeU d0ubIeU commented Dec 12, 2025

Unifying the search on form method="get" to make search results accessible for bookmarks and sharing via link. fix that results available on normal and advanced search

Summary by CodeRabbit

  • Improvements
    • Search queries are now transmitted via URL parameters, making search results bookmarkable and shareable through the address bar.

✏️ Tip: You can customize this high-level summary in your review settings.

Unifying the search on form method="get" to make search results accessible for bookmarks and sharing via link.
fix that results available on normal and advanced search
@coderabbitai
Copy link

coderabbitai bot commented Dec 12, 2025

Walkthrough

The search functionality is refactored to use HTTP GET requests instead of POST. The form submission method changes from POST to GET, and the corresponding backend handler reads the search term from URL query parameters instead of the request body.

Changes

Cohort / File(s) Summary
Search form submission method
phpmyfaq/assets/templates/default/index.twig
Search form HTTP method changed from POST to GET
Search parameter source
phpmyfaq/search.php
Search term retrieval changed from POST data (request->request) to GET query parameters (request->query)

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~8 minutes

  • Verify the form method change is correctly paired with the backend parameter source change
  • Check for any other code locations that may reference the old POST-based search behavior
  • Consider security and caching implications of using GET (query strings are logged, bookmarkable, cached by browsers)
  • Confirm no other search submission paths or fallback handlers are affected

Poem

🐰 From POST to GET, our search now flies,
Through query strings beneath the skies,
Bookmarkable journeys, cached and clear,
Simplicity reigns without a fear! ✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the main change: converting search from POST to GET method to enable bookmarkable URLs and unified search behavior.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 869ba6b and 4856a40.

📒 Files selected for processing (2)
  • phpmyfaq/assets/templates/default/index.twig (1 hunks)
  • phpmyfaq/search.php (1 hunks)
🧰 Additional context used
📓 Path-based instructions (2)
**/*.php

📄 CodeRabbit inference engine (AGENTS.md)

Use PSR-12 coding standards for PHP code

Files:

  • phpmyfaq/search.php
**/*.{php,ts,tsx,js,jsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{php,ts,tsx,js,jsx}: Use semicolons at the end of each statement
Use single quotes for strings
Follow best practices for localization, such as using placeholders for dynamic content and avoiding hard-coded strings

Files:

  • phpmyfaq/search.php
🧬 Code graph analysis (1)
phpmyfaq/search.php (1)
phpmyfaq/src/phpMyFAQ/Filter.php (2)
  • Filter (29-329)
  • filterVar (69-78)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: phpMyFAQ 8.5 Test on ubuntu-latest
  • GitHub Check: phpMyFAQ 8.3 Test on ubuntu-latest
  • GitHub Check: phpMyFAQ 8.6 Test on ubuntu-latest
  • GitHub Check: phpMyFAQ 8.4 Test on ubuntu-latest
🔇 Additional comments (2)
phpmyfaq/assets/templates/default/index.twig (1)

108-108: Excellent change to enable bookmarkable search URLs.

Changing from POST to GET is the correct approach for search operations, as it makes results bookmarkable and shareable while following RESTful best practices for read-only operations.

phpmyfaq/search.php (1)

63-63: Correct change to read search term from query parameters.

This change properly aligns the backend with the form method change from POST to GET. The input sanitization with FILTER_SANITIZE_SPECIAL_CHARS is appropriately maintained, and this makes the search term accessible via URL query parameters for bookmarking.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@thorsten
Copy link
Owner

Looks like it fixes #3757

thorsten

This comment was marked as outdated.

@thorsten thorsten merged commit d61d89c into thorsten:main Dec 12, 2025
8 checks passed
@seemaussharma-dev
Copy link

Thanks you for the update
I am not clear how to implement the changes at my end to test the fix

@thorsten
Copy link
Owner

@seemaussharma-dev
Copy link

Thank you @thorsten for the update. I tested the update and its working fine 👍

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.

3 participants