Merge pull request #1906 from nextcloud/downstream-26460
Remove any detailed information about the exception in the browser er…
This commit is contained in:
commit
fa4bf7b0b0
|
@ -80,28 +80,19 @@ class BrowserErrorPagePlugin extends ServerPlugin {
|
|||
}
|
||||
$this->server->httpResponse->addHeaders($headers);
|
||||
$this->server->httpResponse->setStatus($httpCode);
|
||||
$body = $this->generateBody($ex);
|
||||
$body = $this->generateBody();
|
||||
$this->server->httpResponse->setBody($body);
|
||||
$this->sendResponse();
|
||||
}
|
||||
|
||||
/**
|
||||
* @codeCoverageIgnore
|
||||
* @param \Exception $exception
|
||||
* @return bool|string
|
||||
*/
|
||||
public function generateBody(\Exception $exception) {
|
||||
public function generateBody() {
|
||||
$request = \OC::$server->getRequest();
|
||||
$content = new OC_Template('dav', 'exception', 'guest');
|
||||
$content->assign('title', $this->server->httpResponse->getStatusText());
|
||||
$content->assign('message', $exception->getMessage());
|
||||
$content->assign('errorClass', get_class($exception));
|
||||
$content->assign('errorMsg', $exception->getMessage());
|
||||
$content->assign('errorCode', $exception->getCode());
|
||||
$content->assign('file', $exception->getFile());
|
||||
$content->assign('line', $exception->getLine());
|
||||
$content->assign('trace', $exception->getTraceAsString());
|
||||
$content->assign('debugMode', \OC::$server->getSystemConfig()->getValue('debug', false));
|
||||
$content->assign('remoteAddr', $request->getRemoteAddress());
|
||||
$content->assign('requestID', $request->getId());
|
||||
return $content->fetchPage();
|
||||
|
|
|
@ -30,18 +30,5 @@ style('core', ['styles', 'header']);
|
|||
<ul>
|
||||
<li><?php p($l->t('Remote Address: %s', $_['remoteAddr'])) ?></li>
|
||||
<li><?php p($l->t('Request ID: %s', $_['requestID'])) ?></li>
|
||||
<?php if($_['debugMode']): ?>
|
||||
<li><?php p($l->t('Type: %s', $_['errorClass'])) ?></li>
|
||||
<li><?php p($l->t('Code: %s', $_['errorCode'])) ?></li>
|
||||
<li><?php p($l->t('Message: %s', $_['errorMsg'])) ?></li>
|
||||
<li><?php p($l->t('File: %s', $_['file'])) ?></li>
|
||||
<li><?php p($l->t('Line: %s', $_['line'])) ?></li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
|
||||
<?php if($_['debugMode']): ?>
|
||||
<br />
|
||||
<h2><strong><?php p($l->t('Trace')) ?></strong></h2>
|
||||
<pre><?php p($_['trace']) ?></pre>
|
||||
<?php endif; ?>
|
||||
</span>
|
||||
|
|
Loading…
Reference in New Issue