Collections functions
General functions
Node functions
Render functions
Theme permission functions
User 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 19th March 2024 08:35 Europe/London time based on the source file dated 18th March 2024 12:09 Europe/London time.