Skip to content

Commit 3fc37b2

Browse files
authored
Merge pull request #1342 from nextcloud/throw-exceptions-not-printable
Don't print exception message in HTML
2 parents f6c7b4e + f715b5e commit 3fc37b2

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

apps/dav/lib/Files/BrowserErrorPagePlugin.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,6 @@
3131
use Sabre\DAV\ServerPlugin;
3232

3333
class BrowserErrorPagePlugin extends ServerPlugin {
34-
3534
/** @var Server */
3635
private $server;
3736

@@ -88,8 +87,7 @@ public function logException(\Exception $ex) {
8887

8988
/**
9089
* @codeCoverageIgnore
91-
* @param \Exception $ex
92-
* @param int $httpCode
90+
* @param \Exception $exception
9391
* @return bool|string
9492
*/
9593
public function generateBody(\Exception $exception) {
@@ -109,10 +107,11 @@ public function generateBody(\Exception $exception) {
109107
return $content->fetchPage();
110108
}
111109

112-
/*
110+
/**
113111
* @codeCoverageIgnore
114112
*/
115113
public function sendResponse() {
116114
$this->server->sapi->sendResponse($this->server->httpResponse);
115+
exit();
117116
}
118117
}

apps/dav/templates/exception.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<?php
22
/**
3-
4-
*
53
* @author Thomas Müller <thomas.mueller@tmit.eu>
64
*
75
* @license GNU AGPL version 3 or any later version
@@ -21,10 +19,11 @@
2119
*
2220
*/
2321
style('core', ['styles', 'header']);
22+
23+
/** @param $_ array */
2424
?>
2525
<span class="error error-wide">
2626
<h2><strong><?php p($_['title']) ?></strong></h2>
27-
<p><?php p($_['message']) ?></p>
2827
<br>
2928

3029
<h2><strong><?php p($l->t('Technical details')) ?></strong></h2>

0 commit comments

Comments
 (0)