We are no longer offering accounts on this server. Consider https://gitlab.freedesktop.org/ as a place to host projects.

Commit 135b398d authored by Evan Prodromou's avatar Evan Prodromou

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

parents a5de2152 4bbb259b
...@@ -99,32 +99,43 @@ class ApiStatusesDestroyAction extends ApiAuthAction ...@@ -99,32 +99,43 @@ class ApiStatusesDestroyAction extends ApiAuthAction
parent::handle($args); parent::handle($args);
if (!in_array($this->format, array('xml', 'json'))) { if (!in_array($this->format, array('xml', 'json'))) {
$this->clientError(_('API method not found.'), $code = 404); $this->clientError(
return; _('API method not found.'),
404
);
return;
} }
if (!in_array($_SERVER['REQUEST_METHOD'], array('POST', 'DELETE'))) { if (!in_array($_SERVER['REQUEST_METHOD'], array('POST', 'DELETE'))) {
$this->clientError(_('This method requires a POST or DELETE.'), $this->clientError(
400, $this->format); _('This method requires a POST or DELETE.'),
return; 400,
} $this->format
);
if (empty($this->notice)) { return;
$this->clientError(_('No status found with that ID.'), }
404, $this->format);
return; if (empty($this->notice)) {
} $this->clientError(
_('No status found with that ID.'),
if ($this->user->id == $this->notice->profile_id) { 404, $this->format
$replies = new Reply; );
$replies->get('notice_id', $this->notice_id); return;
$replies->delete(); }
$this->notice->delete();
$this->showNotice(); if ($this->user->id == $this->notice->profile_id) {
} else { $replies = new Reply;
$this->clientError(_('You may not delete another user\'s status.'), $replies->get('notice_id', $this->notice_id);
403, $this->format); $replies->delete();
} $this->notice->delete();
$this->showNotice();
} else {
$this->clientError(
_('You may not delete another user\'s status.'),
403,
$this->format
);
}
} }
/** /**
......
...@@ -115,9 +115,12 @@ class Inbox extends Memcached_DataObject ...@@ -115,9 +115,12 @@ class Inbox extends Memcached_DataObject
*/ */
static function insertNotice($user_id, $notice_id) static function insertNotice($user_id, $notice_id)
{ {
$inbox = DB_DataObject::staticGet('inbox', 'user_id', $user_id); // Going straight to the DB rather than trusting our caching
// during an update. Note: not using DB_DataObject::staticGet,
if (empty($inbox)) { // which is unsafe to use directly (in-process caching causes
// memory leaks, which accumulate in queue processes).
$inbox = new Inbox();
if (!$inbox->get('user_id', $user_id)) {
$inbox = Inbox::initialize($user_id); $inbox = Inbox::initialize($user_id);
} }
......
...@@ -81,9 +81,12 @@ abstract class Installer ...@@ -81,9 +81,12 @@ abstract class Installer
{ {
$pass = true; $pass = true;
if (file_exists(INSTALLDIR.'/config.php')) { $config = INSTALLDIR.'/config.php';
$this->warning('Config file "config.php" already exists.'); if (file_exists($config)) {
$pass = false; if (!is_writable($config) || filesize($config) > 0) {
$this->warning('Config file "config.php" already exists.');
$pass = false;
}
} }
if (version_compare(PHP_VERSION, '5.2.3', '<')) { if (version_compare(PHP_VERSION, '5.2.3', '<')) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment