diff --git a/include/config.php b/include/config.php
index 6f230af4..44fd488a 100644
--- a/include/config.php
+++ b/include/config.php
@@ -73,9 +73,11 @@ foreach ($settings as $name => $value) {
}
$SITENAME = $BASIC['SITENAME'];
-$BASEURL = $BASIC['BASEURL'];
+//$BASEURL = $BASIC['BASEURL'];
+$BASEURL = $_SERVER['HTTP_HOST'];
$announce_urls = array();
-$announce_urls[] = $BASIC['announce_url'];
+//$announce_urls[] = $BASIC['announce_url'];
+$announce_urls[] = $BASEURL . '/announce.php';
$SITE_ONLINE = $MAIN['site_online'];
$max_torrent_size = $MAIN['max_torrent_size'];
diff --git a/include/core.php b/include/core.php
index c1fa72ab..a6905fa1 100644
--- a/include/core.php
+++ b/include/core.php
@@ -3,6 +3,7 @@ if(!defined('IN_TRACKER')) {
die('Hacking attempt!');
}
error_reporting(E_ALL);
+ini_set('display_errors', 0);
if (!empty($_SERVER['HTTP_X_REQUEST_ID'])) {
define('REQUEST_ID', $_SERVER['HTTP_X_REQUEST_ID']);
} else {
@@ -23,9 +24,6 @@ require $rootpath . 'include/config.php';
if (!IS_ANNOUNCE) {
require $rootpath . get_langfile_path("functions.php");
}
-
-ini_set('display_errors', $TWEAK['display_errors']);
-
$Cache = new RedisCache(); //Load the caching class
$Cache->setLanguageFolderArray(get_langfolder_list());
define('TIMENOW', time());
diff --git a/include/functions_announce.php b/include/functions_announce.php
index ee9abb47..4ddea032 100644
--- a/include/functions_announce.php
+++ b/include/functions_announce.php
@@ -55,7 +55,7 @@ function benc_resp($d)
benc_resp_raw(benc(array('type' => 'dictionary', 'value' => $d)));
}
function benc_resp_raw($x) {
-
+ do_log($x);
header("Content-Type: text/plain; charset=utf-8");
header("Pragma: no-cache");
@@ -318,7 +318,7 @@ function check_client($peer_id, $agent, &$agent_familyid)
$agent_familyid = $row_allowed_ua['id'];
}
- if($_SERVER["HTTPS"] == "on")
+ if(isset($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] == "on")
{
if($allow_https == 'yes')
return 0;
diff --git a/include/globalfunctions.php b/include/globalfunctions.php
index 153ede8a..91691405 100644
--- a/include/globalfunctions.php
+++ b/include/globalfunctions.php
@@ -80,7 +80,7 @@ function sql_query($query)
function sqlesc($value) {
if (is_null($value)) {
- return null;
+ return 'null';
}
$value = "'" . mysql_real_escape_string($value) . "'";
return $value;
diff --git a/lang/chs/lang_settings.php b/lang/chs/lang_settings.php
index 388e276c..b44820f5 100644
--- a/lang/chs/lang_settings.php
+++ b/lang/chs/lang_settings.php
@@ -508,7 +508,7 @@ $lang_settings = array
'head_website_settings' => "站点设定",
'row_basic_settings' => "基础设定",
'submit_basic_settings' => "基础设定",
- 'text_basic_settings_note' => "设定最基础的项目,如数据库,网站名等。如果对设定项目的功能不清楚,请不要做任何修改。
基础设定出错可能导致网站无法运行。",
+ 'text_basic_settings_note' => "设定最基础的项目,网站名等。",
'row_main_settings' => "主要设定",
'submit_main_settings' => "主要设定",
'text_main_settings_note' => "配置你的网站各种主要项目。",
@@ -682,8 +682,6 @@ $lang_settings = array
'text_invitations_default' => "个邀请名额。默认",
'row_use_cron_trigger_cleanup' => '使用定时器进行清理',
'text_use_cron_trigger_cleanup_note' => '确保已经配置好定时任务',
- 'row_display_errors' => '显示错误',
- 'text_display_errors_note' => '在网页上展示错误信息',
'row_logging' => '运行日志路径',
'text_logging_note' => '请填写你的运行时日志路径',
);
diff --git a/lang/cht/lang_settings.php b/lang/cht/lang_settings.php
index 08bb6585..282ddaf1 100644
--- a/lang/cht/lang_settings.php
+++ b/lang/cht/lang_settings.php
@@ -509,7 +509,7 @@ $lang_settings = array
'head_website_settings' => "網站設定",
'row_basic_settings' => "基礎設定",
'submit_basic_settings' => "基礎設定",
- 'text_basic_settings_note' => "設定最基礎的項目,如資料程式庫,網站名等。如果對設定項目的功能不清楚,請不要做任何修改。
基礎設定出錯可能導致網站無法執行。",
+ 'text_basic_settings_note' => "設定最基礎的項目,網站名等。",
'row_main_settings' => "主要設定",
'submit_main_settings' => "主要設定",
'text_main_settings_note' => "配置你的網站各種主要項目。",
@@ -682,8 +682,6 @@ $lang_settings = array
'text_invitations_default' => "個邀請名額。預設",
'row_use_cron_trigger_cleanup' => '使用定時器進行清理',
'text_use_cron_trigger_cleanup_note' => '確保已經配置好定時任務',
- 'row_display_errors' => '顯示錯誤',
- 'text_display_errors_note' => '在網頁上展示錯誤信息',
'row_logging' => '運行日誌路徑',
'text_logging_note' => '請填寫妳的運行時日誌路徑',
);
diff --git a/lang/en/lang_settings.php b/lang/en/lang_settings.php
index 60b587f3..6dba6828 100644
--- a/lang/en/lang_settings.php
+++ b/lang/en/lang_settings.php
@@ -508,7 +508,7 @@ $lang_settings = array
'head_website_settings' => "Website Settings",
'row_basic_settings' => "Basic Settings",
'submit_basic_settings' => "Basic Settings",
- 'text_basic_settings_note' => "Setup the most basic things, e.g. database, site name. DO NOT touch this unless you know what you are doing!
Misconfiguration of Basic Settings may result in AN UNUSABLE SITE.",
+ 'text_basic_settings_note' => "Setup the most basic things, site name.",
'row_main_settings' => "Main Settings",
'submit_main_settings' => "Main Settings",
'text_main_settings_note' => "Setup miscellaneous things about your site.",
@@ -682,8 +682,6 @@ $lang_settings = array
'text_invitations_default' => " invitations the first time he is promoted to this class. Default ",
'row_use_cron_trigger_cleanup' => 'Use cron trigger cleanup',
'text_use_cron_trigger_cleanup_note' => 'Make sure have configure crontab job',
- 'row_display_errors' => 'Display errors',
- 'text_display_errors_note' => 'Display errors message on page',
'row_logging' => 'Runtime log path',
'text_logging_note' => 'Please enter your runtime log path',
);
diff --git a/public/announce.php b/public/announce.php
index 00ff2281..4d4e9e19 100644
--- a/public/announce.php
+++ b/public/announce.php
@@ -2,6 +2,8 @@
require_once('../include/bittorrent_announce.php');
require_once('../include/benc.php');
dbconn_announce();
+do_log(json_encode($_SERVER));
+$log = "";
//1. BLOCK ACCESS WITH WEB BROWSERS AND CHEATS!
$agent = $_SERVER["HTTP_USER_AGENT"];
block_browser();
@@ -9,7 +11,7 @@ block_browser();
// get string type passkey, info_hash, peer_id, event, ip from client
foreach (array("passkey","info_hash","peer_id","event") as $x)
{
- if(isset($_GET["$x"]))
+ if(isset($_GET[$x]))
$GLOBALS[$x] = $_GET[$x];
}
// get integer type port, downloaded, uploaded, left from client
@@ -331,10 +333,11 @@ if (isset($self) && $event == "stopped")
}
elseif(isset($self))
{
+ $finished = $finished_snatched = '';
if ($event == "completed")
{
//sql_query("UPDATE snatched SET finished = 'yes', completedat = $dt WHERE torrentid = $torrentid AND userid = $userid");
- $finished = ", finishedat = ".TIMENOW;
+ $finished .= ", finishedat = ".TIMENOW;
$finished_snatched = ", completedat = ".$dt . ", finished = 'yes'";
$updateset[] = "times_completed = times_completed + 1";
}
diff --git a/public/settings.php b/public/settings.php
index 9044ba84..1a2d53f3 100644
--- a/public/settings.php
+++ b/public/settings.php
@@ -44,6 +44,7 @@ $notice = "