Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #31 from vrana/master

Invalid escaping in renderBaseAttrs
  • Loading branch information...
commit 17f05e1ecc6a92d756c4510f05321506be84797a 2 parents 0ff0c6d + 0a99f67
@scottmac scottmac authored
Showing with 10 additions and 1 deletion.
  1. +1 −1  php-lib/html.php
  2. +9 −0 tests/attr-quotes.phpt
View
2  php-lib/html.php
@@ -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;
View
9 tests/attr-quotes.phpt
@@ -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>
Please sign in to comment.
Something went wrong with that request. Please try again.