Skip to content

Commit a966e74

Browse files
authored
Update index.php
1 parent 5897203 commit a966e74

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

public/index.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,10 @@ function cleanArray($didYouMeans){
178178
$FileAll = (new \Nette\PhpGenerator\Extractor(file_get_contents($file)))->extractAll();
179179
$code = (new \Nette\PhpGenerator\PsrPrinter)->printFile($FileAll);
180180

181+
if(isset($_SERVER['HTTP_X_SOURCE_ENCODING']) && 'b64' === $_SERVER['HTTP_X_SOURCE_ENCODING'] ){
182+
$code = base64_encode($code);
183+
}
184+
181185
header('Content-Type: text/plain');
182186

183187

@@ -258,6 +262,10 @@ function cleanArray($didYouMeans){
258262
$outPut = file_get_contents($file);
259263
}
260264

265+
if(isset($_SERVER['HTTP_X_SOURCE_ENCODING']) && 'b64' === $_SERVER['HTTP_X_SOURCE_ENCODING'] ){
266+
$outPut = base64_encode($outPut);
267+
}
268+
261269

262270
header('Content-Type: text/plain');
263271

0 commit comments

Comments
 (0)