Collections functions
Encryption functions
General functions
Theme permission functions
Resource functions

isPathWhitelisted()

Description

Checks if a path is part of a whitelisted list of paths. This applies to both folders and files.

Note: the function is not supposed to check/ validate the syntax of the path (ie. UNIX/ Windows)

Parameters

ColumnTypeDefaultDescription
$path string Path which is going to be checked against whitelisted paths
$whitelisted_paths array List of whitelisted paths

Return

boolean

Location

include/file_functions.php lines 70 to 81

Definition

 
function isPathWhitelisted($path, array $whitelisted_paths)
    {
    foreach(
$whitelisted_paths as $whitelisted_path)
        {
        if(
substr_compare($whitelisted_path$path0strlen($path)) === 0)
            {
            return 
true;
            }
        }

    return 
false;
    }

This article was last updated 15th July 2020 06:35 Europe/London time based on the source file dated 22nd April 2020 14:54 Europe/London time.