Collections functions
General functions
Render 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 71 to 82

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 29th May 2022 06:35 Europe/London time based on the source file dated 18th May 2022 11:55 Europe/London time.