API16

JFilterInput/checkAttribute

From Joomla! Documentation

< API16:JFilterInput

The "API16" namespace is an archived namespace. This page contains information for a Joomla! version which is no longer supported. It exists only as a historical reference, it will not be improved and its content may be incomplete and/or contain broken links.

Description[edit]

Function to determine if contents of an attribute is safe


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

Syntax[edit]

static checkAttribute($attrSubSet)
Parameter Name Default Value Description
$attrSubSet A 2 element array for attributes name,value

Returns[edit]

boolean True if bad code is detected

Defined in[edit]

libraries/joomla/filter/filterinput.php

Importing[edit]

jimport( 'joomla.filter.filterinput' );

Source Body[edit]

public static function checkAttribute($attrSubSet)
{
        $attrSubSet[0] = strtolower($attrSubSet[0]);
        $attrSubSet[1] = strtolower($attrSubSet[1]);
        return (((strpos($attrSubSet[1], 'expression') !== false) && ($attrSubSet[0]) == 'style') || (strpos($attrSubSet[1], 'javascript:') !== false) || (strpos($attrSubSet[1], 'behaviour:') !== false) || (strpos($attrSubSet[1], 'vbscript:') !== false) || (strpos($attrSubSet[1], 'mocha:') !== false) || (strpos($attrSubSet[1], 'livescript:') !== false));
}


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

Examples[edit]

Code Examples[edit]