-
Notifications
You must be signed in to change notification settings - Fork 18
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
fix(dev-env): detection of URLs to replace for multisites #2081
Conversation
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.OpenSSF Scorecard
Scanned Files |
try { | ||
new URL( url ); | ||
return url; | ||
} catch { | ||
return null; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Node 18.17.0 has URL.canParse()
; hopefully, we can use it instead of this code someday.
: this.landoDomain; | ||
|
||
queries.push( | ||
`UPDATE wp_blogs SET domain = '${ newDomain }' WHERE blog_id = ${ Number( site.blogId ) };` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
custom prefixes is what gives me a pause here.
Quality Gate passedIssues Measures |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested, an it works.
Looks like we're enforcing wp_
for core tables during imports, so it shouldn't be a problem.
* trunk: Revert "New package release: v3.9.0" chore: bump package version to v3.9.0 Add comment explaining the reason why the limit default value is set manually Remove setImmediate Validate logs limit argument Update socket error handler build(deps): bump uuid from 11.0.2 to 11.0.3 build(deps-dev): bump nock from 13.5.5 to 13.5.6 fix(dev-env): detection of URLs to replace for multisites (#2081)
* fix(dev-env): detection of URLs to replace for multisites * fix: replacement takes paths into consideration * refactor: simplify `replaceDomain()` * fix: update `wp_blogs` * Fix test cases - we don't have id's anymore --------- Co-authored-by: Rinat Khaziev <[email protected]>
Description
This PR fixes the generation of a map of domains to replace for a multisite environment.
Previously, if a site URL contained a path (e.g.,
https://domain.com/path
), such an URL would be replaced withslug.vipdev.site
because the system compareddomain.com/path
todomain.com
and ignored it because the strings are not equal.This PR fixes the procedure by comparing domains instead.
Pull request checklist
New release checklist
Steps to Test
See the ticket.