Skip to content

Commit

Permalink
replace only the start of the string
Browse files Browse the repository at this point in the history
  • Loading branch information
guzmandrade-wds committed Nov 2, 2023
1 parent 5921a48 commit 0c9f332
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/class-block-converter.php
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ public function remove_image_args( $url ): string {
$url = str_replace( '#' . $url_parts['fragment'], '', $url );
}
if ( str_starts_with( $url, '//' ) ) {
$url = str_replace( '//', 'https://', $url );
$url = preg_replace( '#^//#', 'https://', $url );
}
return $url;
}
Expand Down

0 comments on commit 0c9f332

Please sign in to comment.