summaryrefslogtreecommitdiff
path: root/post.php
diff options
context:
space:
mode:
authorMarcin Łabanowski <marcin@6irc.net>2015-04-22 05:54:48 +0200
committerMarcin Łabanowski <marcin@6irc.net>2015-04-22 06:06:34 +0200
commit4014682882d0b390dc099d05e6701521e5f64a31 (patch)
tree0863af973c7d856d55f8d165c96cfdf599b389de /post.php
parent4060bf10eda3b17513907332890575566cf6e890 (diff)
fileboard support
Diffstat (limited to 'post.php')
-rw-r--r--post.php17
1 files changed, 15 insertions, 2 deletions
diff --git a/post.php b/post.php
index 2b903b1c..5081845f 100644
--- a/post.php
+++ b/post.php
@@ -312,7 +312,12 @@ if (isset($_POST['delete'])) {
$url_without_params = $post['file_url'];
$post['extension'] = strtolower(mb_substr($url_without_params, mb_strrpos($url_without_params, '.') + 1));
- if (!in_array($post['extension'], $config['allowed_ext']) && !in_array($post['extension'], $config['allowed_ext_files']))
+
+ if ($post['op'] && $config['allowed_ext_op']) {
+ if (!in_array($post['extension'], $config['allowed_ext_op']))
+ error($config['error']['unknownext']);
+ }
+ else if (!in_array($post['extension'], $config['allowed_ext']) && !in_array($post['extension'], $config['allowed_ext_files']))
error($config['error']['unknownext']);
$post['file_tmp'] = tempnam($config['tmp'], 'url');
@@ -536,6 +541,10 @@ if (isset($_POST['delete'])) {
"\n<tinyboard flag alt>" . $flag_alt . "</tinyboard>";
}
+ if ($config['allowed_tags'] && $_POST['op'] && isset($_POST['tag']) && isset($config['allowed_tags'][$_POST['tag']])) {
+ $post['body'] .= "\n<tinyboard tag>" . $_POST['tag'] . "</tinyboard>";
+ }
+
if ($config['proxy_save'] && isset($_SERVER['HTTP_X_FORWARDED_FOR'])) {
$proxy = preg_replace("/[^0-9a-fA-F.,: ]/", '', $_SERVER['HTTP_X_FORWARDED_FOR']);
$post['body'] .= "\n<tinyboard proxy>".$proxy."</tinyboard>";
@@ -565,7 +574,11 @@ if (isset($_POST['delete'])) {
if ($post['has_file']) {
$fnarray = array();
foreach ($post['files'] as $key => &$file) {
- if (!in_array($file['extension'], $config['allowed_ext']) && !in_array($file['extension'], $config['allowed_ext_files']))
+ if ($post['op'] && $config['allowed_ext_op']) {
+ if (!in_array($file['extension'], $config['allowed_ext_op']))
+ error($config['error']['unknownext']);
+ }
+ elseif (!in_array($file['extension'], $config['allowed_ext']) && !in_array($file['extension'], $config['allowed_ext_files']))
error($config['error']['unknownext']);
$file['is_an_image'] = !in_array($file['extension'], $config['allowed_ext_files']);