API15

JFilterInput/checkAttribute

From Joomla! Documentation

< API15:JFilterInput
Revision as of 17:21, 22 March 2010 by Doxiki (talk | contribs) (New page: ===Description=== Function to determine if contents of an attribute is safe <span class="editsection" style="font-size:76%;"> <nowiki>[</nowiki>[[Description:JFilterInput/checkAttribu...)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

The "API15" 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

[Edit Descripton]

Template:Description:JFilterInput/checkAttribute

Syntax[edit]

checkAttribute($attrSubSet)
Parameter Name Default Value Description
$attrSubSet $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]

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));
}

[Edit See Also] Template:SeeAlso:JFilterInput/checkAttribute

Examples[edit]

<CodeExamplesForm />