mirror of
https://github.com/processwire/processwire.git
synced 2025-08-25 07:41:30 +02:00
Fix issue processwire/processwire-issues#336 where markup regions run on SVG output caused problem
This commit is contained in:
@@ -519,8 +519,11 @@ class PageRender extends WireData implements Module, ConfigurableModule {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($this->wire('config')->useMarkupRegions) {
|
if($this->wire('config')->useMarkupRegions) {
|
||||||
|
$contentType = $template->contentType;
|
||||||
|
if(empty($contentType) || stripos($contentType, 'html') !== false) {
|
||||||
$this->populateMarkupRegions($data);
|
$this->populateMarkupRegions($data);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if($data && $cacheAllowed && $cacheFile) $cacheFile->save($data);
|
if($data && $cacheAllowed && $cacheFile) $cacheFile->save($data);
|
||||||
$event->return = $data;
|
$event->return = $data;
|
||||||
@@ -541,7 +544,7 @@ class PageRender extends WireData implements Module, ConfigurableModule {
|
|||||||
*/
|
*/
|
||||||
protected function populateMarkupRegions(&$html) {
|
protected function populateMarkupRegions(&$html) {
|
||||||
|
|
||||||
$pos = stripos($html, '<!DOCTYPE');
|
$pos = stripos($html, '<!DOCTYPE html');
|
||||||
|
|
||||||
if($pos === false) {
|
if($pos === false) {
|
||||||
// if no doctype match, attempt an html tag match
|
// if no doctype match, attempt an html tag match
|
||||||
|
Reference in New Issue
Block a user