Browse Source

Remove useless debug messages

lainchan was a mistake
pull/68/head
discomrade 2 years ago
parent
commit
ed73ee76cc
  1. 13
      inc/anti-bot.php
  2. 6
      inc/filters.php
  3. 3
      inc/functions.php
  4. 5
      inc/mod/pages.php
  5. 13
      install.php

13
inc/anti-bot.php

@ -8,19 +8,6 @@ defined('TINYBOARD') or exit;
$hidden_inputs_twig = array();
$logfile = "/tmp/lainchan_err.out";
function print_err($s) {
// global $logfile;
// file_put_contents($logfile, $s . "\n", FILE_APPEND);
}
function print_err2($s) {
print_err($s);
}
print_err("\n\nSTART\n\n");
class AntiBot {
public $salt, $inputs = array(), $index = 0;

6
inc/filters.php

@ -6,8 +6,6 @@
defined('TINYBOARD') or exit;
require_once 'inc/anti-bot.php';
class Filter {
public $flood_check;
private $condition;
@ -19,7 +17,6 @@ class Filter {
}
public function match($condition, $match) {
print_err("Filter condition: " . $condition);
$condition = strtolower($condition);
$post = &$this->post;
@ -220,8 +217,6 @@ function purge_flood_table() {
function do_filters(array $post) {
global $config;
print_err("do_filters begin");
if (!isset($config['filters']) || empty($config['filters']))
return;
@ -239,7 +234,6 @@ function do_filters(array $post) {
}
foreach ($config['filters'] as $filter_array) {
print_err("creating new filter, running check");
$filter = new Filter($filter_array);
$filter->flood_check = $flood_check;
if ($filter->check($post)) {

3
inc/functions.php

@ -357,7 +357,6 @@ function define_groups() {
function create_antibot($board, $thread = null) {
require_once dirname(__FILE__) . '/anti-bot.php';
print_err("Create Antibot.");
return _create_antibot($board, $thread);
}
@ -1624,7 +1623,6 @@ function checkSpam(array $extra_salt = array()) {
// Iterate through each input
foreach ($inputs as $name => $value) {
print_err("-> " . $name . ' : ' . $value);
$_hash .= $name . '=' . $value;
}
@ -1635,7 +1633,6 @@ function checkSpam(array $extra_salt = array()) {
$_hash = sha1($_hash . $extra_salt);
if ($hash != $_hash) {
print_err("Hash mismatch");
return true;
}

5
inc/mod/pages.php

@ -6,8 +6,6 @@
defined('TINYBOARD') or exit;
require_once 'inc/anti-bot.php'; // DELETE ME THIS IS FOR print_err function only!
function mod_page($title, $template, $args, $subtitle = false) {
global $config, $mod;
@ -2688,7 +2686,6 @@ function mod_new_pm($username) {
function mod_rebuild() {
global $config, $twig;
print_err("mod_rebuild");
if (!hasPermission($config['mod']['rebuild']))
error($config['error']['noaccess']);
@ -2713,9 +2710,7 @@ function mod_rebuild() {
if (isset($_POST['rebuild_themes'])) {
$log[] = 'Regenerating theme files';
print_err("mod_rebuild calling rebuildThemes");
rebuildThemes('all');
print_err("mod_rebuild calling rebuildThemes ok");
}
if (isset($_POST['rebuild_javascript'])) {

13
install.php

@ -24,27 +24,17 @@ $page = array(
$config['minify_html'] = false;
function checkMd5Exec(bool $can_exec) {
print_err2("checkMd5Exec");
print_err2($can_exec);
$shell_out = shell_exec("pwd");
print_err2("shell out: " . $shell_out);
$shell_out = shell_exec('echo "vichan" | md5sum');
print_err2("shell out: " . $shell_out);
$shell_ok = $shell_out == "141225c362da02b5c359c45b665168de -\n";
print_err2("shell ok: " . strval($shell_ok));
$result = $can_exec && $shell_ok;
print_err2($result);
return $result;
}
function checkGifsicle() {
print_err2("checkGifsicle");
$shell_out = shell_exec('echo $PATH');
print_err2("shell out: " . $shell_out);
$shell_out = shell_exec('gifsicle --help');
print_err2("shell out: " . $shell_out);
$shell_out = shell_exec('which gifsicle');
print_err2("shell out (which gifsicle): " . $shell_out);
return $shell_out;
}
@ -672,7 +662,6 @@ if ($step == 0) {
echo Element('page.html', $page);
} elseif ($step == 1) {
print_err2("Hello World install.php");
$page['title'] = 'Pre-installation test';
$can_exec = true;
@ -690,8 +679,6 @@ if ($step == 0) {
define('PHP_VERSION_ID', ($version[0] * 10000 + $version[1] * 100 + $version[2]));
}
print_err2("Can exec: " . strval($can_exec));
// Required extensions
$extensions = array(
'PDO' => array(

Loading…
Cancel
Save