Page MenuHomePhorge

D25955.1744646499.diff
No OneTemporary

D25955.1744646499.diff

diff --git a/src/aphront/handler/PhabricatorDefaultRequestExceptionHandler.php b/src/aphront/handler/PhabricatorDefaultRequestExceptionHandler.php
--- a/src/aphront/handler/PhabricatorDefaultRequestExceptionHandler.php
+++ b/src/aphront/handler/PhabricatorDefaultRequestExceptionHandler.php
@@ -42,7 +42,13 @@
}
$class = get_class($throwable);
- $message = $throwable->getMessage();
+
+ // Include last location in error message: Get absolute Phorge path, strip
+ // its /webroot, and remove it as path prefix not to expose server details
+ $root_dir_len = strlen(substr(realpath($_SERVER['DOCUMENT_ROOT']), 0, -8));
+ $filename = substr($throwable->getFile(), $root_dir_len);
+ $message = $throwable->getMessage().' at ['.$filename.':'.
+ $throwable->getLine().']';
if ($throwable instanceof AphrontSchemaQueryException) {
$message .= "\n\n".pht(

File Metadata

Mime Type
text/plain
Expires
Mon, Apr 14, 16:01 (1 d, 14 h ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1279790
Default Alt Text
D25955.1744646499.diff (898 B)

Event Timeline