Linux anchor 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64
Apache/2.4.18 (Ubuntu)
Server IP : 10.10.100.4 & Your IP : 216.73.217.150
Domains :
Cant Read [ /etc/named.conf ]
User : www-data
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
var /
www /
wiki.bernardino.org /
tests /
parser /
Delete
Unzip
Name
Size
Permission
Date
Action
preprocess
[ DIR ]
drwxr-xr-x
2016-11-28 20:20
DbTestPreviewer.php
6.2
KB
-rw-r--r--
2016-11-28 20:20
DbTestRecorder.php
2.28
KB
-rw-r--r--
2016-11-28 20:20
DjVuSupport.php
1.71
KB
-rw-r--r--
2016-11-28 20:20
MultiTestRecorder.php
1.26
KB
-rw-r--r--
2016-11-28 20:20
ParserTestParserHook.php
2.14
KB
-rw-r--r--
2016-11-28 20:20
ParserTestPrinter.php
8.26
KB
-rw-r--r--
2016-11-28 20:20
ParserTestResult.php
890
B
-rw-r--r--
2016-11-28 20:20
ParserTestResultNormalizer.php
2.49
KB
-rw-r--r--
2016-11-28 20:20
ParserTestRunner.php
46.14
KB
-rw-r--r--
2016-11-28 20:20
PhpunitTestRecorder.php
325
B
-rw-r--r--
2016-11-28 20:20
README
362
B
-rw-r--r--
2016-11-28 20:20
TestFileReader.php
8.35
KB
-rw-r--r--
2016-11-28 20:20
TestRecorder.php
2.19
KB
-rw-r--r--
2016-11-28 20:20
TidySupport.php
2.58
KB
-rw-r--r--
2016-11-28 20:20
extraParserTests.txt
1.21
KB
-rw-r--r--
2016-11-28 20:20
fuzzTest.php
4.91
KB
-rw-r--r--
2016-11-28 20:20
parserTest.inc
33.83
KB
-rw-r--r--
2012-01-03 18:02
parserTests.php
6.98
KB
-rw-r--r--
2016-11-28 20:20
parserTests.txt
762.31
KB
-rw-r--r--
2016-11-28 20:20
parserTestsParserHook.php
1.32
KB
-rw-r--r--
2011-02-09 18:36
parserTestsStaticParserHook.php
1.9
KB
-rw-r--r--
2011-06-17 18:05
Save
Rename
<?php /** * @file * @ingroup Testing */ class ParserTestResultNormalizer { protected $doc, $xpath, $invalid; public static function normalize( $text, $funcs ) { $norm = new self( $text ); if ( $norm->invalid ) { return $text; } foreach ( $funcs as $func ) { $norm->$func(); } return $norm->serialize(); } protected function __construct( $text ) { $this->doc = new DOMDocument( '1.0', 'utf-8' ); // Note: parsing a supposedly XHTML document with an XML parser is not // guaranteed to give accurate results. For example, it may introduce // differences in the number of line breaks in <pre> tags. MediaWiki\suppressWarnings(); if ( !$this->doc->loadXML( '<html><body>' . $text . '</body></html>' ) ) { $this->invalid = true; } MediaWiki\restoreWarnings(); $this->xpath = new DOMXPath( $this->doc ); $this->body = $this->xpath->query( '//body' )->item( 0 ); } protected function removeTbody() { foreach ( $this->xpath->query( '//tbody' ) as $tbody ) { while ( $tbody->firstChild ) { $child = $tbody->firstChild; $tbody->removeChild( $child ); $tbody->parentNode->insertBefore( $child, $tbody ); } $tbody->parentNode->removeChild( $tbody ); } } /** * The point of this function is to produce a normalized DOM in which * Tidy's output matches the output of html5depurate. Tidy both trims * and pretty-prints, so this requires fairly aggressive treatment. * * In particular, note that Tidy converts <pre>x</pre> to <pre>\nx\n</pre>, * which theoretically affects display since the second line break is not * ignored by compliant HTML parsers. * * This function also removes empty elements, as does Tidy. */ protected function trimWhitespace() { foreach ( $this->xpath->query( '//text()' ) as $child ) { if ( strtolower( $child->parentNode->nodeName ) === 'pre' ) { // Just trim one line break from the start and end if ( substr_compare( $child->data, "\n", 0 ) === 0 ) { $child->data = substr( $child->data, 1 ); } if ( substr_compare( $child->data, "\n", -1 ) === 0 ) { $child->data = substr( $child->data, 0, -1 ); } } else { // Trim all whitespace $child->data = trim( $child->data ); } if ( $child->data === '' ) { $child->parentNode->removeChild( $child ); } } } /** * Serialize the XML DOM for comparison purposes. This does not generate HTML. */ protected function serialize() { return strtr( $this->doc->saveXML( $this->body ), [ '<body>' => '', '</body>' => '' ] ); } }