/*!
This operator allows to wash a xml field (XSS...). As an added value, it deals well with shortened xml fields
*/
define ("XML_HTMLSAX3","extension/xmlwash/safehtml/");
require_once( "extension/xmlwash/safehtml/safehtml.php" );
require_once( "extension/xmlwash/classes/teaser.php" );
class XMLWashOperator
{
/*!
Constructor, does nothing by default.
*/
function XMLWashOperator()
{
}
/*!
\return an array with the template operator name.
*/
function operatorList()
{
return array( 'xmlwash' , 'strip_tags', 'teaser' );
}
/*!
\return true to tell the template engine that the parameter list exists per operator type,
this is needed for operator classes that have multiple operators.
*/
function namedParameterPerOperator()
{
return true;
}
/*!
See eZTemplateOperator::namedParameterList
*/
function namedParameterList()
{
return array( 'xmlwash' => array( 'xmlattribute' => array( 'type' => 'attribute',
'required' => false,
'default' => "" ) ),
'strip_tags' => array ('tagskept'=> array ('type' => 'array',
'required' => false,
'default' => array('
') ) ),
'teaser' => array( 'length' => array( 'type' => 'integer',
'required' => false,
'default' => 100 ),
'fuzzyness' => array( 'type' => 'integer',
'required' => false,
'default' => 5 ) ) );
}
/*!
Executes the PHP function for the operator cleanup and modifies \a $operatorValue.
*/
function modify( &$tpl, &$operatorName, &$operatorParameters, &$rootNamespace, &$currentNamespace, &$operatorValue, &$namedParameters )
{
$temp=$operatorValue;
switch ($operatorName) {
case 'xmlwash':
$parser = new SafeHTML();
// eZDebug::writeNotice($temp);
$operatorValue = $parser->parse($temp);
// $operatorValue = $temp;
break;
case 'strip_tags':
$temp=str_replace("
Victoire de la Squadra Corsa aux dépends de la Bulgarie, le 31 mai 2011 au stade Timizzolu à Ajaccio, sur le score d'un but à zéro. Après une première mi-temps...
Le match France-Corse de 1967, joué à Marseille et remporté par les insulaires 2 à 0, raconté par Victor Sinet. Voir la vidéo (source INA via Dailymotion)...
La squadra corsa affrontait une sélection internationale à Ajaccio, au stade François-Coty d'Ajaccio, fin mai 2012. Score final: 2-2. Source France 3 Corse/Via...
Commentaires récents
SIMON, le 11 avril
bonjour, il y a une autre faute sur la devise :il s'agit de "frugifera" et non pas "frugiera". La...
omobigusew, le 25 mars
http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a...
utahijewooym, le 25 mars
http://doxycycline-cheapbuy.site/ - doxycycline-cheapbuy.site.ankor <a...