Permalink
Browse files

Merge pull request #31 from vrana/master

Invalid escaping in renderBaseAttrs
  • Loading branch information...
2 parents 0ff0c6d + 0a99f67 commit 17f05e1ecc6a92d756c4510f05321506be84797a @scottmac scottmac committed Feb 15, 2012
Showing with 10 additions and 1 deletion.
  1. +1 −1 php-lib/html.php
  2. +9 −0 tests/attr-quotes.phpt
View
@@ -65,7 +65,7 @@ public function requireUniqueId() {
$buf = '<'.$this->tagName;
foreach ($this->getAttributes() as $key => $val) {
if ($val !== null && $val !== false) {
- $buf .= ' ' . htmlspecialchars($key) . '="' . htmlspecialchars($val, true) . '"';
+ $buf .= ' ' . htmlspecialchars($key) . '="' . htmlspecialchars($val) . '"';
}
}
return $buf;
@@ -0,0 +1,9 @@
+--TEST--
+Quotes in attribute
+--FILE--
+<?php
+class xhp_a {}
+$quote = '"';
+echo <a b={$quote}>c</a>;
+--EXPECT--
+<a b="&quot;">c</a>

0 comments on commit 17f05e1

Please sign in to comment.