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);
|
$PDF = new PDFExport($app, $printer->get_elements(), $layout);
|
||||||
|
|
||||||
/**
|
$response = new Response($PDF->render(), 200, array('Content-Type' => 'application/pdf'));
|
||||||
*
|
$response->headers->set('Pragma', 'public', true);
|
||||||
* Header "Pragma: public" SHOULD be present.
|
$response->setMaxAge(0);
|
||||||
* 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");
|
|
||||||
}
|
|
||||||
|
|
||||||
return new Response($PDF->render(), 200, array('Content-Type' => 'application/pdf'));
|
return $response;
|
||||||
});
|
});
|
||||||
|
|
||||||
return $controllers;
|
return $controllers;
|
||||||
|
@@ -787,25 +787,18 @@ class set_export extends set_abstract
|
|||||||
);
|
);
|
||||||
$response->headers->set('X-Sendfile', $file);
|
$response->headers->set('X-Sendfile', $file);
|
||||||
$response->headers->set('X-Accel-Redirect', $file_xaccel);
|
$response->headers->set('X-Accel-Redirect', $file_xaccel);
|
||||||
|
|
||||||
$response->headers->set('Pragma', 'public', true);
|
$response->headers->set('Pragma', 'public', true);
|
||||||
|
$response->setMaxAge(0);
|
||||||
|
|
||||||
$response->headers->set('Content-Type', $mime);
|
$response->headers->set('Content-Type', $mime);
|
||||||
$response->headers->set('Content-Length', filesize($file));
|
$response->headers->set('Content-Length', filesize($file));
|
||||||
$response->headers->set('Content-Disposition', $headerDisposition);
|
$response->headers->set('Content-Disposition', $headerDisposition);
|
||||||
|
|
||||||
return $response;
|
return $response;
|
||||||
} else {
|
} else {
|
||||||
/**
|
$response->headers->set('Pragma', 'public', true);
|
||||||
*
|
$response->setMaxAge(0);
|
||||||
* 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('Content-Type', $mime);
|
$response->headers->set('Content-Type', $mime);
|
||||||
$response->headers->set('Content-Length', filesize($file));
|
$response->headers->set('Content-Length', filesize($file));
|
||||||
|
@@ -2049,7 +2049,7 @@
|
|||||||
<field>
|
<field>
|
||||||
<name>destfolder</name>
|
<name>destfolder</name>
|
||||||
<type>char(255)</type>
|
<type>char(255)</type>
|
||||||
<null></null>
|
<null>YES</null>
|
||||||
<extra></extra>
|
<extra></extra>
|
||||||
|
|
||||||
|
|
||||||
@@ -2108,7 +2108,7 @@
|
|||||||
<field>
|
<field>
|
||||||
<name>foldertocreate</name>
|
<name>foldertocreate</name>
|
||||||
<type>char(255)</type>
|
<type>char(255)</type>
|
||||||
<null></null>
|
<null>YES</null>
|
||||||
<extra></extra>
|
<extra></extra>
|
||||||
<default></default>
|
<default></default>
|
||||||
<comment></comment>
|
<comment></comment>
|
||||||
|
@@ -56,6 +56,9 @@ class ControllerPrinterTest extends \PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
$this->assertEquals("application/pdf", $response->headers->get("content-type"));
|
$this->assertEquals("application/pdf", $response->headers->get("content-type"));
|
||||||
|
|
||||||
$this->assertTrue($response->isOk());
|
$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