Collections functions
General functions
Node functions
Render functions
Theme permission functions
User functions
Resource functions

config_clean()

Description

Utility function to "clean" the passed $config. Cleaning consists of two parts:
Suppressing really simple XSS attacks by refusing to allow strings
containing the characters "<script" in upper, lower or mixed case.
Unescaping instances of "'" and '"' that have been escaped by the
lovely magic_quotes_gpc facility, if it's on.

Parameters

ColumnTypeDefaultDescription
$config
mixed $config thing to be cleaned.

Return

a cleaned version of $config.

Location

include/config_functions.php lines 402 to 419

Definition

 
function config_clean($config)
    {
    if (
is_array($config))
        {
        foreach (
$config as &$item)
            {
            
$item config_clean($item);
            }
        }
    elseif (
is_string($config))
        {
        if (
strpos(strtolower($config),"<script") !== false)
            {
            
$config '';
            }
        }
    return 
$config;
    }

This article was last updated 19th March 2024 07:05 Europe/London time based on the source file dated 15th March 2024 17:00 Europe/London time.