cvs: phd /themes/php chmsource.php

From: Date: Sun, 15 Feb 2009 19:36:50 +0000
Subject: cvs: phd /themes/php chmsource.php
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-3260@lists.php.net to get a copy of this message
bjori Sun Feb 15 19:36:50 2009 UTC Modified files: /phd/themes/php chmsource.php Log: Fix encoding issues in the Polish manual (probably related to bug#46871) (patch by Jarosław Głowacki) http://cvs.php.net/viewvc.cgi/phd/themes/php/chmsource.php?r1=1.14&r2=1.15&diff_format=u Index: phd/themes/php/chmsource.php diff -u phd/themes/php/chmsource.php:1.14 phd/themes/php/chmsource.php:1.15 --- phd/themes/php/chmsource.php:1.14 Wed Feb 11 05:08:17 2009 +++ phd/themes/php/chmsource.php Sun Feb 15 19:36:50 2009 @@ -1,5 +1,5 @@ <?php -/* $Id: chmsource.php,v 1.14 2009/02/11 05:08:17 cweiske Exp $ */ +/* $Id: chmsource.php,v 1.15 2009/02/15 19:36:50 bjori Exp $ */ require_once $ROOT . '/themes/php/chunkedhtml.php'; class chmsource extends chunkedhtml { @@ -124,7 +124,8 @@ "langcode" => "0x415 Polish", "preferred_charset" => "Windows-1250", "mime_charset_name" => "Windows-1250", - "preferred_font" => self::DEFAULT_FONT + "preferred_font" => self::DEFAULT_FONT, + "title" => "Podręcznik PHP", ), "pt_BR" => array( "langcode" => "0x416 Portuguese (Brazil)", @@ -221,17 +222,20 @@ protected function appendChm($name, $ref, $isChunk, $hasChild) { switch ($isChunk) { - case PhDReader::OPEN_CHUNK : + case PhDReader::OPEN_CHUNK: + $charset = $this->LANGUAGES[PhDConfig::language()]["preferred_charset"]; + $name = htmlspecialchars(iconv('UTF-8', $charset, $name), ENT_QUOTES); + $this->currentTocDepth++; fwrite($this->hhpStream, "{$ref}\n"); fwrite($this->hhcStream, "{$this->offset(1)}<li><object type=\"text/sitemap\">\n" . - "{$this->offset(3)}<param name=\"Name\" value=\"" .htmlentities($name, ENT_QUOTES, 'UTF-8') . "\">\n" . + "{$this->offset(3)}<param name=\"Name\" value=\"" . $name . "\">\n" . "{$this->offset(3)}<param name=\"Local\" value=\"{$ref}\">\n" . "{$this->offset(2)}</object>\n"); if ($hasChild) fwrite($this->hhcStream, "{$this->offset(2)}<ul>\n"); fwrite($this->hhkStream, " <li><object type=\"text/sitemap\">\n" . " <param name=\"Local\" value=\"{$ref}\">\n" . - " <param name=\"Name\" value=\"" . htmlentities($name, ENT_QUOTES, 'UTF-8') . "\">\n" . + " <param name=\"Name\" value=\"" . $name . "\">\n" . " </object>\n </li>\n"); break; case PhDReader::CLOSE_CHUNK : @@ -326,9 +330,12 @@ public function format_varlistentry($open, $name, $attrs) { $this->collectContent($attrs); + $charset = $this->LANGUAGES[PhDConfig::language()]["preferred_charset"]; + $content = htmlspecialchars(iconv('UTF-8', $charset, $this->lastContent["name"]), ENT_QUOTES); + fwrite($this->hhkStream, " <li><object type=\"text/sitemap\">\n" . " <param name=\"Local\" value=\"{$this->lastContent["reference"]}\">\n" . - " <param name=\"Name\" value=\"" . htmlentities($this->lastContent["name"], ENT_QUOTES, 'UTF-8') . "\">\n" . + " <param name=\"Name\" value=\"" . $content . "\">\n" . " </object>\n </li>\n"); return false; }

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