-
Notifications
You must be signed in to change notification settings - Fork 33
Improve whitespace trimming in get_canonical_url() #3534
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve whitespace trimming in get_canonical_url() #3534
Conversation
📝 WalkthroughWalkthroughThe update revises the order of string processing in the Changes
Sequence Diagram(s)sequenceDiagram
participant Test as CanonicalURLsTest
participant Parsely as class-parsely.php
participant WP as WordPress
Test->>WP: Set up permalink structure and options
Test->>Parsely: Call get_canonical_url()
Parsely->>Parsely: Trim, remove slashes, strip protocol from domain
Parsely-->>Test: Return normalized canonical URL
Test->>Parsely: Call set_canonical_url()
Parsely-->>WP: Store canonical URL
Test->>Parsely: Call get_canonical_url_from_post()
Parsely->>WP: Retrieve post and metadata
Parsely-->>Test: Return canonical URL for post
Possibly related PRs
Suggested labels
Suggested reviewers
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 PHPStan (2.1.17)Note: Using configuration file /phpstan.neon. 📜 Recent review detailsConfiguration used: .coderabbit.yaml 📒 Files selected for processing (2)
🧰 Additional context used📓 Path-based instructions (1)**/*.{html,php}Instructions used from: Sources: 🧠 Learnings (1)📓 Common learnings🔇 Additional comments (7)
✨ Finishing Touches
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. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page 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
Documentation and Community
|
|
SonarCloud incorrectly complains of "possible security issues" because the integration tests uses |
|
I've marked the issues as "safe" in SonarCloud and will be merging this now. |
…rimming-in-get_canonical_url" (4b6dbea)
Description
With this PR, we're improving whitespace trimming in the
get_canonical_url()function, as the previous implementation could result in double slashes when there was trailing whitespace in the canonical. We're also introducing the tests mentioned in #3525.Motivation and context
How has this been tested?
Through the integration tests introduced.
Summary by CodeRabbit
Bug Fixes
Tests