mirror of
https://github.com/vichan-devel/vichan.git
synced 2024-11-23 23:20:57 +01:00
cleanup
This commit is contained in:
parent
e7a0eb14f4
commit
2ac8dc2c0f
@ -1418,7 +1418,7 @@
|
||||
switch($type) {
|
||||
case 'jpg':
|
||||
case 'jpeg':
|
||||
if(!$image = imagecreatefromjpeg($source_pic)) {
|
||||
if(!$image = @imagecreatefromjpeg($source_pic)) {
|
||||
unlink($source_pic);
|
||||
error($config['error']['invalidimg']);
|
||||
}
|
||||
|
29
post.php
29
post.php
@ -36,7 +36,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
sql_open();
|
||||
|
||||
|
||||
// Check if banned
|
||||
checkBan();
|
||||
@ -97,7 +97,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
sql_open();
|
||||
|
||||
|
||||
// Check if banned
|
||||
checkBan();
|
||||
@ -176,9 +176,6 @@
|
||||
if(time()-$user['appeared']<LURKTIME) error(ERROR_LURK);
|
||||
*/
|
||||
|
||||
// Open database connection
|
||||
sql_open();
|
||||
|
||||
// Check if banned
|
||||
checkBan();
|
||||
|
||||
@ -487,15 +484,17 @@
|
||||
|
||||
buildIndex();
|
||||
|
||||
// Tell Javascript that we posted successfully
|
||||
if(isset($_COOKIE[$config['cookies']['js']]))
|
||||
$js = json_decode($_COOKIE[$config['cookies']['js']]);
|
||||
else
|
||||
$js = (object) Array();
|
||||
// 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);
|
||||
if(isset($_SERVER['HTTP_REFERER'])) {
|
||||
// Tell Javascript that we posted successfully
|
||||
if(isset($_COOKIE[$config['cookies']['js']]))
|
||||
$js = json_decode($_COOKIE[$config['cookies']['js']]);
|
||||
else
|
||||
$js = (object) Array();
|
||||
// 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);
|
||||
}
|
||||
|
||||
$root = $post['mod'] ? $config['root'] . $config['file_mod'] . '?/' : $config['root'];
|
||||
|
||||
@ -514,7 +513,7 @@
|
||||
exit;
|
||||
} else {
|
||||
if(!file_exists($config['has_installed'])) {
|
||||
sql_open();
|
||||
|
||||
|
||||
// Build all boards
|
||||
$boards = listBoards();
|
||||
|
Loading…
Reference in New Issue
Block a user