# HG changeset patch # User Tom Fredrik "BFG" Klaussen # Date 1458250489 -3600 # Node ID 374e3eff07fd2be9027bf1d3c74a734bb313cd83 # Parent b9668126e52e795d7835821c47fde769bd34df69# Parent f498ea087d670aad0982357766d98fc5084c8651 Branch merge diff -r f498ea087d67 -r 374e3eff07fd InputParser.inc --- a/InputParser.inc Wed Mar 16 13:02:06 2016 +0100 +++ b/InputParser.inc Thu Mar 17 22:34:49 2016 +0100 @@ -63,9 +63,23 @@ } } $this->master = self::getFiles($this->master, $this->options); + self::removeCommentsFromDOM($this->master); $cache->setMaxAge(0); } + /** + * Removes all comments from the DOM + * + * @param $dom A DOMDocument for processing + */ + static function removeCommentsFromDOM($dom) + { + $xpath = new DOMXPath($dom); + foreach ($xpath->query('//comment()') as $comment) { + $comment->parentNode->removeChild($comment); + } + } + function cacheCheck() { return $this->options->getCacheable();