Skip to content

Commit 3c50034

Browse files
site-utils.php: Handle checking of links properly
``` ╭─[email protected] ~ ╰─➤ ee auth create httpauth1.immanuelraj.rt.gw Error: Could not find the site you wish to run auth create command on. Either pass it as an argument: `ee auth create <site-name>` or run `ee auth create` from inside the site folder. ``` But if the site name doesn't start with HTTP then it will allow it ``` ╭─[email protected] ~ ╰─➤ ee auth create testhttpauth.immanuelraj.rt.gw 1 ↵ Reloading global reverse proxy. Success: Auth successfully updated for `testhttpauth.immanuelraj.rt.gw` scope. New values added: User: ee-SzkPrf Pass: PjRg6O4adjM6Te49ac ````
1 parent 09ea85b commit 3c50034

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/helper/site-utils.php

Lines changed: 2 additions & 2 deletions
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)