Browse Source

cleanup

pull/40/head
Savetheinternet 13 years ago
parent
commit
2ac8dc2c0f
  1. 2
      inc/functions.php
  2. 29
      post.php

2
inc/functions.php

@ -1418,7 +1418,7 @@
switch($type) { switch($type) {
case 'jpg': case 'jpg':
case 'jpeg': case 'jpeg':
if(!$image = imagecreatefromjpeg($source_pic)) { if(!$image = @imagecreatefromjpeg($source_pic)) {
unlink($source_pic); unlink($source_pic);
error($config['error']['invalidimg']); error($config['error']['invalidimg']);
} }

29
post.php

@ -36,7 +36,7 @@
} }
} }
sql_open();
// Check if banned // Check if banned
checkBan(); checkBan();
@ -97,7 +97,7 @@
} }
} }
sql_open();
// Check if banned // Check if banned
checkBan(); checkBan();
@ -176,9 +176,6 @@
if(time()-$user['appeared']<LURKTIME) error(ERROR_LURK); if(time()-$user['appeared']<LURKTIME) error(ERROR_LURK);
*/ */
// Open database connection
sql_open();
// Check if banned // Check if banned
checkBan(); checkBan();
@ -487,15 +484,17 @@
buildIndex(); buildIndex();
// Tell Javascript that we posted successfully if(isset($_SERVER['HTTP_REFERER'])) {
if(isset($_COOKIE[$config['cookies']['js']])) // Tell Javascript that we posted successfully
$js = json_decode($_COOKIE[$config['cookies']['js']]); if(isset($_COOKIE[$config['cookies']['js']]))
else $js = json_decode($_COOKIE[$config['cookies']['js']]);
$js = (object) Array(); else
// Tell it to delete the cached post for referer $js = (object) Array();
$js->{$_SERVER['HTTP_REFERER']} = true; // Tell it to delete the cached post for referer
// Encode and set cookie $js->{$_SERVER['HTTP_REFERER']} = true;
setcookie($config['cookies']['js'], json_encode($js), 0, $config['cookies']['jail']?$config['cookies']['path']:'/', null, false, false); // Encode and set cookie
setcookie($config['cookies']['js'], json_encode($js), 0, $config['cookies']['jail']?$config['cookies']['path']:'/', null, false, false);
}
$root = $post['mod'] ? $config['root'] . $config['file_mod'] . '?/' : $config['root']; $root = $post['mod'] ? $config['root'] . $config['file_mod'] . '?/' : $config['root'];
@ -514,7 +513,7 @@
exit; exit;
} else { } else {
if(!file_exists($config['has_installed'])) { if(!file_exists($config['has_installed'])) {
sql_open();
// Build all boards // Build all boards
$boards = listBoards(); $boards = listBoards();

Loading…
Cancel
Save