Skip to content

Commit 1666433

Browse files
authored
Fix replacing site url in DB after pulling site (#992)
1 parent 3cf692e commit 1666433

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

‎src/lib/updateSiteUrlToLocal.ts‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,16 @@ export const updateSiteUrlToLocal = async ( siteId: string ) => {
1919
const oldUrl = currentSiteUrl.trim();
2020
const urlWithoutProtocol = oldUrl.replace( /^https?:\/\//, '' );
2121

22-
const oldUrlVariants = [ `http://${ urlWithoutProtocol }`, `https://${ urlWithoutProtocol }` ];
22+
const oldUrlVariants = [
23+
`http://${ urlWithoutProtocol }`,
24+
`https://${ urlWithoutProtocol }`,
25+
// e.g. "posterUrl" for videos uses encoded URLs
26+
`http%3A%2F%2F${ urlWithoutProtocol }`,
27+
`https%3A%2F%2F${ urlWithoutProtocol }`,
28+
// e.g. Elementor plugin uses escaped URLs
29+
String.raw`http:\/\/${ urlWithoutProtocol }`,
30+
String.raw`https:\/\/${ urlWithoutProtocol }`,
31+
];
2332

2433
for ( const urlToReplace of oldUrlVariants ) {
2534
const { stderr, exitCode } = await server.executeWpCliCommand(

0 commit comments

Comments
 (0)