* 1.14.0 (2013-XX-XX)
+ * fixed usage of the html_attr escaping strategy to avoid double-escaping with the html strategy
* fixed some compatibility issues with HHVM
* added a way to add custom escaping strategies
* fixed the C extension compilation on Windows
public function getSafe(Twig_NodeInterface $node)
{
$hash = spl_object_hash($node);
- if (isset($this->data[$hash])) {
- foreach ($this->data[$hash] as $bucket) {
- if ($bucket['key'] === $node) {
- return $bucket['value'];
- }
+ if (!isset($this->data[$hash])) {
+ return;
+ }
+
+ foreach ($this->data[$hash] as $bucket) {
+ if ($bucket['key'] !== $node) {
+ continue;
+ }
+
+ if (in_array('html_attr', $bucket['value'])) {
+ $bucket['value'][] = 'html';
}
+
+ return $bucket['value'];
}
}