{"action":"closed","issue":{"url":"https://api.github.com/repos/kphcdr/ppphp/issues/6","repository_url":"https://api.github.com/repos/kphcdr/ppphp","labels_url":"https://api.github.com/repos/kphcdr/ppphp/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/kphcdr/ppphp/issues/6/comments","events_url":"https://api.github.com/repos/kphcdr/ppphp/issues/6/events","html_url":"https://github.com/kphcdr/ppphp/issues/6","id":199508978,"number":6,"title":"/index.php  HTTP_HOST bug","user":{"login":"h4dex","id":8213215,"avatar_url":"https://avatars3.githubusercontent.com/u/8213215?v=4","gravatar_id":"","url":"https://api.github.com/users/h4dex","html_url":"https://github.com/h4dex","followers_url":"https://api.github.com/users/h4dex/followers","following_url":"https://api.github.com/users/h4dex/following{/other_user}","gists_url":"https://api.github.com/users/h4dex/gists{/gist_id}","starred_url":"https://api.github.com/users/h4dex/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/h4dex/subscriptions","organizations_url":"https://api.github.com/users/h4dex/orgs","repos_url":"https://api.github.com/users/h4dex/repos","events_url":"https://api.github.com/users/h4dex/events{/privacy}","received_events_url":"https://api.github.com/users/h4dex/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2017-01-09T09:34:43Z","updated_at":"2018-04-12T12:15:13Z","closed_at":"2018-04-12T12:15:13Z","author_association":"CONTRIBUTOR","body":"在不同端口下\r\nHTTP_HOST 会匹配完整的HOST  ppphpadmin.m.com:8080  则 无法跳转  后台 /API 等 模块\r\n\r\n原code如下\r\n```\r\nif ($_SERVER['HTTP_HOST'] == 'ppphpadmin.m.com' || $_SERVER['HTTP_HOST'] == 'ppphpadmin.kphcdr.com') {\r\n    $MODULE_NAME = 'admin';\r\n} else {\r\n    $MODULE_NAME = 'app';\r\n}\r\n```\r\n\r\n改进方法 Q&A 2\r\n\r\n1.修改 HTTP_HOST 为 SERVER_NAME\r\n2.strpos(); 验证字符串是否存在"}}
{"actor":{"display_login":"kphcdr"}}