Skip to content

Commit 0a887ab

Browse files
committed
check ajax
1 parent 65adee4 commit 0a887ab

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/DIPcms/Scripter/DI/ScripterExtension.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,15 @@ public function beforeCompile(){
123123
* @param Request $request
124124
*/
125125
public static function register_shutdown(Scripter $scripter, Response $response, Request $request){
126-
register_shutdown_function(function()use($scripter, $response){
126+
register_shutdown_function(function()use($scripter, $response, $request){
127127

128128
$page = ob_get_contents();
129129
ob_end_clean();
130130

131131
$header_type = $response->getHeader("Content-Type");
132132

133-
if($header_type && strpos($header_type, "text/html") === 0){
133+
if($header_type && strpos($header_type, "text/html") === 0 && !$request->isAjax()){
134+
134135
$scripter->cache->removeNotUseFile();
135136
preg_match('/(?:<head[^>]*>)(.*?)<\/head>/s', $page, $matches);
136137
if(isset($matches[1])){

0 commit comments

Comments
 (0)