Automattic / vip-cli

The VIP CLI
https://docs.wpvip.com/vip-cli/
MIT License
58 stars 16 forks source link

`vip dev-env import sql` generates false positives for `home` and `siteurl` #1906

Closed sjinks closed 2 months ago

sjinks commented 2 months ago

When vip dev-env import sql validates the file, it may incorrectly suggest replacements, like

Warning: Siteurl/home options not pointing to lando domain on line 951461.
Recommendation: Use '--search-replace="home,vip-local.vipdev.lndo.site"' switch to replace the domain

Debugging shows that the following snippet triggers this suggestion:

(468,'home','home',0),

The relevant code: https://github.com/Automattic/vip-cli/blob/64c2d6412f80e529aa53c6549a1bf1a6a8e2c61a/src/lib/validations/sql.ts#L338-L346

We should probably check that the URL found starts with http:// or https://.

Ref: 188464-z