mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-08 05:18:40 +00:00
Add result optimization for html
This commit is contained in:
parent
7c24bdbbcc
commit
79f5b646dc
|
|
@ -140,6 +140,12 @@ class Response extends ResponseAbstract implements RenderableInterface
|
||||||
throw new \Exception('Wrong response type');
|
throw new \Exception('Wrong response type');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$types = $this->header->get('Content-Type');
|
||||||
|
|
||||||
|
if(in_array(MimeType::M_HTML, $types)) {
|
||||||
|
return trim(preg_replace('/(\s{2,}|\n)(?![^<>]*<\/pre>)/', ' ', $render);
|
||||||
|
}
|
||||||
|
|
||||||
return $render;
|
return $render;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user