mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 15:33:15 +00:00
Merge with 3.7
This commit is contained in:
@@ -49,20 +49,11 @@ class Printer implements ControllerProviderInterface
|
||||
}
|
||||
$PDF = new PDFExport($app, $printer->get_elements(), $layout);
|
||||
|
||||
/**
|
||||
*
|
||||
* Header "Pragma: public" SHOULD be present.
|
||||
* In case it is not present, download on IE 8 and previous over HTTPS
|
||||
* will fail.
|
||||
*
|
||||
* @todo : merge this shitty fix with Response object.
|
||||
*
|
||||
*/
|
||||
if (!headers_sent()) {
|
||||
header("Pragma: public");
|
||||
}
|
||||
$response = new Response($PDF->render(), 200, array('Content-Type' => 'application/pdf'));
|
||||
$response->headers->set('Pragma', 'public', true);
|
||||
$response->setMaxAge(0);
|
||||
|
||||
return new Response($PDF->render(), 200, array('Content-Type' => 'application/pdf'));
|
||||
return $response;
|
||||
});
|
||||
|
||||
return $controllers;
|
||||
|
@@ -787,25 +787,18 @@ class set_export extends set_abstract
|
||||
);
|
||||
$response->headers->set('X-Sendfile', $file);
|
||||
$response->headers->set('X-Accel-Redirect', $file_xaccel);
|
||||
|
||||
$response->headers->set('Pragma', 'public', true);
|
||||
$response->setMaxAge(0);
|
||||
|
||||
$response->headers->set('Content-Type', $mime);
|
||||
$response->headers->set('Content-Length', filesize($file));
|
||||
$response->headers->set('Content-Disposition', $headerDisposition);
|
||||
|
||||
return $response;
|
||||
} else {
|
||||
/**
|
||||
*
|
||||
* Header "Pragma: public" SHOULD be present.
|
||||
* In case it is not present, download on IE 8 and previous over HTTPS
|
||||
* will fail.
|
||||
*
|
||||
* @todo : merge this shitty fix with Response object.
|
||||
*
|
||||
*/
|
||||
if (!headers_sent()) {
|
||||
header("Pragma: public");
|
||||
}
|
||||
$response->headers->set('Pragma', 'public', true);
|
||||
$response->setMaxAge(0);
|
||||
|
||||
$response->headers->set('Content-Type', $mime);
|
||||
$response->headers->set('Content-Length', filesize($file));
|
||||
|
@@ -2049,7 +2049,7 @@
|
||||
<field>
|
||||
<name>destfolder</name>
|
||||
<type>char(255)</type>
|
||||
<null></null>
|
||||
<null>YES</null>
|
||||
<extra></extra>
|
||||
|
||||
|
||||
@@ -2108,7 +2108,7 @@
|
||||
<field>
|
||||
<name>foldertocreate</name>
|
||||
<type>char(255)</type>
|
||||
<null></null>
|
||||
<null>YES</null>
|
||||
<extra></extra>
|
||||
<default></default>
|
||||
<comment></comment>
|
||||
|
@@ -56,6 +56,9 @@ class ControllerPrinterTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
$this->assertEquals("application/pdf", $response->headers->get("content-type"));
|
||||
|
||||
$this->assertTrue($response->isOk());
|
||||
$this->assertEquals(0, $response->getMaxAge());
|
||||
$this->assertTrue($response->headers->has('pragma'));
|
||||
$this->assertEquals('public', $response->headers->get('pragma'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user