cvs: phd /themes/pear pearchunkedhtml.php pearweb.php
| From: | Christian Weiske | Date: | Tue, 28 Oct 2008 18:17:18 +0000 |
| Subject: | cvs: phd /themes/pear pearchunkedhtml.php pearweb.php | ||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-2320@lists.php.net to get a copy of this message | ||
cweiske Tue Oct 28 18:17:18 2008 UTC
Modified files:
/phd/themes/pear pearchunkedhtml.php pearweb.php
Log:
- titles for top prev/next links
- escape titles - yes, pear has titles like <channel>
http://cvs.php.net/viewvc.cgi/phd/themes/pear/pearchunkedhtml.php?r1=1.9&r2=1.10&diff_format=u
Index: phd/themes/pear/pearchunkedhtml.php
diff -u phd/themes/pear/pearchunkedhtml.php:1.9 phd/themes/pear/pearchunkedhtml.php:1.10
--- phd/themes/pear/pearchunkedhtml.php:1.9 Tue Oct 28 17:13:15 2008
+++ phd/themes/pear/pearchunkedhtml.php Tue Oct 28 18:17:18 2008
@@ -5,7 +5,7 @@
* PEAR theme for the normal-html-in-many-files version
*
* @package PhD
-* @version CVS: $Id: pearchunkedhtml.php,v 1.9 2008/10/28 17:13:15 cweiske Exp $
+* @version CVS: $Id: pearchunkedhtml.php,v 1.10 2008/10/28 18:17:18 cweiske Exp $
*/
class pearchunkedhtml extends pearweb
{
@@ -34,7 +34,7 @@
*/
public function header($id)
{
- $title = PhDHelper::getDescription($id);
+ $title = htmlspecialchars(PhDHelper::getDescription($id));
$parent = PhDHelper::getParent($id);
$this->next = $this->prev = $this->up = array(null, null);
$strNext = $strPrev = '';
@@ -54,7 +54,10 @@
$this->next = array(null, null);
}
if ($parent !== 'index' && $parent !== 'ROOT') {
- $this->up = array($parent.".html", PhDHelper::getDescription($parent,
false));
+ $this->up = array(
+ $parent.".html",
+ htmlspecialchars(PhDHelper::getDescription($parent, false))
+ );
}
}
@@ -71,12 +74,12 @@
';
}
if ($this->prev[0]) {
- $strPrev = '<a href="' . $this->prev[0] .
'">Prev</a>';
+ $strPrev = '<a href="' . $this->prev[0] . '"
title="' . $this->prev[1] . '">Prev</a>';
$header .= ' <link rel="prev" href="' . $this->prev[0]
. '" title="' . $this->prev[1] . '" />
';
}
if ($this->next[0]) {
- $strNext = '<a href="' . $this->next[0] .
'">Next</a>';
+ $strNext = '<a href="' . $this->next[0] . '"
title="' . $this->next[1] . '">Next</a>';
$header .= ' <link rel="next" href="' . $this->next[0]
. '" title="' . $this->next[1] . '" />
';
}
http://cvs.php.net/viewvc.cgi/phd/themes/pear/pearweb.php?r1=1.2&r2=1.3&diff_format=u
Index: phd/themes/pear/pearweb.php
diff -u phd/themes/pear/pearweb.php:1.2 phd/themes/pear/pearweb.php:1.3
--- phd/themes/pear/pearweb.php:1.2 Thu Oct 16 21:00:47 2008
+++ phd/themes/pear/pearweb.php Tue Oct 28 18:17:18 2008
@@ -131,7 +131,10 @@
while (!empty($tmp["children"])) {
$tmp = end($tmp["children"]);
}
- return array($tmp["filename"].$ext, (empty($tmp["sdesc"]) ?
$tmp["ldesc"] : $tmp["sdesc"]));
+ return array(
+ $tmp["filename"].$ext,
+ htmlspecialchars(empty($tmp["sdesc"]) ? $tmp["ldesc"] :
$tmp["sdesc"])
+ );
break;
}
@@ -143,7 +146,10 @@
// {{{ Create the "next" link
if (!empty($siblings[$id]["children"])) {
$tmp = reset($siblings[$id]["children"]);
- return array($tmp["filename"].$ext, (empty($tmp["sdesc"]) ?
$tmp["ldesc"] : $tmp["sdesc"]));
+ return array(
+ $tmp["filename"].$ext,
+ htmlspecialchars(empty($tmp["sdesc"]) ? $tmp["ldesc"] :
$tmp["sdesc"])
+ );
}
do {
if (!isset($siblings[$id])) {
@@ -160,7 +166,10 @@
$tmp = current($siblings);
prev($siblings); // Reset the internal pointer to previous pos
if ($tmp) {
- $next = array($tmp["filename"].$ext, (empty($tmp["sdesc"]) ?
$tmp["ldesc"] : $tmp["sdesc"]));
+ $next = array(
+ $tmp["filename"].$ext,
+ htmlspecialchars(empty($tmp["sdesc"]) ? $tmp["ldesc"] :
$tmp["sdesc"])
+ );
break;
}