From: Evan Prodromou Date: Wed, 25 Mar 2009 16:56:52 +0000 (-0400) Subject: Merge branch 'master' into 0.7.x X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=2becd5849d76e052ecfe066b5376a65b9c70fad6;p=quix0rs-gnu-social.git Merge branch 'master' into 0.7.x Conflicts: lib/router.php --- 2becd5849d76e052ecfe066b5376a65b9c70fad6 diff --cc lib/router.php index d1217ca3ce,135e07a0f0..ae5b5e16bd --- a/lib/router.php +++ b/lib/router.php @@@ -68,8 -68,8 +68,8 @@@ class Route } } -- function initialize() { -- ++ function initialize() ++ { $m = Net_URL_Mapper::getInstance(); // In the "root" @@@ -136,14 -136,10 +136,17 @@@ 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' => '.+')); ++ $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 @@@ -263,8 -259,8 +266,8 @@@ 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', @@@ -328,9 -324,9 +331,9 @@@ 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 @@@ -415,7 -411,7 +418,7 @@@ $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(); } @@@ -442,10 -434,10 +441,11 @@@ // 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,'?'); ++ ++ $qpos = strpos($url, '?'); if ($qpos !== false) { $url = substr($url, 0, $qpos+1) . -- str_replace('?', '&', substr($url, $qpos+1)); ++ str_replace('?', '&', substr($url, $qpos+1)); } return $url; }