]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge commit 'refs/merge-requests/6' of git://gitorious.org/statusnet/gnu-social...
authorMikael Nordfeldth <mmn@hethane.se>
Sat, 4 Jan 2014 20:27:28 +0000 (21:27 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Sat, 4 Jan 2014 20:27:28 +0000 (21:27 +0100)
actions/apioauthrequesttoken.php
actions/apitimelinementions.php
actions/shownotice.php
lib/apiaction.php
lib/apignusocialoauthdatastore.php
plugins/OStatus/classes/FeedSub.php

index 083bbc37563397e8274ff17a32290b4c53ae53dd..e961f4f46464cf8463af219ba41a45f5a0cfb460 100644 (file)
@@ -146,7 +146,7 @@ class ApiOAuthRequestTokenAction extends ApiOAuthAction
 
             return true;
         } else {
-            return common_valid_http_url($callback);
+            return filter_var($callback, FILTER_VALIDATE_URL);
         }
     }
 }
index ce6c73c0d18b6d62e4c5f1b2e7114d970b9d1dce..c1811ac01bb77e9fcdc23385f7136cb3581f8b2e 100644 (file)
@@ -119,8 +119,8 @@ class ApiTimelineMentionsAction extends ApiBareAuthAction
             // TRANS: Subtitle for timeline of most recent mentions of a user.
             // TRANS: %1$s is the StatusNet sitename, %2$s is a user nickname,
             // TRANS: %3$s is a user's full name.
-            _('%1$s updates that reply to updates from %2$s / %3$s.'),
-            $sitename, $this->target->getBestName(), $this->target->nickname
+            _('%1$s updates that reply to updates from %3$s / %2$s.'),
+            $sitename, $this->target->nickname, $this->target->getBestName()
         );
 
         switch($this->format) {
index 6a026d2d364ea63c55f5b40712b719ac3673c921..1f92978062755b8d538fe685d29e349d58aa97f5 100644 (file)
@@ -70,7 +70,7 @@ class ShownoticeAction extends Action
      *
      * @return success flag
      */
-    function prepare($args)
+    protected function prepare(array $args=array())
     {
         parent::prepare($args);
         if ($this->boolean('ajax')) {
@@ -117,16 +117,16 @@ class ShownoticeAction extends Action
      *
      * @return Notice
      */
-    function getNotice()
+    protected function getNotice()
     {
         $id = $this->arg('notice');
 
         $notice = Notice::getKV('id', $id);
 
-        if (empty($notice)) {
+        if (!$notice instanceof Notice) {
             // Did we used to have it, and it got deleted?
             $deleted = Deleted_notice::getKV($id);
-            if (!empty($deleted)) {
+            if ($deleted instanceof Deleted_notice) {
                 // TRANS: Client error displayed trying to show a deleted notice.
                 $this->clientError(_('Notice deleted.'), 410);
             } else {
@@ -211,9 +211,9 @@ class ShownoticeAction extends Action
      *
      * @return void
      */
-    function handle($args)
+    protected function handle()
     {
-        parent::handle($args);
+        parent::handle();
 
         if ($this->boolean('ajax')) {
             $this->showAjax();
index d151f4c51fd7f461f639235d9db39d87d4d11211..dd4047125a0443f6218ebb57bc497e4e6e333266 100644 (file)
@@ -1466,7 +1466,7 @@ class ApiAction extends Action
             } else if ($this->arg('screen_name')) {
                 $nickname = common_canonical_nickname($this->arg('screen_name'));
                 $user = User::getKV('nickname', $nickname);
-                return $user ? $user->getProfile() : null;
+                return $user instanceof User ? $user->getProfile() : null;
             } else {
                 // Fall back to trying the currently authenticated user
                 return $this->scoped;
index 7550ec5f6fa8723e4b240eb6c5724cd08c3d70f7..da412df8d298bfe9a55a946a37b4df71c7a79ecc 100644 (file)
@@ -30,7 +30,7 @@ class ApiGNUsocialOAuthDataStore extends OAuthDataStore
     {
         $con = Consumer::getKV('consumer_key', $consumerKey);
 
-        if (!$con) {
+        if (!$con instanceof Consumer) {
 
             // Create an anon consumer and anon application if one
             // doesn't exist already
index 8418e37a49956adf62def58ace1215af7154f559..2e62c512d13996d32ed5915d3f433138c3349b86 100644 (file)
@@ -279,7 +279,7 @@ class FeedSub extends Managed_DataObject
             $headers = array('Content-Type: application/x-www-form-urlencoded');
             $post = array('hub.mode' => $mode,
                           'hub.callback' => $callback,
-                          'hub.verify' => 'async',  // TODO: deprecated, remove when noone uses PuSH <0.4
+                          'hub.verify' => 'async',  // TODO: deprecated, remove when noone uses PuSH <0.4 (only 'async' method used there)
                           'hub.verify_token' => 'Deprecated-since-PuSH-0.4', // TODO: rm!
 
                           'hub.secret' => $this->secret,