comparison vendor/symfony/http-kernel/HttpCache/AbstractSurrogate.php @ 17:129ea1e6d783

Update, including to Drupal core 8.6.10
author Chris Cannam
date Thu, 28 Feb 2019 13:21:36 +0000
parents 1fec387a4317
children
comparison
equal deleted inserted replaced
16:c2387f117808 17:129ea1e6d783
22 * @author Robin Chalas <robin.chalas@gmail.com> 22 * @author Robin Chalas <robin.chalas@gmail.com>
23 */ 23 */
24 abstract class AbstractSurrogate implements SurrogateInterface 24 abstract class AbstractSurrogate implements SurrogateInterface
25 { 25 {
26 protected $contentTypes; 26 protected $contentTypes;
27 protected $phpEscapeMap = array( 27 protected $phpEscapeMap = [
28 array('<?', '<%', '<s', '<S'), 28 ['<?', '<%', '<s', '<S'],
29 array('<?php echo "<?"; ?>', '<?php echo "<%"; ?>', '<?php echo "<s"; ?>', '<?php echo "<S"; ?>'), 29 ['<?php echo "<?"; ?>', '<?php echo "<%"; ?>', '<?php echo "<s"; ?>', '<?php echo "<S"; ?>'],
30 ); 30 ];
31 31
32 /** 32 /**
33 * @param array $contentTypes An array of content-type that should be parsed for Surrogate information 33 * @param array $contentTypes An array of content-type that should be parsed for Surrogate information
34 * (default: text/html, text/xml, application/xhtml+xml, and application/xml) 34 * (default: text/html, text/xml, application/xhtml+xml, and application/xml)
35 */ 35 */
36 public function __construct(array $contentTypes = array('text/html', 'text/xml', 'application/xhtml+xml', 'application/xml')) 36 public function __construct(array $contentTypes = ['text/html', 'text/xml', 'application/xhtml+xml', 'application/xml'])
37 { 37 {
38 $this->contentTypes = $contentTypes; 38 $this->contentTypes = $contentTypes;
39 } 39 }
40 40
41 /** 41 /**
88 /** 88 /**
89 * {@inheritdoc} 89 * {@inheritdoc}
90 */ 90 */
91 public function handle(HttpCache $cache, $uri, $alt, $ignoreErrors) 91 public function handle(HttpCache $cache, $uri, $alt, $ignoreErrors)
92 { 92 {
93 $subRequest = Request::create($uri, Request::METHOD_GET, array(), $cache->getRequest()->cookies->all(), array(), $cache->getRequest()->server->all()); 93 $subRequest = Request::create($uri, Request::METHOD_GET, [], $cache->getRequest()->cookies->all(), [], $cache->getRequest()->server->all());
94 94
95 try { 95 try {
96 $response = $cache->handle($subRequest, HttpKernelInterface::SUB_REQUEST, true); 96 $response = $cache->handle($subRequest, HttpKernelInterface::SUB_REQUEST, true);
97 97
98 if (!$response->isSuccessful()) { 98 if (!$response->isSuccessful()) {