Collections functions
Encryption functions
General functions
Theme permission functions
Resource functions

mix_filename()

Description

Utility function to scramble a filename

Parameters

ColumnTypeDefaultDescription
$string string - filename to scramble

Return

string

Location

include/migration_functions.php lines 508 to 531

Definition

 
function mix_filename($string)
    {
    global 
$mixcache;
    if(
trim($string) == "")
        {
        return 
"";
        }
    if(isset(
$mixcache[md5($string)]))
        {
        return 
$mixcache[md5($string)];
        }

    
debug("filename: " $string);
    if(
strpos($string,".") === false)
        {
        return 
mix_text($stringfalse);
        }

    
$fileparts pathinfo($string);
    
$newfilename mix_text($fileparts["filename"], false) . "." $fileparts["extension"];

    
debug("New filename: " $newfilename);
    return 
$newfilename;
    }

This article was last updated 7th July 2020 09:35 Europe/London time based on the source file dated 24th June 2020 15:23 Europe/London time.