array( 'name' => 'Secure attributes contents', 'desc' => 'Will check for url scheme and url content in href and src against malicious content', 'default' => true, ), 'enclose_text' => array( 'name' => 'Enclose text', 'desc' => 'Enclose text which is not in any element in

tags?', 'default' => true, ), 'auto_br' => array( 'name' => 'Auto-format line breaks', 'desc' => 'Will transform line breaks in
tags and double breaks in new

tag', 'default' => true, ), 'encoding' => array( 'name' => 'Encoding', 'desc' => '', 'default' => 'UTF-8', ), 'remove_forbidden_tags' => array( 'name' => 'Remove forbidden tags', 'desc' => 'If enabled, tags who are not allowed will be deleted, if disabled, they will be escaped.', 'default' => false, ), ); foreach ($options as $key=>$data) { if (is_bool($data['default'])) { $g2x->{$key} = isset($_POST[$key]) ? (bool) $_POST[$key] : $data['default']; } elseif (is_string($data['default'])) { $g2x->{$key} = isset($_POST[$key]) ? (string) trim($_POST[$key]) : $data['default']; } } if (!empty($_POST['text'])) { if (get_magic_quotes_gpc()) { $_POST['text'] = stripslashes($_POST['text']); } echo '

HTML code filtered:

';
    echo htmlspecialchars($g2x->Process($_POST['text']), ENT_QUOTES, 'UTF-8');
    echo '
'; } echo '
Options
'; foreach ($options as $key=>$data) { echo '
'.htmlspecialchars($data['name'], ENT_QUOTES, 'UTF-8').'
'; if (!empty($data['desc'])) echo '
'.htmlspecialchars($data['desc'], ENT_QUOTES, 'UTF-8').'
'; if (is_bool($data['default'])) { echo '
'; } elseif ($key == 'encoding') { $values = array('UTF-8', 'ISO-8859-15'); echo '
'; } } echo '
Contenu

'; ?>