summaryrefslogtreecommitdiffstats
path: root/lib/public/util.php
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2014-01-29 16:33:27 +0100
committerRobin Appelman <icewind@owncloud.com>2014-01-29 16:33:27 +0100
commit4e2b52a376d2aab5e0f9d0034a8e2bfa196c08bd (patch)
tree78094fbe60703eae8e4eb1d5d7a42d249a515f21 /lib/public/util.php
parentfc5f20112efe03b203978c4b1045ed70c2ce5e74 (diff)
parentf5f918b8bf5279fd174fe520c21f83c902904843 (diff)
downloadnextcloud-server-4e2b52a376d2aab5e0f9d0034a8e2bfa196c08bd.tar.gz
nextcloud-server-4e2b52a376d2aab5e0f9d0034a8e2bfa196c08bd.zip
merge master into fileinfo
Diffstat (limited to 'lib/public/util.php')
-rw-r--r--lib/public/util.php13
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/public/util.php b/lib/public/util.php
index 9f945f0feac..0a003fbfe92 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) {
@@ -254,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;