diff options
author | Pellaeon Lin <nfsmwlin@gmail.com> | 2014-01-30 22:50:20 +0800 |
---|---|---|
committer | Pellaeon Lin <nfsmwlin@gmail.com> | 2014-01-30 22:50:20 +0800 |
commit | 099b71c712c38de7dac7e386252da02bb0cadf12 (patch) | |
tree | 84bcf83efdc4cc759a5ff184fa5148195abaab51 /lib/public/util.php | |
parent | 929c930b0afd682bb98eb389d7ebad91bb34d643 (diff) | |
parent | 299a8285bd2601ccbac988b2e3e9b067d47921a2 (diff) | |
download | nextcloud-server-099b71c712c38de7dac7e386252da02bb0cadf12.tar.gz nextcloud-server-099b71c712c38de7dac7e386252da02bb0cadf12.zip |
Merge branch 'master' into pr-exceed_upload_limit_msg
Conflicts:
apps/files/templates/index.php
apps/files_sharing/templates/public.php
Diffstat (limited to 'lib/public/util.php')
-rw-r--r-- | lib/public/util.php | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/lib/public/util.php b/lib/public/util.php index cf7ac63ba51..d8497e29cfc 100644 --- a/lib/public/util.php +++ b/lib/public/util.php @@ -88,14 +88,18 @@ class Util { * @param Exception $ex exception to log */ public static function logException( $app, \Exception $ex ) { - $message = $ex->getMessage(); + $class = get_class($ex); + if ($class !== 'Exception') { + $message = $class . ': '; + } + $message .= $ex->getMessage(); if ($ex->getCode()) { $message .= ' [' . $ex->getCode() . ']'; } \OCP\Util::writeLog($app, 'Exception: ' . $message, \OCP\Util::FATAL); if (defined('DEBUG') and DEBUG) { // also log stack trace - $stack = explode('#', $ex->getTraceAsString()); + $stack = explode("\n", $ex->getTraceAsString()); // first element is empty array_shift($stack); foreach ($stack as $s) { @@ -103,9 +107,8 @@ class Util { } // include cause - $l = \OC_L10N::get('lib'); while (method_exists($ex, 'getPrevious') && $ex = $ex->getPrevious()) { - $message .= ' - '.$l->t('Caused by:').' '; + $message .= ' - Caused by:' . ' '; $message .= $ex->getMessage(); if ($ex->getCode()) { $message .= '[' . $ex->getCode() . '] '; @@ -255,8 +258,13 @@ class Util { * Example: when given lostpassword-noreply as $user_part param, * and is currently accessed via http(s)://example.com/, * it would return 'lostpassword-noreply@example.com' + * + * If the configuration value 'mail_from_address' is set in + * config.php, this value will override the $user_part that + * is passed to this function */ public static function getDefaultEmailAddress($user_part) { + $user_part = \OC_Config::getValue('mail_from_address', $user_part); $host_name = self::getServerHostName(); $host_name = \OC_Config::getValue('mail_domain', $host_name); $defaultEmailAddress = $user_part.'@'.$host_name; |