mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 12:05:37 +00:00
Merge pull request #1182 from chillu/pulls/showtemplate-admin-ss3
API Require ADMIN for ?showtemplate=1 (3.0)
This commit is contained in:
commit
b25b6d4769
@ -3,6 +3,14 @@
|
|||||||
## Overview
|
## Overview
|
||||||
|
|
||||||
* Changed `dev/tests/setdb` and `dev/tests/startsession` from session to cookie storage.
|
* Changed `dev/tests/setdb` and `dev/tests/startsession` from session to cookie storage.
|
||||||
|
* Require ADMIN permissions for `?showtemplate=1`
|
||||||
|
|
||||||
|
## Details
|
||||||
|
|
||||||
|
### Require ADMIN permissions for `?showtemplate=1`
|
||||||
|
|
||||||
|
Avoids information leakage of compiled template data,
|
||||||
|
which might expose some of the internal template logic.
|
||||||
|
|
||||||
## Upgrading
|
## Upgrading
|
||||||
|
|
||||||
|
@ -821,7 +821,7 @@ class SSViewer {
|
|||||||
* @return string - The result of executing the template
|
* @return string - The result of executing the template
|
||||||
*/
|
*/
|
||||||
protected function includeGeneratedTemplate($cacheFile, $item, $overlay, $underlay) {
|
protected function includeGeneratedTemplate($cacheFile, $item, $overlay, $underlay) {
|
||||||
if(isset($_GET['showtemplate']) && $_GET['showtemplate']) {
|
if(isset($_GET['showtemplate']) && $_GET['showtemplate'] && Permission::check('ADMIN')) {
|
||||||
$lines = file($cacheFile);
|
$lines = file($cacheFile);
|
||||||
echo "<h2>Template: $cacheFile</h2>";
|
echo "<h2>Template: $cacheFile</h2>";
|
||||||
echo "<pre>";
|
echo "<pre>";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user