Update hiddentool.php

This commit is contained in:
Namhyeon Go 2022-09-13 20:42:35 +09:00 committed by GitHub
parent 8045256d37
commit 3d602957d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,16 +2,16 @@
/** /**
* @file hiddentool.php * @file hiddentool.php
* @created_on 2021-05-24 * @created_on 2021-05-24
* @updated_on 2021-05-24 * @updated_on 2022-09-13
* @author Go Namhyeon <gnh1201@gmail.com> * @author Go Namhyeon <gnh1201@gmail.com>
* @brief Tools for Hidden Services (e.g. Tor, I2P, etc...) * @brief Tools for Hidden Services (e.g. Tor, I2P, etc...)
*/ */
if (!is_fn("detect_hidden_service")) { if (!is_fn("detect_hidden_service")) {
function detect_hidden_service() { function detect_hidden_service() {
$score = 0; $score = 0;
$suffixes = array("onion", "i2p"); $suffixes = array("onion", "i2p", "crypto");
$forwarded_host = get_header_value("X-Forwarded-Host"); $forwarded_host = get_header_value("X-Forwarded-Host");
if (!empty($forwarded_host)) { if (!empty($forwarded_host)) {
if (in_array(end(explode('.', $forwarded_host)), $suffixes)) { if (in_array(end(explode('.', $forwarded_host)), $suffixes)) {