summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/api.php4
-rw-r--r--lib/snapshot.php8
-rw-r--r--lib/util.php5
3 files changed, 14 insertions, 3 deletions
diff --git a/lib/api.php b/lib/api.php
index a6aea5d6d..d21851d50 100644
--- a/lib/api.php
+++ b/lib/api.php
@@ -140,12 +140,14 @@ class ApiAction extends Action
// Note: some profiles don't have an associated user
+ $defaultDesign = Design::siteDesign();
+
if (!empty($user)) {
$design = $user->getDesign();
}
if (empty($design)) {
- $design = Design::siteDesign();
+ $design = $defaultDesign;
}
$color = Design::toWebColor(empty($design->backgroundcolor) ? $defaultDesign->backgroundcolor : $design->backgroundcolor);
diff --git a/lib/snapshot.php b/lib/snapshot.php
index 2a10c6b93..a16087ac0 100644
--- a/lib/snapshot.php
+++ b/lib/snapshot.php
@@ -173,8 +173,12 @@ class Snapshot
// XXX: Use OICU2 and OAuth to make authorized requests
$reporturl = common_config('snapshot', 'reporturl');
- $request = HTTPClient::start();
- $request->post($reporturl, null, $this->stats);
+ try {
+ $request = HTTPClient::start();
+ $request->post($reporturl, null, $this->stats);
+ } catch (Exception $e) {
+ common_log(LOG_WARNING, "Error in snapshot: " . $e->getMessage());
+ }
}
/**
diff --git a/lib/util.php b/lib/util.php
index 50bd0e2ac..a4281121e 100644
--- a/lib/util.php
+++ b/lib/util.php
@@ -119,6 +119,11 @@ function common_language()
function common_munge_password($password, $id)
{
+ if (is_object($id) || is_object($password)) {
+ $e = new Exception();
+ common_log(LOG_ERR, __METHOD__ . ' object in param to common_munge_password ' .
+ str_replace("\n", " ", $e->getTraceAsString()));
+ }
return md5($password . $id);
}