From d4e460c5e95c8ddee182482a0c05d272d4264a7c Mon Sep 17 00:00:00 2001 From: Benjamin Southall Date: Sun, 5 Mar 2017 02:18:28 +0900 Subject: [PATCH] Initial implementation of Feature Req: board-independent file size management #4. Using ['board_specific'][['uri']]['max_filesize'] as maximum file size if avaliable otherwise using config['max_filesize'] as default --- post.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/post.php b/post.php index 824d6855..2179b083 100644 --- a/post.php +++ b/post.php @@ -638,8 +638,17 @@ if (isset($_POST['delete'])) { } else { error(_('Unrecognized file size determination method.')); } + $max_size = $config['max_filesize']; - if ($size > $config['max_filesize']) + if (array_key_exists('board_specific',$config)){ + if (array_key_exists($board['uri'],$config['board_specific'])){ + if (array_key_exists('max_filesize',$config['board_specific'][$board['uri']])){ + $max_size = $config['board_specific'][$board['uri']]['max_filesize']; + } + } + } + + if ($size > $max_size) error(sprintf3($config['error']['filesize'], array( 'sz' => number_format($size), 'filesz' => number_format($size),