From 0ea4227d50bf85b65189a62abdf7be2a02ebe7dd Mon Sep 17 00:00:00 2001 From: Trevor Slocum Date: Wed, 12 Sep 2018 14:47:13 -0700 Subject: [PATCH] Rename TINYIB_HIDEFIELDSOP/TINYIB_HIDEFIELDS to / Fixes #75 --- imgboard.php | 4 ++-- inc/defines.php | 12 ++++++------ inc/html.php | 4 ++-- settings.default.php | 4 ++-- 4 files changed, 12 insertions(+), 12 deletions(-) diff --git a/imgboard.php b/imgboard.php index cf1c365..2366619 100644 --- a/imgboard.php +++ b/imgboard.php @@ -87,7 +87,7 @@ if (!isset($_GET['delete']) && !isset($_GET['manage']) && (isset($_POST['name']) } $post = newPost(setParent()); - $hide_fields = $post['parent'] == TINYIB_NEWTHREAD ? TINYIB_HIDEFIELDSOP : TINYIB_HIDEFIELDS; + $hide_fields = $post['parent'] == TINYIB_NEWTHREAD ? $tinyib_hidefieldsop : $tinyib_hidefields; $post['ip'] = $_SERVER['REMOTE_ADDR']; if ($rawpost || !in_array('name', $hide_fields)) { @@ -193,7 +193,7 @@ if (!isset($_GET['delete']) && !isset($_GET['manage']) && (isset($_POST['name']) } $file_info = getimagesize($_FILES['file']['tmp_name']); - $file_mime = mime_content_type($file_location); + $file_mime = mime_content_type($_FILES['file']['tmp_name']); } if (empty($file_mime) || !isset($tinyib_uploads[$file_mime])) { diff --git a/inc/defines.php b/inc/defines.php index d90835b..a60e102 100644 --- a/inc/defines.php +++ b/inc/defines.php @@ -13,12 +13,6 @@ define('TINYIB_WORDBREAK_IDENTIFIER', '@!@TINYIB_WORDBREAK@!@'); if (!defined('TINYIB_INDEX')) { define('TINYIB_INDEX', 'index.html'); } -if (!defined('TINYIB_HIDEFIELDSOP')) { - define('TINYIB_HIDEFIELDSOP', array()); -} -if (!defined('TINYIB_HIDEFIELDS')) { - define('TINYIB_HIDEFIELDS', array()); -} if (!defined('TINYIB_MAXREPLIES')) { define('TINYIB_MAXREPLIES', 0); } @@ -61,6 +55,12 @@ if (!defined('TINYIB_DBDRIVER')) { if (!defined('TINYIB_DBDSN')) { define('TINYIB_DBDSN', ''); } +if (!isset($tinyib_hidefieldsop)) { + $tinyib_hidefieldsop = array(); +} +if (!isset($tinyib_hidefields)) { + $tinyib_hidefields = array(); +} if (!isset($tinyib_uploads)) { $tinyib_uploads = array(); if (defined('TINYIB_PIC') && TINYIB_PIC) { diff --git a/inc/html.php b/inc/html.php index 56004fa..832d6c0 100644 --- a/inc/html.php +++ b/inc/html.php @@ -71,8 +71,8 @@ function makeLinksClickable($text) { } function buildPostForm($parent, $raw_post = false) { - global $tinyib_uploads, $tinyib_embeds; - $hide_fields = $parent == TINYIB_NEWTHREAD ? TINYIB_HIDEFIELDSOP : TINYIB_HIDEFIELDS; + global $tinyib_hidefieldsop, $tinyib_hidefields, $tinyib_uploads, $tinyib_embeds; + $hide_fields = $parent == TINYIB_NEWTHREAD ? $tinyib_hidefieldsop : $tinyib_hidefields; $postform_extra = array('name' => '', 'email' => '', 'subject' => '', 'footer' => ''); $input_submit = ''; diff --git a/settings.default.php b/settings.default.php index 7ec23ea..e92a489 100644 --- a/settings.default.php +++ b/settings.default.php @@ -22,13 +22,13 @@ define('TINYIB_REQMOD', ''); // Require moderation before displaying po // Board appearance define('TINYIB_INDEX', 'index.html'); // Index file define('TINYIB_LOGO', ''); // Logo HTML -define('TINYIB_HIDEFIELDSOP',array());// Fields to hide when creating a new thread - e.g. array('name', 'email', 'subject', 'message', 'file', 'embed', 'password') -define('TINYIB_HIDEFIELDS', array()); // Fields to hide when replying define('TINYIB_THREADSPERPAGE', 10); // Amount of threads shown per index page define('TINYIB_PREVIEWREPLIES', 3); // Amount of replies previewed on index pages define('TINYIB_TRUNCATE', 15); // Messages are truncated to this many lines on board index pages [0 to disable] define('TINYIB_WORDBREAK', 80); // Words longer than this many characters will be broken apart [0 to disable] define('TINYIB_TIMEZONE', 'UTC'); // See https://secure.php.net/manual/en/timezones.php - e.g. America/Los_Angeles +$tinyib_hidefieldsop = array(); // Fields to hide when creating a new thread - e.g. array('name', 'email', 'subject', 'message', 'file', 'embed', 'password') +$tinyib_hidefields = array(); // Fields to hide when replying // Post control define('TINYIB_DELAY', 30); // Delay (in seconds) between posts from the same IP address to help control flooding [0 to disable]