Skip to content
This repository was archived by the owner on Nov 25, 2020. It is now read-only.

Commit 95c31ff

Browse files
committed
Make sure to flush ob if writing to php://output and output_buffering is enabled.
1 parent ba4f624 commit 95c31ff

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

core/src/core/classes/class.AJXP_MetaStreamWrapper.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,10 @@ public static function copyFileInStream($path, $stream)
241241
{
242242
$wrapper = self::findSubWrapperClassName($path);
243243
call_user_func(array($wrapper, "copyFileInStream"), self::translateScheme($path), $stream);
244+
$meta = stream_get_meta_data($stream);
245+
if(isSet($meta["uri"]) && $meta["uri"] === "php://output" && intval(ini_get("output_buffering")) > 0){
246+
ob_end_flush();
247+
}
244248
}
245249

246250
/**

core/src/plugins/meta.git/class.GitManager.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,9 @@ public function applyActions($actionName, $httpVars, $fileVars)
146146
$outputStream = fopen("php://output", "a");
147147
$this->executeCommandInStreams($git, $commandLine, $outputStream);
148148
fclose($outputStream);
149+
if(intval(ini_get("output_buffering")) > 0){
150+
ob_end_flush();
151+
}
149152
break;
150153

151154
break;

0 commit comments

Comments
 (0)