Page MenuHomePhorge

D25955.1744736724.diff
No OneTemporary

D25955.1744736724.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,18 @@
}
$class = get_class($throwable);
- $message = $throwable->getMessage();
+
+ if (PhabricatorEnv::getEnvConfig('phabricator.developer-mode')) {
+ // Include last location in error: Get absolute path, strip /phorge/
+ // /webroot, and remove it as path prefix not to expose full server path
+ $root_dir_len = strlen(substr(realpath($_SERVER['DOCUMENT_ROOT']), 0,
+ -14));
+ $filename = substr($throwable->getFile(), $root_dir_len);
+ $message = '"'.$throwable->getMessage().'" at ['.$filename.':'.
+ $throwable->getLine().']';
+ } else {
+ $message = $throwable->getMessage();
+ }
if ($throwable instanceof AphrontSchemaQueryException) {
$message .= "\n\n".pht(

File Metadata

Mime Type
text/plain
Expires
Tue, Apr 15, 17:05 (13 h, 28 m ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1281047
Default Alt Text
D25955.1744736724.diff (1 KB)

Event Timeline