= $len && 0 === substr_compare( $host, $suffix, -$len ) ) { return true; } } return false; } /** * Filterable list of host suffixes considered "local". Callbacks returning * a non-array value are ignored — the defaults are used instead (SC-005). * * @return string[] */ private static function get_local_hostname_suffixes(): array { if ( ! function_exists( 'apply_filters' ) ) { return self::DEFAULT_LOCAL_HOSTNAME_SUFFIXES; } /** * Filter: acrossai_mcp_local_hostname_suffixes * * Ops teams that self-host on custom local suffixes (`.docker`, * `.internal`, `.dev`, etc.) can append to the default list here. * Suffixes should include the leading dot. Callbacks returning a * non-array value are defensively ignored — detection falls back * to the default suffix list. The HTTPS scheme gate (FR-009) is * enforced independently of this filter, so extending the list * cannot enable the flag on a plain-HTTP site. * * @since 0.4.0 * * @param string[] $suffixes Default local hostname suffixes. */ $filtered = apply_filters( 'acrossai_mcp_local_hostname_suffixes', self::DEFAULT_LOCAL_HOSTNAME_SUFFIXES ); return is_array( $filtered ) ? $filtered : self::DEFAULT_LOCAL_HOSTNAME_SUFFIXES; } }