Skip to content

Commit

Permalink
Don't print exception message in HTML
Browse files Browse the repository at this point in the history
The exception message is potentially influenced by user input and could thus be confusing (e.g. somebody could try to open a file like "Please send a mail to support@foo.com", and then the message would include that string.

It is thus reasonable to not show the exception message by default. Also for the browser view I added an `exit()` at the end, as otherwise the XML exception would be attached.
  • Loading branch information
LukasReschke committed Sep 9, 2016
1 parent 36c5547 commit a4cfb3d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
7 changes: 3 additions & 4 deletions apps/dav/lib/files/browsererrorpageplugin.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
use Sabre\DAV\ServerPlugin;

class BrowserErrorPagePlugin extends ServerPlugin {

/** @var Server */
private $server;

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

/**
* @codeCoverageIgnore
* @param \Exception $ex
* @param int $httpCode
* @param \Exception $exception
* @return bool|string
*/
public function generateBody(\Exception $exception) {
Expand All @@ -109,10 +107,11 @@ public function generateBody(\Exception $exception) {
return $content->fetchPage();
}

/*
/**
* @codeCoverageIgnore
*/
public function sendResponse() {
$this->server->sapi->sendResponse($this->server->httpResponse);
exit();
}
}
1 change: 0 additions & 1 deletion apps/dav/templates/exception.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
?>
<span class="error error-wide">
<h2><strong><?php p($_['title']) ?></strong></h2>
<p><?php p($_['message']) ?></p>
<br>

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

0 comments on commit a4cfb3d

Please sign in to comment.