Skip to content

Commit a3a28ba

Browse files
authored
Merge pull request #441 from iamimmanuelraj/patch-1
site-utils.php: Handle checking of links properly
2 parents 09ea85b + 3c50034 commit a3a28ba

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/helper/site-utils.php

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ function auto_site_name( $args, $command, $function, $arg_pos = 0 ) {
6464

6565
if ( isset( $args[ $arg_pos ] ) ) {
6666
$possible_site_name = $args[ $arg_pos ];
67-
if ( substr( $possible_site_name, 0, 4 ) === 'http' ) {
68-
$possible_site_name = str_replace( [ 'https', 'http' ], '', $possible_site_name );
67+
if ( substr( $possible_site_name, 0, 7 ) === 'http://' || substr( $possible_site_name, 0, 8 ) === 'https://' ) {
68+
$possible_site_name = str_replace( [ 'https://', 'http://' ], '', $possible_site_name );
6969
}
7070
$url_path = parse_url( EE\Utils\remove_trailing_slash( $possible_site_name ), PHP_URL_PATH );
7171
if ( Site::find( $url_path ) ) {

0 commit comments

Comments
 (0)