You are here

public static function DropzoneJs::fixTmpFilename in DropzoneJS 8

Same name and namespace in other branches
  1. 8.2 src/Element/DropzoneJs.php \Drupal\dropzonejs\Element\DropzoneJs::fixTmpFilename()

Fix temporary filename.

The upload handler appended the txt extension to the file for security reasons.

Parameters

string $filename: The filename we need to fix.

Return value

string The fixed filename.

1 call to DropzoneJs::fixTmpFilename()
DropzoneJs::valueCallback in src/Element/DropzoneJs.php
Determines how user input is mapped to an element's #value property.

File

src/Element/DropzoneJs.php, line 232

Class

DropzoneJs
Provides a DropzoneJS atop of the file element.

Namespace

Drupal\dropzonejs\Element

Code

public static function fixTmpFilename($filename) {
  $parts = explode('.', $filename);
  array_pop($parts);
  return implode('.', $parts);
}