2048 ) { continue; } $url = esc_url_raw( $url, array( 'http', 'https' ) ); if ( '' === $url ) { continue; } $parts = wp_parse_url( $url ); if ( ! is_array( $parts ) || empty( $parts['host'] ) || empty( $parts['scheme'] ) ) { continue; } $scheme = strtolower( (string) $parts['scheme'] ); if ( ! in_array( $scheme, array( 'http', 'https' ), true ) || strtolower( (string) $parts['host'] ) !== $site_host || ( $site_scheme && $scheme !== $site_scheme ) || isset( $parts['user'] ) || isset( $parts['pass'] ) ) { continue; } $path = isset( $parts['path'] ) ? (string) $parts['path'] : '/'; if ( SafetyPolicy::uri_is_sensitive( $path ) ) { continue; } $out[] = $url; } return array_values( array_unique( $out ) ); }}