API16

API16:JFolder/makeSafe

From Joomla! Documentation

Description

Makes path name safe to use.


<! removed transcluded page call, red link never existed >

Syntax

makeSafe($path)
Parameter Name Default Value Description
$path The full path to sanitise.

Returns

string The sanitised string.

Defined in

libraries/joomla/filesystem/folder.php

Importing

jimport( 'joomla.filesystem.folder' );

Source Body

function makeSafe($path)
{
        //$ds = (DS == '\\') ? '\\' . DS : DS;
        $regex = array('#[^A-Za-z0-9:_\\\/-]#');
        return preg_replace($regex, '', $path);
}


<! removed transcluded page call, red link never existed >

Examples

Code Examples