Mercurial > hg > isophonics-drupal-site
comparison vendor/symfony/http-kernel/HttpCache/Ssi.php @ 17:129ea1e6d783
Update, including to Drupal core 8.6.10
author | Chris Cannam |
---|---|
date | Thu, 28 Feb 2019 13:21:36 +0000 |
parents | 4c8ae668cc8c |
children |
comparison
equal
deleted
inserted
replaced
16:c2387f117808 | 17:129ea1e6d783 |
---|---|
56 if (empty($type)) { | 56 if (empty($type)) { |
57 $type = 'text/html'; | 57 $type = 'text/html'; |
58 } | 58 } |
59 | 59 |
60 $parts = explode(';', $type); | 60 $parts = explode(';', $type); |
61 if (!in_array($parts[0], $this->contentTypes)) { | 61 if (!\in_array($parts[0], $this->contentTypes)) { |
62 return $response; | 62 return $response; |
63 } | 63 } |
64 | 64 |
65 // we don't use a proper XML parser here as we can have SSI tags in a plain text response | 65 // we don't use a proper XML parser here as we can have SSI tags in a plain text response |
66 $content = $response->getContent(); | 66 $content = $response->getContent(); |
68 $chunks = preg_split('#<!--\#include\s+(.*?)\s*-->#', $content, -1, PREG_SPLIT_DELIM_CAPTURE); | 68 $chunks = preg_split('#<!--\#include\s+(.*?)\s*-->#', $content, -1, PREG_SPLIT_DELIM_CAPTURE); |
69 $chunks[0] = str_replace($this->phpEscapeMap[0], $this->phpEscapeMap[1], $chunks[0]); | 69 $chunks[0] = str_replace($this->phpEscapeMap[0], $this->phpEscapeMap[1], $chunks[0]); |
70 | 70 |
71 $i = 1; | 71 $i = 1; |
72 while (isset($chunks[$i])) { | 72 while (isset($chunks[$i])) { |
73 $options = array(); | 73 $options = []; |
74 preg_match_all('/(virtual)="([^"]*?)"/', $chunks[$i], $matches, PREG_SET_ORDER); | 74 preg_match_all('/(virtual)="([^"]*?)"/', $chunks[$i], $matches, PREG_SET_ORDER); |
75 foreach ($matches as $set) { | 75 foreach ($matches as $set) { |
76 $options[$set[1]] = $set[2]; | 76 $options[$set[1]] = $set[2]; |
77 } | 77 } |
78 | 78 |