Page MenuHomePhorge

D25955.1744872327.diff
No OneTemporary

D25955.1744872327.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,14 @@
}
$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,
+ -15));
+ $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
Thu, Apr 17, 06:45 (17 h, 47 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1279835
Default Alt Text
D25955.1744872327.diff (906 B)

Event Timeline