summaryrefslogtreecommitdiff
path: root/modules/gallery/helpers/l10n_client.php
diff options
context:
space:
mode:
authorcolings <colings@example.com>2011-02-13 10:46:43 -0600
committercolings <colings@example.com>2011-02-13 10:46:43 -0600
commitd759d47ef99ebde158620f43ab46a83f445d9e53 (patch)
tree4b4f9a53d721ac02e8762d9c543ad479faa97bae /modules/gallery/helpers/l10n_client.php
parent02a349f68ac480d5b1a630e14b4f2e3558328673 (diff)
parentd2c77fd0590501f7b6b51d9f4cc033ed9485b082 (diff)
Merge remote branch 'upstream/master'
Diffstat (limited to 'modules/gallery/helpers/l10n_client.php')
-rw-r--r--modules/gallery/helpers/l10n_client.php25
1 files changed, 17 insertions, 8 deletions
diff --git a/modules/gallery/helpers/l10n_client.php b/modules/gallery/helpers/l10n_client.php
index 8c2685a8..6d580249 100644
--- a/modules/gallery/helpers/l10n_client.php
+++ b/modules/gallery/helpers/l10n_client.php
@@ -1,7 +1,7 @@
<?php defined("SYSPATH") or die("No direct script access.");
/**
* Gallery - a web based photo album viewer and editor
- * Copyright (C) 2000-2010 Bharat Mediratta
+ * Copyright (C) 2000-2011 Bharat Mediratta
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -55,15 +55,24 @@ class l10n_client_Core {
$url = self::_server_url("status");
$signature = self::_sign($version, $api_key);
- list ($response_data, $response_status) = remote::post(
- $url, array("version" => $version,
- "client_token" => l10n_client::client_token(),
- "signature" => $signature,
- "uid" => l10n_client::server_uid($api_key)));
+ try {
+ list ($response_data, $response_status) = remote::post(
+ $url, array("version" => $version,
+ "client_token" => l10n_client::client_token(),
+ "signature" => $signature,
+ "uid" => l10n_client::server_uid($api_key)));
+ } catch (ErrorException $e) {
+ // Log the error, but then return a "can't make connection" error
+ Kohana_Log::add("error", $e->getMessage() . "\n" . $e->getTraceAsString());
+ }
+ if (!isset($response_data) && !isset($response_status)) {
+ return array(false, false);
+ }
+
if (!remote::success($response_status)) {
- return false;
+ return array(true, false);
}
- return true;
+ return array(true, true);
}
/**