Skip to content

Commit

Permalink
Merge pull request #441 from iamimmanuelraj/patch-1
Browse files Browse the repository at this point in the history
site-utils.php: Handle checking of links properly
  • Loading branch information
mrrobot47 authored Dec 2, 2024
2 parents 09ea85b + 3c50034 commit a3a28ba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/helper/site-utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@ function auto_site_name( $args, $command, $function, $arg_pos = 0 ) {

if ( isset( $args[ $arg_pos ] ) ) {
$possible_site_name = $args[ $arg_pos ];
if ( substr( $possible_site_name, 0, 4 ) === 'http' ) {
$possible_site_name = str_replace( [ 'https', 'http' ], '', $possible_site_name );
if ( substr( $possible_site_name, 0, 7 ) === 'http://' || substr( $possible_site_name, 0, 8 ) === 'https://' ) {
$possible_site_name = str_replace( [ 'https://', 'http://' ], '', $possible_site_name );
}
$url_path = parse_url( EE\Utils\remove_trailing_slash( $possible_site_name ), PHP_URL_PATH );
if ( Site::find( $url_path ) ) {
Expand Down

0 comments on commit a3a28ba

Please sign in to comment.