]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Merge branch '0.7.x' into 0.8.x
authorEvan Prodromou <evan@controlyourself.ca>
Mon, 30 Mar 2009 15:18:03 +0000 (11:18 -0400)
committerEvan Prodromou <evan@controlyourself.ca>
Mon, 30 Mar 2009 15:18:03 +0000 (11:18 -0400)
1  2 
README
lib/router.php

diff --combined README
index a0d0f20a5dc1fdfae03fe3a2483b1bcada48fd7e,95f9edceaf1eba9dc38b41aa839f6bcaf0204452..ef0f21dae3bcfe460b7870d2b5edd6feaf78b524
--- 1/README
--- 2/README
+++ b/README
@@@ -240,10 -240,6 +240,10 @@@ and the URLs are listed here for your c
    version may render your Laconica site unable to send or receive XMPP
    messages.
  - Facebook library. Used for the Facebook application.
 +- PEAR Services_oEmbed. Used for some multimedia integration.
 +- PEAR HTTP_Request is an oEmbed dependency.
 +- PEAR Validat is an oEmbed dependency.e
 +- PEAR Net_URL is an oEmbed dependency.2
  
  A design goal of Laconica is that the basic Web functionality should
  work on even the most restrictive commercial hosting services.
@@@ -929,6 -925,16 +929,16 @@@ dupelimit: Time in which it's not OK fo
             same notice; default = 60 seconds.
  logo: URL of an image file to use as the logo for the site. Overrides
        the logo in the theme, if any.
+ ssl: Whether to use SSL and https:// URLs for some or all pages.
+      Possible values are 'always' (use it for all pages), 'never'
+      (don't use it for any pages), or 'sometimes' (use it for
+      sensitive pages that include passwords like login and registration,
+      but not for regular pages). Default to 'never'.
+ sslserver: use an alternate server name for SSL URLs, like
+            'secure.example.org'. You should be careful to set cookie
+            parameters correctly so that both the SSL server and the
+            "normal" server can access the session cookie and
+            preferably other cookies as well.
  
  db
  --
@@@ -1173,6 -1179,20 +1183,20 @@@ banned: an array of usernames and/or pr
          not be accepted at all. (Compare with blacklisted users above,
          whose posts just won't show up in the public stream.)
  
+ newuser
+ -------
+ Options with new users.
+ subscribe: nickname of a user account to automatically subscribe new
+            users to. Typically this would be system account for e.g.
+            service updates or announcements. Users are able to unsub
+            if they want. Default is null; no auto subscribe.
+ welcome: nickname of a user account that sends welcome messages to new
+          users. Can be the same as 'subscribe' account, although on
+          busy servers it may be a good idea to keep that one just for
+          'urgent' messages. Default is null; no message.
  Troubleshooting
  ===============
  
diff --combined lib/router.php
index 5a00a7fea21ef0b307260f3c101d31435823ce27,ae5b5e16bdf0bbd8b2a9aad9d641a6cf99660815..67b8b8ae6e9515324fda9ac39017cb13f43a55c8
@@@ -68,8 -68,8 +68,8 @@@ class Route
          }
      }
  
-     function initialize() {
+     function initialize()
+     {
          $m = Net_URL_Mapper::getInstance();
  
          // In the "root"
  
          foreach (array('group', 'people', 'notice') as $s) {
              $m->connect('search/'.$s, array('action' => $s.'search'));
-             $m->connect('search/'.$s.'?q=:q', array('action' => $s.'search'),array('q' => '.+'));
+             $m->connect('search/'.$s.'?q=:q',
+                         array('action' => $s.'search'),
+                         array('q' => '.+'));
          }
  
          // The second of these is needed to make the link work correctly
-       // when inserted into the page. The first is needed to match the
-       // route on the way in. Seems to be another Net_URL_Mapper bug to me.
+         // when inserted into the page. The first is needed to match the
+         // route on the way in. Seems to be another Net_URL_Mapper bug to me.
          $m->connect('search/notice/rss', array('action' => 'noticesearchrss'));
-         $m->connect('search/notice/rss?q=:q', array('action' => 'noticesearchrss'),array('q' => '.+'));
+         $m->connect('search/notice/rss?q=:q', array('action' => 'noticesearchrss'),
+                     array('q' => '.+'));
  
          // notice
  
                      array('action' => 'deletenotice'),
                      array('notice' => '[0-9]+'));
  
 +        // conversation
 +
 +        $m->connect('conversation/:id',
 +                    array('action' => 'conversation'),
 +                    array('id' => '[0-9]+'));
 +
          $m->connect('message/new', array('action' => 'newmessage'));
          $m->connect('message/new?to=:to', array('action' => 'newmessage'), array('to' => '[A-Za-z0-9_-]+'));
          $m->connect('message/:message',
          foreach (array('xml', 'json', 'rss', 'atom') as $e) {
              $m->connect('api/direct_messages/sent.'.$e,
                          array('action' => 'api',
-                         'apiaction' => 'direct_messages',
-                         'method' => 'sent.'.$e));
+                               'apiaction' => 'direct_messages',
+                               'method' => 'sent.'.$e));
          }
  
          $m->connect('api/direct_messages/destroy/:argument',
  
          foreach (array('xml', 'json', 'rss', 'atom') as $e) {
              $m->connect('api/favorites.'.$e,
-                 array('action' => 'api',
-                       'apiaction' => 'favorites',
-                       'method' => 'favorites.'.$e));
+                         array('action' => 'api',
+                               'apiaction' => 'favorites',
+                               'method' => 'favorites.'.$e));
          }
  
          // notifications
              $match = $this->m->match($path);
          } catch (Net_URL_Mapper_InvalidException $e) {
              common_log(LOG_ERR, "Problem getting route for $path - " .
-                 $e->getMessage());
+                        $e->getMessage());
              $cac = new ClientErrorAction("Page not found.", 404);
              $cac->showPage();
          }
  
      function build($action, $args=null, $params=null, $fragment=null)
      {
-         if($params!=null)
-           common_log(LOG_DEBUG,"build: ".$action." ".print_r($args,true)." ".print_r($params,true));
          $action_arg = array('action' => $action);
  
          if ($args) {
              $args = $action_arg;
          }
  
-         if($params!=null)
-           common_log(LOG_DEBUG,"generate args:".print_r($args,true));
-         return $this->m->generate($args, $params, $fragment);
+         $url = $this->m->generate($args, $params, $fragment);
+         // Due to a bug in the Net_URL_Mapper code, the returned URL may
+         // contain a malformed query of the form ?p1=v1?p2=v2?p3=v3. We
+         // repair that here rather than modifying the upstream code...
+         $qpos = strpos($url, '?');
+         if ($qpos !== false) {
+             $url = substr($url, 0, $qpos+1) .
+               str_replace('?', '&', substr($url, $qpos+1));
+         }
+         return $url;
      }
  }