mirror of
https://github.com/vichan-devel/vichan.git
synced 2024-11-23 23:20:57 +01:00
prohibit original filename from showing up in api when disabled
Makes it so that if $config['show_filename'] = false, it will show $apiPost['tim'] as the filename instead.
This commit is contained in:
parent
33397fa1cf
commit
ed627325ad
@ -89,10 +89,15 @@ class Api {
|
|||||||
|
|
||||||
private function translateFile($file, $post, &$apiPost) {
|
private function translateFile($file, $post, &$apiPost) {
|
||||||
$this->translateFields($this->fileFields, $file, $apiPost);
|
$this->translateFields($this->fileFields, $file, $apiPost);
|
||||||
$apiPost['filename'] = @substr($file->name, 0, strrpos($file->name, '.'));
|
|
||||||
$dotPos = strrpos($file->file, '.');
|
$dotPos = strrpos($file->file, '.');
|
||||||
$apiPost['ext'] = substr($file->file, $dotPos);
|
$apiPost['ext'] = substr($file->file, $dotPos);
|
||||||
$apiPost['tim'] = substr($file->file, 0, $dotPos);
|
$apiPost['tim'] = substr($file->file, 0, $dotPos);
|
||||||
|
if (isset($this->config['show_filename']) && $this->config['show_filename']) {
|
||||||
|
$apiPost['filename'] = @substr($file->name, 0, strrpos($file->name, '.'));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
$apiPost['filename'] = substr($file->file, 0, $dotPos);
|
||||||
|
}
|
||||||
if (isset ($file->hash) && $file->hash) {
|
if (isset ($file->hash) && $file->hash) {
|
||||||
$apiPost['md5'] = base64_encode(hex2bin($file->hash));
|
$apiPost['md5'] = base64_encode(hex2bin($file->hash));
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user