Changeset 3216792
- Timestamp:
- 01/04/2025 08:40:43 AM (15 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sign-in-with-essentials/trunk/src/includes/class-siwe-handlers.php
r3216630 r3216792 108 108 } 109 109 110 public static function get_install_subdir_from_home () { 111 $siteurl = get_site_url('siteurl'); 112 $relpath = str_replace( ['http://', 'https://'], '', $siteurl ); 113 $relpath = str_replace( $_SERVER['HTTP_HOST'], '', $relpath ); 114 if ($relpath === '/') { 115 $relpath = ''; 116 } 117 return $relpath; 118 } 119 110 120 /** 111 121 * Uses the code response from redirection-back to authenticate the user, before anything is rendered. … … 129 139 $redir_url = $this->parent->siwe_redirect_back_url(); 130 140 $is_query = str_contains ($redir_url, '?' ); 141 $start_path = str_replace ( $this->get_install_subdir_from_home(), '', $_SERVER['REQUEST_URI'] ); 131 142 132 143 if ( 133 144 ( $is_query && array_key_exists(str_replace('?', '', $redir_url), $_GET) ) 134 145 || 135 ( ! $is_query && str_starts_with(sanitize_url($ _SERVER['REQUEST_URI']), $redir_url ) )146 ( ! $is_query && str_starts_with(sanitize_url($start_path), $redir_url ) ) 136 147 ) 137 148 {
Note: See TracChangeset
for help on using the changeset viewer.