Merge branch 'master' of gitorious.org:statusnet/mainline

This commit is contained in:
Evan Prodromou 2011-03-17 09:59:46 -04:00
commit 9a46605227
3 changed files with 18 additions and 5 deletions

View File

@ -322,8 +322,11 @@ class ApiTimelineUserAction extends ApiBareAuthAction
$this->clientError(_('Atom post must not be empty.'));
}
$dom = DOMDocument::loadXML($xml);
if (!$dom) {
$old = error_reporting(error_reporting() & ~(E_WARNING | E_NOTICE));
$dom = new DOMDocument();
$ok = $dom->loadXML($xml);
error_reporting($old);
if (!$ok) {
// TRANS: Client error displayed attempting to post an API that is not well-formed XML.
$this->clientError(_('Atom post must be well-formed XML.'));
}

View File

@ -22,7 +22,7 @@
* @category Applications
* @package StatusNet
* @author Zach Copley <zach@status.net>
* @copyright 2008-2009 StatusNet, Inc.
* @copyright 2008-2011 StatusNet, Inc.
* @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
* @link http://status.net/
*/
@ -290,7 +290,13 @@ class NewApplicationAction extends OwnerDesignAction
$app->query('ROLLBACK');
}
$app->uploadLogo();
try {
$app->uploadLogo();
} catch (Exception $e) {
$app->query('ROLLBACK');
$this->showForm(_('Invalid image.'));
return;
}
$app->query('COMMIT');

View File

@ -282,7 +282,11 @@ class RecoverpasswordAction extends Action
$user = User::staticGet('email', common_canonical_email($nore));
if (!$user) {
$user = User::staticGet('nickname', common_canonical_nickname($nore));
try {
$user = User::staticGet('nickname', common_canonical_nickname($nore));
} catch (NicknameException $e) {
// invalid
}
}
# See if it's an unconfirmed email address