You are here

function file_unmunge_filename in Drupal 9

Same name and namespace in other branches
  1. 8 core/includes/file.inc \file_unmunge_filename()
  2. 6 includes/file.inc \file_unmunge_filename()
  3. 7 includes/file.inc \file_unmunge_filename()

Undoes the effect of file_munge_filename().

Parameters

$filename: String with the filename to be unmunged.

Return value

An unmunged filename string.

Deprecated

in drupal:9.2.0 and is removed from drupal:10.0.0. Use str_replace() instead.

See also

https://www.drupal.org/node/3032541

Related topics

1 call to file_unmunge_filename()
NameMungingTest::testUnMunge in core/tests/Drupal/KernelTests/Core/File/NameMungingTest.php
Ensure that unmunge gets your name back.

File

core/includes/file.inc, line 211
API for handling file uploads and server file management.

Code

function file_unmunge_filename($filename) {
  @trigger_error('file_unmunge_filename() is deprecated in drupal:9.2.0 and is removed from drupal:10.0.0. Use str_replace() instead. See https://www.drupal.org/node/3032541', E_USER_DEPRECATED);
  return str_replace('_.', '.', $filename);
}