cvs: phd / package.xml /themes/php phpdotnet.php

From: Date: Fri, 11 Jan 2008 19:55:01 +0000
Subject: cvs: phd / package.xml /themes/php phpdotnet.php
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-1029@lists.php.net to get a copy of this message
bjori Fri Jan 11 19:55:01 2008 UTC Modified files: /phd package.xml /phd/themes/php phpdotnet.php Log: - Fixed bug#43440 (Wrong encoding on some parts of the page) http://cvs.php.net/viewvc.cgi/phd/package.xml?r1=1.27&r2=1.28&diff_format=u Index: phd/package.xml diff -u phd/package.xml:1.27 phd/package.xml:1.28 --- phd/package.xml:1.27 Thu Jan 10 21:37:59 2008 +++ phd/package.xml Fri Jan 11 19:55:01 2008 @@ -27,6 +27,7 @@ - Removed support for phnotify - Fixed E_NOTICE on empty references - Fixed bug#43489 (Class synopsis return types are not links) + - Fixed bug#43440 (Wrong encoding on some parts of the page) - Fixed bug#43428 (Empty TOC) - Fixed bug#43421 (All intra-document hyperlinks broken in the Single HTML file form of manual) - Added index chaching (Edward Z.) http://cvs.php.net/viewvc.cgi/phd/themes/php/phpdotnet.php?r1=1.36&r2=1.37&diff_format=u Index: phd/themes/php/phpdotnet.php diff -u phd/themes/php/phpdotnet.php:1.36 phd/themes/php/phpdotnet.php:1.37 --- phd/themes/php/phpdotnet.php:1.36 Thu Jan 10 21:37:59 2008 +++ phd/themes/php/phpdotnet.php Fri Jan 11 19:55:01 2008 @@ -1,5 +1,5 @@ <?php -/* $Id: phpdotnet.php,v 1.36 2008/01/10 21:37:59 bjori Exp $ */ +/* $Id: phpdotnet.php,v 1.37 2008/01/11 19:55:01 bjori Exp $ */ abstract class phpdotnet extends PhDTheme { protected $elementmap = array( @@ -485,20 +485,23 @@ public function qandaset($stream) { $xml = stream_get_contents($stream); - libxml_use_internal_errors(true); + $old = libxml_use_internal_errors(true); $doc = new DOMDocument("1.0", "UTF-8"); $doc->preserveWhitespace = false; - $doc->loadHTML(html_entity_decode('<div>' .str_replace("&lt;", "&amp;lt;", $xml) .'</div>', ENT_QUOTES, "UTF-8")); + $doc->loadXML(html_entity_decode(str_replace("&", "&amp;amp;", "<div>$xml</div>"), ENT_QUOTES, "UTF-8")); + if ($err = libxml_get_errors()) { + print_r($err); + libxml_clear_errors(); + } fclose($stream); - libxml_clear_errors(); - libxml_use_internal_errors(false); + libxml_use_internal_errors($old); $xpath = new DOMXPath($doc); - $nlist = $xpath->query("//html/body/div/dl/dt"); + $nlist = $xpath->query("//div/dl/dt"); $ret = '<div class="qandaset"><ol class="qandaset_questions">'; $i = 0; foreach($nlist as $node) { - $ret .= '<li><a href="#' .($this->tmp["qandaentry"][$i++]). '">' .(htmlspecialchars($node->textContent,ENT_QUOTES, "UTF-8")). '</a></li>'; + $ret .= '<li><a href="#' .($this->tmp["qandaentry"][$i++]). '">' .($node->textContent). '</a></li>'; } return $ret.'</ul>'.$xml.'</div>';

« previous php.doc.cvs (#1029) next »