Escape SSI virtual in generated response
This commit is contained in:
parent
f940d92a32
commit
18624270bb
@ -188,10 +188,8 @@ class Ssi implements SurrogateInterface
|
||||
throw new \RuntimeException('Unable to process an SSI tag without a "virtual" attribute.');
|
||||
}
|
||||
|
||||
return sprintf('<?php echo $this->surrogate->handle($this, \'%s\', \'%s\', %s) ?>' . "\n",
|
||||
$options['virtual'],
|
||||
'',
|
||||
'false'
|
||||
return sprintf('<?php echo $this->surrogate->handle($this, %s, \'\', false) ?>' . "\n",
|
||||
var_export($options['virtual'], true)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
@ -101,6 +101,11 @@ class SsiTest extends \PHPUnit_Framework_TestCase
|
||||
|
||||
$this->assertEquals('foo <?php echo $this->surrogate->handle($this, \'...\', \'\', false) ?>'."\n", $response->getContent());
|
||||
$this->assertEquals('SSI', $response->headers->get('x-body-eval'));
|
||||
|
||||
$response = new Response('foo <!--#include virtual="foo\'" -->');
|
||||
$ssi->process($request, $response);
|
||||
|
||||
$this->assertEquals("foo <?php echo \$this->surrogate->handle(\$this, 'foo\\'', '', false) ?>"."\n", $response->getContent());
|
||||
}
|
||||
|
||||
public function testProcessEscapesPhpTags()
|
||||
|
Reference in New Issue
Block a user