Fix/correctly encode urls to avoid issues with slashes#173
Conversation
|
Caution Review failedThe pull request is closed. WalkthroughThe changes update the URL normalization logic in the 📜 Recent review detailsConfiguration used: CodeRabbit UI 📒 Files selected for processing (4)
Note 🎁 Summarized by CodeRabbit FreeYour organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Join our Discord community for assistance with any issues or questions. Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Changes proposed in this Pull Request
This pull request updates the URL normalization logic to ensure consistent encoding across various components and adjusts the associated tests to reflect these changes. The most important changes include modifications to the
wpcomsp_wayback_link_fixer_normalize_urlfunction, updates to thewpcomsp_wayback_link_fixer_is_current_site_linkfunction, and adjustments to test cases to align with the new encoding behavior.URL Normalization Enhancements:
wpcomsp_wayback_link_fixer_normalize_urlto applyrawurlencodeto the entire path and the host, ensuring all URLs are consistently encoded. (functions.php, [1] [2]URL Comparison Logic:
wpcomsp_wayback_link_fixer_is_current_site_linkto normalize all site URLs before comparison, ensuring accurate matching against encoded URLs. (functions.php, functions.phpR405-R407)Test Updates for URL Encoding:
Test_Functionsto validate the new encoding format for normalized URLs, including paths, query parameters, and special characters. (tests/Test_Functions.php, tests/Test_Functions.phpL27-R39)Test_HTTP_Link_Checker_Clientto check for encoded URLs in API requests. (tests/Wayback_Machine/Test_HTTP_Link_Checker_Client.php, [1] [2]Test_HTTP_Snapshot_Clientto verify that encoded URLs are used in various scenarios, such as filters and API calls. (tests/Wayback_Machine/Test_HTTP_Snapshot_Client.php, [1] [2] [3]Testing instructions
Mentions #
Summary by CodeRabbit
Bug Fixes
Tests