]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/disfavor.php
Merge branch '0.8.x' into small-fixes
[quix0rs-gnu-social.git] / actions / disfavor.php
index 09b3bf18d3d03ad8348afe465511d125f2962293..02e01d6e006bd3747beca0bfdfb694fd530309d0 100644 (file)
@@ -13,7 +13,7 @@
  * @link     http://laconi.ca/
  *
  * Laconica - a distributed open-source microblogging tool
- * Copyright (C) 2008, Controlez-Vous, Inc.
+ * Copyright (C) 2008, 2009, Control Yourself, Inc.
  *
  * This program is free software: you can redistribute it and/or modify
  * it under the terms of the GNU Affero General Public License as published by
@@ -49,7 +49,7 @@ class DisfavorAction extends Action
 {
     /**
      * Class handler.
-     * 
+     *
      * @param array $args query arguments
      *
      * @return void
@@ -75,7 +75,7 @@ class DisfavorAction extends Action
             return;
         }
         $fave            = new Fave();
-        $fave->user_id   = $this->id;
+        $fave->user_id   = $user->id;
         $fave->notice_id = $notice->id;
         if (!$fave->find(true)) {
             $this->clientError(_('This notice is not a favorite!'));
@@ -89,7 +89,7 @@ class DisfavorAction extends Action
         }
         $user->blowFavesCache();
         if ($this->boolean('ajax')) {
-            $this->startHTML('text/xml;charset=utf-8', true);
+            $this->startHTML('text/xml;charset=utf-8');
             $this->elementStart('head');
             $this->element('title', null, _('Add to favorites'));
             $this->elementEnd('head');
@@ -100,7 +100,8 @@ class DisfavorAction extends Action
             $this->elementEnd('html');
         } else {
             common_redirect(common_local_url('showfavorites',
-                                             array('nickname' => $user->nickname)));
+                                             array('nickname' => $user->nickname)),
+                            303);
         }
     }
 }