| Conditions | 3 |
| Paths | 3 |
| Total Lines | 15 |
| Code Lines | 12 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 7 | public function run() |
||
| 8 | { |
||
| 9 | if (isset($_GET['code'])) { |
||
| 10 | header('Location: ' . $_COOKIE['return_uri'] . '?code=' . $_GET['code'] . '&state=' . $_GET['state']); |
||
| 11 | } else { |
||
| 12 | $protocol = $this->is_HTTPS() ? 'https://' : 'http://'; |
||
| 13 | $params = array( |
||
| 14 | 'appid' => $_GET['appid'], |
||
| 15 | 'redirect_uri' => $protocol . $_SERVER['HTTP_HOST'] . $_SERVER['DOCUMENT_URI'], |
||
| 16 | 'response_type' => $_GET['response_type'], |
||
| 17 | 'scope' => $_GET['scope'], |
||
| 18 | 'state' => $_GET['state'], |
||
| 19 | ); |
||
| 20 | setcookie('return_uri', urldecode($_GET['return_uri']), $_SERVER['REQUEST_TIME'] + 60, '/'); |
||
| 21 | header('Location: ' . $this->AuthorizeURL . '?' . http_build_query($params) . '#wechat_redirect'); |
||
| 22 | } |
||
| 46 |