summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2010-12-22 12:03:14 -0800
committerEvan Prodromou <evan@status.net>2010-12-22 12:03:14 -0800
commita01742244e192bf8a251f8e11404a4d56364b87b (patch)
tree85b2920da3ab01d0daed3cc448d84cd00199d7e7
parent3e82000d578cf5f5935d972a26c84fe31768460a (diff)
parent055630516c5d47be62078e4798095e5dac5c71e9 (diff)
Merge branch '0.9.x' of gitorious.org:statusnet/mainline into 0.9.x
-rw-r--r--actions/backupaccount.php2
-rw-r--r--actions/restoreaccount.php14
2 files changed, 12 insertions, 4 deletions
diff --git a/actions/backupaccount.php b/actions/backupaccount.php
index 9454741f0..4f6fb936b 100644
--- a/actions/backupaccount.php
+++ b/actions/backupaccount.php
@@ -97,7 +97,7 @@ class BackupaccountAction extends Action
function handle($argarray=null)
{
- parent::handle($args);
+ parent::handle($argarray);
if ($this->isPost()) {
$this->sendFeed();
diff --git a/actions/restoreaccount.php b/actions/restoreaccount.php
index c33756d48..5c8e4a12c 100644
--- a/actions/restoreaccount.php
+++ b/actions/restoreaccount.php
@@ -95,7 +95,7 @@ class RestoreaccountAction extends Action
function handle($argarray=null)
{
- parent::handle($args);
+ parent::handle($argarray);
if ($this->isPost()) {
$this->restoreAccount();
@@ -143,6 +143,7 @@ class RestoreaccountAction extends Action
return;
case UPLOAD_ERR_NO_FILE:
// No file; probably just a non-AJAX submission.
+ throw new ClientException(_('No uploaded file.'));
return;
case UPLOAD_ERR_NO_TMP_DIR:
// TRANS: Client exception thrown when a temporary folder is not present to store a file upload.
@@ -185,12 +186,19 @@ class RestoreaccountAction extends Action
// This check is costly but we should probably give
// the user some info ahead of time.
+ $doc = new DOMDocument();
- $doc = DOMDocument::loadXML($xml);
+ // Disable PHP warnings so we don't spew low-level XML errors to output...
+ // would be nice if we can just get exceptions instead.
+ $old_err = error_reporting();
+ error_reporting($old_err & ~E_WARNING);
+ $doc->loadXML($xml);
+ error_reporting($old_err);
$feed = $doc->documentElement;
- if ($feed->namespaceURI != Activity::ATOM ||
+ if (!$feed ||
+ $feed->namespaceURI != Activity::ATOM ||
$feed->localName != 'feed') {
throw new ClientException(_("Not an atom feed."));
}