cvs: pear /Text_Wiki/Text/Wiki/Render/Xhtml Url.php
| From: | Paul Jones | Date: | Mon, 14 Jun 2004 01:48:08 +0000 |
| Subject: | cvs: pear /Text_Wiki/Text/Wiki/Render/Xhtml Url.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-20612@lists.php.net to get a copy of this message | ||
pmjones Sun Jun 13 21:48:08 2004 EDT
Modified files:
/pear/Text_Wiki/Text/Wiki/Render/Xhtml Url.php
Log:
apply htmlspecialchars() to $href, $target, and $text
http://cvs.php.net/diff.php/pear/Text_Wiki/Text/Wiki/Render/Xhtml/Url.php?r1=1.1&r2=1.2&ty=u
Index: pear/Text_Wiki/Text/Wiki/Render/Xhtml/Url.php
diff -u pear/Text_Wiki/Text/Wiki/Render/Xhtml/Url.php:1.1
pear/Text_Wiki/Text/Wiki/Render/Xhtml/Url.php:1.2
--- pear/Text_Wiki/Text/Wiki/Render/Xhtml/Url.php:1.1 Sun Jun 6 11:44:35 2004
+++ pear/Text_Wiki/Text/Wiki/Render/Xhtml/Url.php Sun Jun 13 21:48:07 2004
@@ -33,6 +33,7 @@
// extension.
$pos = strrpos($href, '.');
$ext = strtolower(substr($href, $pos + 1));
+ $href = htmlspecialchars($href);
// does the filename extension indicate an image file?
if ($this->getConf('images') &&
@@ -41,6 +42,7 @@
// create alt text for the image
if (! isset($text) || $text == '') {
$text = basename($href);
+ $text = htmlspecialchars($text);
}
// generate an image tag
@@ -51,11 +53,12 @@
// allow for alternative targets
$target = $this->getConf('target', '');
if ($target) {
- $target = 'target="$target"';
+ $target = ' target="' . htmlspecialchars($target) . '"';
}
// generate a regular link (not an image)
- $output = "<a $target href=\"$href\">$text</a>";
+ $text = htmlspecialchars($text);
+ $output = "<a$target href=\"$href\">$text</a>";
// make numbered references look like footnotes
if ($type == 'footnote') {