Added support for BSD md5 incase md5sum isn't available.

This commit is contained in:
Ian Bradley 2014-09-15 16:33:37 -07:00
parent 39cecea579
commit c1ecef3772
2 changed files with 18 additions and 2 deletions

View File

@ -751,6 +751,13 @@
// Display the file's original filename. // Display the file's original filename.
$config['show_filename'] = true; $config['show_filename'] = true;
// WebM Settings
$config['webm']['use_ffmpeg'] = false;
$config['webm']['allow_audio'] = false;
$config['webm']['max_length'] = 120;
$config['webm']['ffmpeg_path'] = 'ffmpeg';
$config['webm']['ffprobe_path'] = 'ffprobe';
// Display image identification links for ImgOps, regex.info/exif, Google Images and iqdb. // Display image identification links for ImgOps, regex.info/exif, Google Images and iqdb.
$config['image_identification'] = false; $config['image_identification'] = false;
// Which of the identification links to display. Only works if $config['image_identification'] is true. // Which of the identification links to display. Only works if $config['image_identification'] is true.
@ -760,6 +767,9 @@
// Anime/manga search engine. // Anime/manga search engine.
$config['image_identification_iqdb'] = false; $config['image_identification_iqdb'] = false;
// Set this to true if you're using a BSD
$config['bsd_md5'] = false;
// Number of posts in a "View Last X Posts" page // Number of posts in a "View Last X Posts" page
$config['noko50_count'] = 50; $config['noko50_count'] = 50;
// Number of posts a thread needs before it gets a "View Last X Posts" page. // Number of posts a thread needs before it gets a "View Last X Posts" page.
@ -1032,6 +1042,10 @@
$config['error']['unknownext'] = _('Unknown file extension.'); $config['error']['unknownext'] = _('Unknown file extension.');
$config['error']['filesize'] = _('Maximum file size: %maxsz% bytes<br>Your file\'s size: %filesz% bytes'); $config['error']['filesize'] = _('Maximum file size: %maxsz% bytes<br>Your file\'s size: %filesz% bytes');
$config['error']['maxsize'] = _('The file was too big.'); $config['error']['maxsize'] = _('The file was too big.');
$config['error']['webmerror'] = _('There was a problem processing your webm.');
$config['error']['invalidwebm'] = _('Invalid webm uploaded.');
$config['error']['webmhasaudio'] = _('The uploaded webm contains an audio or another type of additional stream.');
$config['error']['webmtoolong'] = _('The uploaded webm is longer than ' . $config['webm']['max_length'] . ' seconds.');
$config['error']['fileexists'] = _('That file <a href="%s">already exists</a>!'); $config['error']['fileexists'] = _('That file <a href="%s">already exists</a>!');
$config['error']['fileexistsinthread'] = _('That file <a href="%s">already exists</a> in this thread!'); $config['error']['fileexistsinthread'] = _('That file <a href="%s">already exists</a> in this thread!');
$config['error']['delete_too_soon'] = _('You\'ll have to wait another %s before deleting that.'); $config['error']['delete_too_soon'] = _('You\'ll have to wait another %s before deleting that.');
@ -1039,6 +1053,7 @@
$config['error']['invalid_embed'] = _('Couldn\'t make sense of the URL of the video you tried to embed.'); $config['error']['invalid_embed'] = _('Couldn\'t make sense of the URL of the video you tried to embed.');
$config['error']['captcha'] = _('You seem to have mistyped the verification.'); $config['error']['captcha'] = _('You seem to have mistyped the verification.');
// Moderator errors // Moderator errors
$config['error']['toomanyunban'] = _('You are only allowed to unban %s users at a time. You tried to unban %u users.'); $config['error']['toomanyunban'] = _('You are only allowed to unban %s users at a time. You tried to unban %u users.');
$config['error']['invalid'] = _('Invalid username and/or password.'); $config['error']['invalid'] = _('Invalid username and/or password.');

View File

@ -566,7 +566,9 @@ if (isset($_POST['delete'])) {
error($config['error']['nomove']); error($config['error']['nomove']);
} }
if ($output = shell_exec_error("cat $filenames | md5sum")) { $md5cmd = $config['bsd_md5'] ? 'md5 -r' : 'md5sum';
if ($output = shell_exec_error("cat $filenames | $md5cmd")) {
$explodedvar = explode(' ', $output); $explodedvar = explode(' ', $output);
$hash = $explodedvar[0]; $hash = $explodedvar[0];
$post['filehash'] = $hash; $post['filehash'] = $hash;
@ -925,4 +927,3 @@ if (isset($_POST['delete'])) {
error($config['error']['nopost']); error($config['error']['nopost']);
} }
} }