]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge branch 'master' of gitorious.org:social/postblue-social
authorpostblue <postblue+git@postblue.info>
Sat, 25 Oct 2014 16:44:50 +0000 (18:44 +0200)
committerpostblue <postblue+git@postblue.info>
Sat, 25 Oct 2014 16:44:50 +0000 (18:44 +0200)
12 files changed:
README.md
actions/newgroup.php
lib/framework.php
lib/groupaction.php
lib/menu.php
lib/peopletaggroupnav.php
lib/searchgroupnav.php
lib/subgroupnav.php
plugins/Bookmark/classes/Bookmark.php
plugins/GroupFavorited/GroupFavoritedPlugin.php
plugins/GroupPrivateMessage/GroupPrivateMessagePlugin.php
plugins/OStatus/OStatusPlugin.php

index 7101371ba6009acf91438d79f4fa4e9a4f4c93e1..c705dd54125d6b3985a1ae422f1c0f5176921e00 100644 (file)
--- a/README.md
+++ b/README.md
@@ -102,10 +102,15 @@ for additional terms.
 
 ## New this version
 
-This is a security fix and bug fix release since 1.1.0,
-released 2 July 2012. All 1.1.0 sites should upgrade to this version.
+This is a security fix and bug fix release since 1.1.1-alpha2.
+The current release base version, 1.1.2, began work on 2014-10-25.
+All 1.1.1 sites should upgrade to this version.
 
-It includes the following changes:
+So far it includes the following changes:
+
+- XSS security fix (thanks Simon Waters, https://www.surevine.com/ )
+
+Upgrades from _StatusNet_ 1.1.1 will also experience these improvements:
 
 - Fixes for SQL injection errors in profile lists.
 - Improved ActivityStreams JSON representation of activities and objects.
@@ -114,6 +119,7 @@ It includes the following changes:
 - Fix error in OStatus subscription for remote groups.
 - Fix error in XMPP distribution.
 
+
 ### Troubleshooting
 
 The primary output for GNU social is syslog,
@@ -130,36 +136,34 @@ conflicts in your code.
 ### Unstable version
 
 If you're adventurous or impatient, you may want
-to install the development version of
-StatusNet. To get it, use the git version control
-tool <http://git-scm.com/> like so:
+to install the development version of GNU social.
+To get it, use the git version control tool
+<http://git-scm.com/> like so:
 
     git clone git@gitorious.org:social/mainline.git
 
-Using it is a mixed bag. On the positive side, it
-usually includes the latest security and bug fix
-patches. On the downside, it may also include
-changes that require admin intervention (like
-running a script or even raw SQL!) that may not be
-documented yet. It may be a good idea to test this
-version before installing it on your production
-machines.
+In the current phase of development it is probably
+recommended to use git as a means to stay up to date
+with the source code. You can choose between these
+branches:
+- 1.1.x     "stable", few updates, well tested code
+- master    "testing", more updates, usually working well
+- nightly   "unstable", most updates, not always working
 
-To keep it up-to-date, use 'git pull'. Watch for
-conflicts!
+To keep it up-to-date, use 'git pull'. Watch for conflicts!
 
 ## Further information
 
-There are several ways to get more information
-about GNU social.
+There are several ways to get more information about GNU social.
 
 * The #social IRC channel on freenode.net <http://www.freenode.net/>.
 * The GNU social website
 * Following us on GNU social -- http://quitter.se/gnusocial
-* Following us on Twitter -- https://twitter.com/gnusocial
 
 * GNU social has a bug tracker for any defects you may find, or ideas for
   making things better. http://bugz.foocorp.net/
+* Patches are welcome, either on the bug tracker or our repository at
+  Gitorious. https://gitorious.org/social/mainline
 
 Credits
 =======
@@ -218,6 +222,7 @@ Thanks to all of the StatusNet developers:
 * Brion Vibber, StatusNet, Inc.
 * James Walker, StatusNet, Inc.
 * Samantha Doherty, designer, StatusNet, Inc.
+* Simon Waters, Surevine
 
 ### Extra special thanks to the GNU socialites
 
index b20267a4968fd3c14a6f5f6df86a3beabcc5d42d..07a302ef45befda654a12e088ec8839fe6e2a044 100644 (file)
@@ -46,6 +46,12 @@ if (!defined('STATUSNET')) {
  */
 class NewgroupAction extends FormAction
 {
+    protected $group;
+
+    function getGroup() {
+        return $this->group;
+    }
+
     function title()
     {
         // TRANS: Title for form to create a group.
index 3c96f7c39b11728a54b07120cc3c24bb0c30a8cc..379da9692c22d2f09a719842d06ca04d71b7f994 100644 (file)
@@ -22,8 +22,8 @@ if (!defined('GNUSOCIAL')) { exit(1); }
 define('GNUSOCIAL_ENGINE', 'GNU social');
 define('GNUSOCIAL_ENGINE_URL', 'https://www.gnu.org/software/social/');
 
-define('GNUSOCIAL_BASE_VERSION', '1.1.1');
-define('GNUSOCIAL_LIFECYCLE', 'alpha2'); // 'dev', 'alpha[0-9]+', 'beta[0-9]+', 'rc[0-9]+', 'release'
+define('GNUSOCIAL_BASE_VERSION', '1.1.2');
+define('GNUSOCIAL_LIFECYCLE', 'alpha1'); // 'dev', 'alpha[0-9]+', 'beta[0-9]+', 'rc[0-9]+', 'release'
 
 define('GNUSOCIAL_VERSION', GNUSOCIAL_BASE_VERSION . '-' . GNUSOCIAL_LIFECYCLE);
 
index a0141a83b94e80a573cd440f53e6bb6eba570373..5d11e6acddc7e2cdeeee5ae5c4e85ae82acf1f13 100644 (file)
@@ -284,6 +284,11 @@ class GroupAction extends Action
 
         return $options;
     }
+
+    function getGroup()
+    {
+        return $this->group;
+    }
 }
 
 class GroupAdminSection extends ProfileSection
index 281ef7797be7c4af1c9aa2179cbd4df59ebbaf13..27503aa06bf59d4e48dc67e1dd57909342031680 100644 (file)
@@ -56,7 +56,7 @@ class Menu extends Widget
      *
      * @param Action $action current action, used for output
      */
-    function __construct($action=null)
+    function __construct(Action $action=null)
     {
         parent::__construct($action);
 
@@ -104,7 +104,7 @@ class Menu extends Widget
         }
     }
     
-    function item($actionName, $args, $label, $description, $id=null, $cls=null)
+    function item($actionName, array $args, $label, $description, $id=null, $cls=null)
     {
         if (empty($id)) {
             $id = $this->menuItemID($actionName, $args);
@@ -120,7 +120,7 @@ class Menu extends Widget
                              $cls);
     }
 
-    function isCurrent($actionName, $args)
+    function isCurrent($actionName, array $args)
     {
         if ($actionName != $this->actionName) {
             return false;
index bbfe4eca7e082711a74c52b821341a432a1ea535..212a90586b096e4289c79f461c6ea72a7e6c3a5d 100644 (file)
@@ -61,7 +61,7 @@ class PeopletagGroupNav extends Widget
      *
      * @param Action $action current action, used for output
      */
-    function __construct($action=null)
+    function __construct(Action $action=null)
     {
         parent::__construct($action);
         $this->action = $action;
index 40fe6a63754f587051a7173409ee5f076871a769..8481380acfd052b05d1740b77fbd1d884e822891 100644 (file)
@@ -51,7 +51,7 @@ class SearchGroupNav extends Menu
      *
      * @param Action $action current action, used for output
      */
-    function __construct($action=null, $q = null)
+    function __construct(Action $action=null, $q = null)
     {
         parent::__construct($action);
         $this->q = $q;
index 9fc5cd9e0972630402e362ef07d4b24571d1b951..40447dd41a26a7a599abf3df8776771795f8dd95 100644 (file)
@@ -50,8 +50,9 @@ class SubGroupNav extends Menu
      * Construction
      *
      * @param Action $action current action, used for output
+     * @param User   $user   Current user or NULL if "guest"
      */
-    function __construct($action=null, $user=null)
+    function __construct(Action $action=null, User $user=null)
     {
         parent::__construct($action);
         $this->user = $user;
index 65c767efddaffc36212daa00707d2cd8df6babb2..a99df87ee3d7da8da3a2117839f9d4d3a96d7a58 100644 (file)
@@ -134,6 +134,10 @@ class Bookmark extends Managed_DataObject
     static function saveNew($profile, $title, $url, $rawtags, $description,
                             $options=null)
     {
+        if (!common_valid_http_url($url)) {
+            throw new ClientException(_m('Only web bookmarks can be posted (HTTP or HTTPS).'));
+        }
+
         $nb = self::getByURL($profile, $url);
 
         if (!empty($nb)) {
index 944a7251050a11e5058dfca143c1ac6b4de9a79c..90a1fe5ca04ddd94a054ce0ee1f9bf29b2197c2f 100644 (file)
@@ -32,7 +32,7 @@ class GroupFavoritedPlugin extends Plugin
      * @param Net_URL_Mapper $m path-to-action mapper
      * @return boolean hook return
      */
-    function onRouterInitialized($m)
+    function onRouterInitialized(Net_URL_Mapper $m)
     {
         $m->connect('group/:nickname/favorited',
                     array('action' => 'groupfavorited'),
@@ -41,7 +41,7 @@ class GroupFavoritedPlugin extends Plugin
         return true;
     }
 
-    function onEndGroupGroupNav(GroupNav $nav)
+    function onEndGroupGroupNav(Menu $nav)
     {
         $action_name = $nav->action->trimmed('action');
         $nickname = $nav->group->nickname;
@@ -65,7 +65,7 @@ class GroupFavoritedPlugin extends Plugin
      *
      * @return boolean hook value
      */
-    function onPluginVersion(&$versions)
+    function onPluginVersion(array &$versions)
     {
         $url = 'http://status.net/wiki/Plugin:GroupFavorited';
 
index 28a1ab989e8785640b4ce446ef32db368cfeb395..2fd9e3ef429b71ea211a3d8e978d21ec9133062e 100644 (file)
@@ -101,7 +101,7 @@ class GroupPrivateMessagePlugin extends Plugin
      *
      * @see Action
      */
-    function onEndGroupGroupNav($groupnav)
+    function onEndGroupGroupNav(Menu $groupnav)
     {
         $action = $groupnav->action;
         $group  = $groupnav->group;
@@ -146,7 +146,7 @@ class GroupPrivateMessagePlugin extends Plugin
      *
      * @param GroupEditForm $form form being shown
      */
-    function onEndGroupEditFormData($form)
+    function onEndGroupEditFormData(GroupEditForm $form)
     {
         $gps = null;
 
@@ -187,19 +187,22 @@ class GroupPrivateMessagePlugin extends Plugin
         return true;
     }
 
-    function onEndGroupSaveForm($action)
+    function onEndGroupSaveForm(Action $action)
     {
+        // The Action class must contain this method
+        assert(is_callable(array($action, 'getGroup')));
+
         $gps = null;
 
-        if (!empty($action->group)) {
-            $gps = Group_privacy_settings::getKV('group_id', $action->group->id);
+        if ($action->getGroup() instanceof User_group) {
+            $gps = Group_privacy_settings::getKV('group_id', $action->getGroup()->id);
         }
 
         $orig = null;
 
         if (empty($gps)) {
             $gps = new Group_privacy_settings();
-            $gps->group_id = $action->group->id;
+            $gps->group_id = $action->getGroup()->id;
         } else {
             $orig = clone($gps);
         }
@@ -230,7 +233,7 @@ class GroupPrivateMessagePlugin extends Plugin
      *
      * @return boolean hook value
      */
-    function onStartInterpretCommand($cmd, $arg, $user, &$result)
+    function onStartInterpretCommand($cmd, $arg, User $user, &$result)
     {
         if ($cmd == 'd' || $cmd == 'dm') {
 
@@ -264,7 +267,7 @@ class GroupPrivateMessagePlugin extends Plugin
      *
      * @return boolean hook value
      */
-    function onEndGroupActionsList($widget, $group)
+    function onEndGroupActionsList(Widget $widget, User_group $group)
     {
         $cur = common_current_user();
         $action = $widget->out;
@@ -299,7 +302,7 @@ class GroupPrivateMessagePlugin extends Plugin
      *
      * @param
      */
-    function onStartNoticeSave(&$notice) {
+    function onStartNoticeSave(Notice &$notice) {
         // Look for group tags
         // FIXME: won't work for remote groups
         // @fixme if Notice::saveNew is refactored so we can just pull its list
@@ -378,7 +381,7 @@ class GroupPrivateMessagePlugin extends Plugin
      *
      * @return boolean hook value
      */
-    function onEndGroupProfileElements($action, $group)
+    function onEndGroupProfileElements(Action $action, User_group $group)
     {
         $gps = Group_privacy_settings::forGroup($group);
 
@@ -390,10 +393,10 @@ class GroupPrivateMessagePlugin extends Plugin
         return true;
     }
 
-    function onStartShowExportData($action)
+    function onStartShowExportData(Action $action)
     {
         if ($action instanceof ShowgroupAction) {
-            $gps = Group_privacy_settings::forGroup($action->group);
+            $gps = Group_privacy_settings::forGroup($action->getGroup());
 
             if ($gps->allow_privacy == Group_privacy_settings::ALWAYS) {
                 return false;
index f78c156a7c44f1008098969ae80460eb20589d1b..a57074036abbb4c6c2eb6a10564e135094a81460 100644 (file)
@@ -1344,7 +1344,7 @@ class OStatusPlugin extends Plugin
             $oprofile = $oprofile->checkAuthorship($activity);
             $profile = $oprofile->localProfile();
         } catch (Exception $e) {
-            common_log(LOG_ERR, 'Could not get a profile or check authorship ('.get_class($e).': "'.$e->getMessage().'")');
+            common_log(LOG_ERR, 'Could not get a profile or check authorship ('.get_class($e).': "'.$e->getMessage().'") for activity ID: '.$activity->id);
             $profile = null;
             return false;
         }