JFilterInput/checkAttribute: Difference between revisions
From Joomla! Documentation
m clean up |
m preparing for archive only |
||
| Line 42: | Line 42: | ||
===Examples=== | ===Examples=== | ||
=== Code Examples === | |||
<dpl> | <dpl> | ||
noresultsheader=\n | noresultsheader=\n | ||
category=checkAttribute | category=checkAttribute | ||
category=JFilterInput | category=JFilterInput | ||
namespace=CodeExample | |||
category=MethodExample | category=MethodExample | ||
include=* | include=* | ||
Latest revision as of 01:40, 25 March 2017
Description
Function to determine if contents of an attribute is safe
<! removed transcluded page call, red link never existed >
Syntax
static checkAttribute($attrSubSet)
| Parameter Name | Default Value | Description |
|---|---|---|
| $attrSubSet | A 2 element array for attributes name,value |
Returns
boolean True if bad code is detected
Defined in
libraries/joomla/filter/filterinput.php
Importing
jimport( 'joomla.filter.filterinput' );
Source Body
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
Code Examples