예제 #1
0
/**
 * Cleans HTML text filter
 * @param string $html			HTML to clean
 * @param int $mode (optional)
 * @return string				The cleaned HTML
 */
function html_filter($html, $mode = NO_HTML)
{
    $allowed_tags = HTML_QuickForm_Rule_HTML::get_allowed_tags($mode);
    //$cleaned_html = kses($html, $allowed_tags);
    return $html;
    return $cleaned_html;
}
/**
 * Cleans HTML text
 * @param string $html                        HTML to clean
 * @param int $mode (optional)
 * @return string                                The cleaned HTML
 */
function html_filter($html, $mode = NO_HTML)
{
    require_once api_get_path(LIBRARY_PATH) . 'formvalidator/Rule/HTML.php';
    $allowed_tags = HTML_QuickForm_Rule_HTML::get_allowed_tags($mode);
    $cleaned_html = kses($html, $allowed_tags);
    return $cleaned_html;
}
?>
">
<div style="margin:10px;">
<div style="text-align:right;"><a href="javascript: window.close();"><?php 
echo get_lang('Close');
?>
</a></div>
<h4>
<?php 
echo get_lang('AllowedHTMLTags');
?>
</h4>
<?php 
$html_type = $_SESSION['status'] == COURSEMANAGER ? TEACHER_HTML : STUDENT_HTML;
$fullpage = intval($_GET['fullpage']) != 0;
$tags = HTML_QuickForm_Rule_HTML::get_allowed_tags($html_type, $fullpage);
$table_header = array();
$table_header[] = array('tag', true);
$table_header[] = array('attributes', false);
foreach ($tags as $tag => &$attributes) {
    $row = array();
    $row[] = '<kbd>' . $tag . '</kbd>';
    $row[] = '<kbd>&nbsp;' . implode(', ', array_keys($attributes)) . '</kbd>';
    $table_data[] = $row;
}
Display::display_sortable_table($table_header, $table_data, array(), array(), array('fullpage' => intval($_GET['fullpage'])));
?>
<div style="text-align:right;"><a href="javascript: window.close();"><?php 
echo get_lang('Close');
?>
</a></div>
예제 #4
0
/**
 * Cleans HTML text
 * @param string $html HTML to clean
 * @param int $mode (optional)
 * @return string The cleaned HTML
 */
function html_filter($html, $mode = NO_HTML)
{
    $allowedTags = HTML_QuickForm_Rule_HTML::get_allowed_tags($mode);
    $filter = new StripTags($allowedTags);
    $cleanedHtml = $filter->filter($html);
    return $cleanedHtml;
}