Repository navigation
Conversation
HomeController 的语言绑定域名检测用 $value['domain'] == get_http_host() 直接字符串相等比较,两侧都可能不是规范形式: - 配置侧:早期版本保存区域时还没有 filter_area_domain() 过滤,库中 可能存着 http://en.example.com、en.example.com/ 或带大写的主机名 - 请求侧:get_http_host() 只按 SERVER_PORT 去端口,不做小写化, 反代传入大写 Host 或带尾部点时原样返回 任一侧不规范就漏匹配,访问绑定了二级域名的语言时 cookie('lg') 不被设置, 随后退回 get_default_lg(),页面显示默认语言内容。 新增 match_area_bind_acode(),两侧规范化后再比较:配置侧复用 filter_area_domain(),请求侧复用 parse_http_host()。同时跳过未填域名的 区域,避免 PHP 8 下未定义键告警,并在 lgs 非数组时不再触发 count() 致命错误。 Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
HomeController 的语言绑定域名检测用 $value['domain'] == get_http_host() 直接字符串相等比较,两侧都可能不是规范形式:
任一侧不规范就漏匹配,访问绑定了二级域名的语言时 cookie('lg') 不被设置,
随后退回 get_default_lg(),页面显示默认语言内容。
新增 match_area_bind_acode(),两侧规范化后再比较:配置侧复用
filter_area_domain(),请求侧复用 parse_http_host()。同时跳过未填域名的 区域,避免 PHP 8 下未定义键告警,并在 lgs 非数组时不再触发 count() 致命错误。