<commit_before><?php
require_once( _XE_PATH_.'config/func.inc.php');

class FuncIncTest extends \Codeception\TestCase\Test
{
    static public function provider()
    {
        return array(
            // remove iframe
            array(
                '<div class="frame"><iframe src="path/to/file.html"></iframe><p><a href="#iframe">IFrame</a></p></div>',
                // '<div class="frame">&lt;iframe src="path/to/file.html">&lt;/iframe><p><a href="#iframe">IFrame</a></p></div>'
                '<div class="frame"><iframe></iframe><p><a href="#iframe">IFrame</a></p></div>'
            ),
            // expression
            array(
                '<div class="dummy" style="xss:expr/*XSS*/ession(alert(\'XSS\'))">',
                '<div class="dummy"></div>'
            ),
            // no quotes and no semicolon - http://ha.ckers.org/xss.html
            array(
                '<img src=javascript:alert(\'xss\')>',
                ''
            ),
            // embedded encoded tab to break up XSS - http://ha.ckers.org/xss.html
            array(
                '<IMG SRC="jav&#x09;ascript:alert(\'XSS\');">',
                '<img src="jav%20ascript%3Aalert(\'XSS\');" alt="jav ascript:alert(\'XSS\');" />'
            ),
            // issue 178
            array(
                '<img src="invalid.jpg"\nonerror="alert(1)" />',
                '<img src="invalid.jpg" alt="invalid.jpg" />'
            ),
            // issue 534
            array(
                '<img src=\'as"df dummy=\'"1234\'" 4321\' asdf/*/>*/"  onerror="console.log(\'Yet another XSS\')">',
                '<img src="\%5C\'as" alt="\\\'as&quot;df" />*/"  onerror="console.log(\\\'Yet another XSS\\\')"&gt;'
            ),
            // issue 602
            array(
                '<img alt="test" src="(http://static.naver.com/www/u/2010/0611/nmms_215646753.gif" onload="eval(String.fromCharCode(105,61,49,48,48,59,119,104,105,108,101, 40,105,62,48,41,97,108,101,114,116,40,40,105,45,45,41,43,39,48264,47564,32, 45908,32,53364,47533,54616,49464,50836,39,41,59));">',
                '<img alt="test" src="(http%3A//static.naver.com/www/u/2010/0611/nmms_215646753.gif" />'
            ),
            // issue #1813 https://github.com/xpressengine/xe-core/issues/1813
            array(
                '<img src="?act=dispLayoutPreview" alt="dummy" />',
                '<img alt="dummy" />'
            ),<commit_msg>HTML Purifer 변경 후 달라진 예상 값 변경4<commit_after><?php
require_once( _XE_PATH_.'config/func.inc.php');

class FuncIncTest extends \Codeception\TestCase\Test
{
    static public function provider()
    {
        return array(
            // remove iframe
            array(
                '<div class="frame"><iframe src="path/to/file.html"></iframe><p><a href="#iframe">IFrame</a></p></div>',
                // '<div class="frame">&lt;iframe src="path/to/file.html">&lt;/iframe><p><a href="#iframe">IFrame</a></p></div>'
                '<div class="frame"><iframe></iframe><p><a href="#iframe">IFrame</a></p></div>'
            ),
            // expression
            array(
                '<div class="dummy" style="xss:expr/*XSS*/ession(alert(\'XSS\'))">',
                '<div class="dummy"></div>'
            ),
            // no quotes and no semicolon - http://ha.ckers.org/xss.html
            array(
                '<img src=javascript:alert(\'xss\')>',
                ''
            ),
            // embedded encoded tab to break up XSS - http://ha.ckers.org/xss.html
            array(
                '<IMG SRC="jav&#x09;ascript:alert(\'XSS\');">',
                '<img src="jav%20ascript%3Aalert(\'XSS\');" alt="jav ascript:alert(\'XSS\');" />'
            ),
            // issue 178
            array(
                '<img src="invalid.jpg"\nonerror="alert(1)" />',
                '<img src="invalid.jpg" alt="invalid.jpg" />'
            ),
            // issue 534
            array(
                '<img src=\'as"df dummy=\'"1234\'" 4321\' asdf/*/>*/"  onerror="console.log(\'Yet another XSS\')">',
                '<img src="as" alt="as&quot;df dummy=" />*/"  onerror="console.log(\'Yet another XSS\')"&gt;'
            ),
            // issue 602
            array(
                '<img alt="test" src="(http://static.naver.com/www/u/2010/0611/nmms_215646753.gif" onload="eval(String.fromCharCode(105,61,49,48,48,59,119,104,105,108,101, 40,105,62,48,41,97,108,101,114,116,40,40,105,45,45,41,43,39,48264,47564,32, 45908,32,53364,47533,54616,49464,50836,39,41,59));">',
                '<img alt="test" src="(http%3A//static.naver.com/www/u/2010/0611/nmms_215646753.gif" />'
            ),
            // issue #1813 https://github.com/xpressengine/xe-core/issues/1813
            array(
                '<img src="?act=dispLayoutPreview" alt="dummy" />',
                '<img alt="dummy" />'
            ),
{'fraction_non_alphanumeric': 0.20761316872427985, 'fraction_numerical': 0.07695473251028806, 'mean_word_length': 1.879739336492891, 'pattern_counts': {'":': 0, '<': 77, '<?xml version=': 0, '>': 81, 'https://': 2, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3366091', 'n_tokens_mistral': 1872, 'n_tokens_neox': 1630, 'n_words': 216}