Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
41 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
{"php":"7.1.3","version":"2.14.2:v2.14.2#ff401e58261ffc5934a58f795b3f95b355e276cb","rules":{"blank_line_after_namespace":true,"braces":true,"class_definition":true,"elseif":true,"function_declaration":true,"indentation_type":true,"line_ending":true,"lowercase_constants":true,"lowercase_keywords":true,"method_argument_space":{"on_multiline":"ensure_fully_multiline"},"no_break_comment":true,"no_closing_tag":true,"no_spaces_after_function_name":true,"no_spaces_inside_parenthesis":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_class_element_per_statement":{"elements":["property"]},"single_import_per_statement":true,"single_line_after_imports":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"visibility_required":true,"encoding":true,"full_opening_tag":true},"hashes":{"src\\DOMNodeRecursiveIterator.php":-686522259,"src\\htmlStrip.php":-2048634141,"src\\beforeStrip.php":-91041789,"src\\prepareStrip.php":64860972,"tests\\NamedArgsTest.php":254555693,"src\\htmlstripHelper.php":1910840005,"tests\\htmlStripTest.php":2020517432,"src\\htmlStripHelper.php":1393751100,"htmlstriptestinBrowser.php":-70126872}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<?php | ||
|
||
|
||
$DIR=__DIR__.DIRECTORY_SEPARATOR.'src'.DIRECTORY_SEPARATOR; | ||
foreach (array('DOMNodeRecursiveIterator','beforeStrip','prepareStrip','htmlStripHelper','htmlStrip') as $file) { | ||
require_once($DIR.$file.'.php'); | ||
} | ||
|
||
use EZAMA\htmlStrip; | ||
|
||
$x='<script type="text/javascript" async="" src="./Transitioning%20from%20Data%20Developer%20to%20Data%20Scientist%20-%20Statistics%20for%20Data%20Science_files/f.txt"></script>'; | ||
$data='aaaaa<?php echo here ; ?><!doctype><html><head>'.$x.'</head><!-- a comment --> <body> <?php echo here ; ?> <h2 onmousedown="alert(\'keke\');">u</h2><p></p><h2>a</h2></body></html>b2b2 '; | ||
|
||
$hstrip=new htmlStrip($data, 'replace', array('<h2>',false)); | ||
var_dump($hstrip->go()===strip_tags($data, '<h2>'));//true | ||
|
||
|
||
$hstrip=new htmlStrip($data); | ||
var_dump($hstrip->go()===strip_tags($data));//true | ||
|
||
$hstrip=new htmlStrip($data, 'replace', array('',true), array('src',true)); | ||
var_dump((bool)stripos($hstrip->go(htmlStrip::ATTRIBUTES), 'src'));//false | ||
|
||
$hstrip=new htmlStrip($data, 'replace', array('',true), array('src',false)); | ||
var_dump((bool)stripos($hstrip->go(htmlStrip::ATTRIBUTES), 'type'));//false | ||
var_dump((bool)stripos($hstrip->go(htmlStrip::ATTRIBUTES), 'src'),htmlspecialchars($hstrip->go(htmlStrip::ATTRIBUTES)));//true; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters