summaryrefslogtreecommitdiff
path: root/index.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2009-08-12 10:50:46 -0700
committerEvan Prodromou <evan@controlyourself.ca>2009-08-12 10:50:46 -0700
commit7d33478e867cc6610aded42a8f2fa71bae46804d (patch)
tree73a422fac7006ee40ff51c21922ca22f68cab40d /index.php
parent01dccefcccc8ca4c1fec419f47cf723d0498c3ef (diff)
parent853b6d38b362e3a905195d9ff850c9a884d412bd (diff)
Merge branch '0.8.x' of git@gitorious.org:laconica/mainline into 0.8.x
Diffstat (limited to 'index.php')
-rw-r--r--index.php18
1 files changed, 17 insertions, 1 deletions
diff --git a/index.php b/index.php
index 980b9881b..be62fe1f3 100644
--- a/index.php
+++ b/index.php
@@ -184,7 +184,8 @@ function main()
if (!$user && common_config('site', 'private')) {
$public_actions = array('openidlogin', 'finishopenidlogin',
- 'recoverpassword', 'api', 'doc');
+ 'recoverpassword', 'api', 'doc',
+ 'opensearch');
$login_action = 'openidlogin';
if (!common_config('site', 'openidonly')) {
$public_actions[] = 'login';
@@ -193,6 +194,21 @@ function main()
}
if (!in_array($action, $public_actions) &&
!preg_match('/rss$/', $action)) {
+
+ // set returnto
+ $rargs =& common_copy_args($args);
+ unset($rargs['action']);
+ if (common_config('site', 'fancy')) {
+ unset($rargs['p']);
+ }
+ if (array_key_exists('submit', $rargs)) {
+ unset($rargs['submit']);
+ }
+ foreach (array_keys($_COOKIE) as $cookie) {
+ unset($rargs[$cookie]);
+ }
+ common_set_returnto(common_local_url($action, $rargs));
+
common_redirect(common_local_url($login_action));
return;
}