diff options
| author | Benjamin Southall <applemansigloo@gmail.com> | 2017-03-05 02:18:28 +0900 |
|---|---|---|
| committer | Benjamin Southall <applemansigloo@gmail.com> | 2017-03-05 02:18:28 +0900 |
| commit | f36222c0e90dfffc50102bcd75e1af96221d8d7e (patch) | |
| tree | 3d4b9f8eba2b67ecd3f828dc696b272c8a6fc27b /post.php | |
| parent | f3a5eb094079b8a2184e62ac6c727c36da658abd (diff) | |
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
Diffstat (limited to 'post.php')
| -rw-r--r-- | post.php | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -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), |
