]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/AnonymousFave/actions/anonfavor.php
FavorAction upgraded to extend FormAction
[quix0rs-gnu-social.git] / plugins / AnonymousFave / actions / anonfavor.php
index 401b6a855b1a07eb0a912d96ff1e3866fe7657bf..61868125c12f9b4478d743dfb6221016b33da67a 100644 (file)
@@ -27,9 +27,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  */
 
-if (!defined('STATUSNET')) {
-    exit(1);
-}
+if (!defined('GNUSOCIAL')) { exit(1); }
 
 /**
  * Anonymous favor class
@@ -64,14 +62,7 @@ class AnonFavorAction extends RedirectingAction
 
         $id     = $this->trimmed('notice');
         $notice = Notice::getKV($id);
-        $token  = $this->trimmed('token-' . $notice->id);
-
-        if (empty($token) || $token != common_session_token()) {
-            // TRANS: Client error.
-            $this->clientError(_m('There was a problem with your session token. Try again, please.'));
-            return;
-        }
-
+        $token  = $this->checkSessionToken();
 
         if ($profile->hasFave($notice)) {
             // TRANS: Client error.