summaryrefslogtreecommitdiff
path: root/post.php
diff options
context:
space:
mode:
Diffstat (limited to 'post.php')
-rw-r--r--post.php23
1 files changed, 5 insertions, 18 deletions
diff --git a/post.php b/post.php
index c59a57db..90daab3c 100644
--- a/post.php
+++ b/post.php
@@ -3,21 +3,9 @@
* Copyright (c) 2010-2014 Tinyboard Development Group
*/
-require_once 'inc/functions.php';
+require_once 'inc/bootstrap.php';
require_once 'inc/anti-bot.php';
require_once 'inc/bans.php';
-
-// Fix for magic quotes
-if (get_magic_quotes_gpc()) {
- function strip_array($var) {
- return is_array($var) ? array_map('strip_array', $var) : stripslashes($var);
- }
-
- $_GET = strip_array($_GET);
- $_POST = strip_array($_POST);
-}
-
-
$dropped_post = false;
function handle_nntpchan() {
@@ -815,8 +803,7 @@ function handle_post(){
if (!$dropped_post)
if (($config['country_flags'] && !$config['allow_no_country']) || ($config['country_flags'] && $config['allow_no_country'] && !isset($_POST['no_country']))) {
- require 'inc/lib/geoip/geoip.inc';
- $gi=geoip\geoip_open('inc/lib/geoip/GeoIPv6.dat', GEOIP_STANDARD);
+ $gi=geoip_open('inc/lib/geoip/GeoIPv6.dat', GEOIP_STANDARD);
function ipv4to6($ip) {
if (strpos($ip, ':') !== false) {
@@ -830,7 +817,7 @@ function handle_post(){
return '::ffff:'.$part7.':'.$part8;
}
- if ($country_code = geoip\geoip_country_code_by_addr_v6($gi, ipv4to6($_SERVER['REMOTE_ADDR']))) {
+ if ($country_code = geoip_country_code_by_addr_v6($gi, ipv4to6($_SERVER['REMOTE_ADDR']))) {
if (!in_array(strtolower($country_code), array('eu', 'ap', 'o1', 'a1', 'a2')))
$post['body'] .= "\n<tinyboard flag>".strtolower($country_code)."</tinyboard>".
"\n<tinyboard flag alt>".geoip\geoip_country_name_by_addr_v6($gi, ipv4to6($_SERVER['REMOTE_ADDR']))."</tinyboard>";
@@ -939,7 +926,7 @@ function handle_post(){
if ($file['is_an_image']) {
if ($config['ie_mime_type_detection'] !== false) {
// Check IE MIME type detection XSS exploit
- $buffer = file_get_contents($upload, null, null, null, 255);
+ $buffer = file_get_contents($upload, false, null, 0, 255);
if (preg_match($config['ie_mime_type_detection'], $buffer)) {
undoImage($post);
error($config['error']['mime_exploit']);
@@ -1339,7 +1326,7 @@ function handle_post(){
// Tell it to delete the cached post for referer
$js->{$_SERVER['HTTP_REFERER']} = true;
// Encode and set cookie
- setcookie($config['cookies']['js'], json_encode($js), 0, $config['cookies']['jail'] ? $config['cookies']['path'] : '/', null, false, false);
+ setcookie($config['cookies']['js'], json_encode($js), 0, $config['cookies']['jail'] ? $config['cookies']['path'] : '/', $config['domain'], false, false);
}
$root = $post['mod'] ? $config['root'] . $config['file_mod'] . '?/' : $config['root'];