]> git.mxchange.org Git - friendica.git/commitdiff
redirect to symbolic rather than absolute URL locations
authorFriendika <info@friendika.com>
Fri, 1 Apr 2011 07:59:10 +0000 (00:59 -0700)
committerFriendika <info@friendika.com>
Fri, 1 Apr 2011 07:59:10 +0000 (00:59 -0700)
mod/dfrn_poll.php
mod/redir.php

index fe9504deb4ad12bc8c211ebe974f9767303b5cd4..82ad70907040e4246a9e8e12e0eb82ee58e52702 100644 (file)
@@ -447,6 +447,19 @@ function dfrn_poll_content(&$a) {
                                ));
                        }
 
+                       switch($destination_url) {
+                               case 'profile':
+                                       $dest = $a->get_baseurl() . '/profile/' . $profile . '?tab=profile';
+                                       break;
+                               case 'photos':
+                                       $dest = $a->get_baseurl() . '/photos/' . $profile;
+                                       break;
+                               case 'status':
+                               default:
+                                       $dest = $a->get_baseurl() . '/profile/' . $profile;
+                                       break;          
+                       }
+
                        logger("dfrn_poll: sec profile: " . $s, LOGGER_DATA);
 
                        if(strlen($s) && strstr($s,'<?xml')) {
@@ -473,9 +486,10 @@ function dfrn_poll_content(&$a) {
                                        ); 
                                }
                                $profile = $r[0]['nickname'];
-                               goaway((strlen($destination_url)) ? $destination_url : $a->get_baseurl() . '/profile/' . $profile);
+                       
+                               goaway($dest);
                        }
-                       goaway($a->get_baseurl());
+                       goaway($dest);
                        // NOTREACHED
 
                }
index ac21aa17eb91c6c8e3ca1f006491837a4b59e893..8d0c8f4b3a4c0bb3cb590035666e3d2a4f3b1ad5 100644 (file)
@@ -5,6 +5,7 @@ function redir_init(&$a) {
        if((! local_user()) || (! ($a->argc == 2)) || (! intval($a->argv[1])))
                goaway($a->get_baseurl());
        $cid = $a->argv[1];
+       $url = ((x($_GET,'url')) ? $_GET['url'] : '');
 
        $r = q("SELECT * FROM `contact` WHERE `id` = %d AND `uid` = %d LIMIT 1",
                intval($cid),
@@ -37,8 +38,8 @@ function redir_init(&$a) {
        );
 
        logger('mod_redir: ' . $r[0]['name'] . ' ' . $sec, LOGGER_DEBUG); 
-
+       $dest = (($url) ? '&destination_url=' . $url : '');
        goaway ($r[0]['poll'] . '?dfrn_id=' . $dfrn_id 
-               . '&dfrn_version=' . DFRN_PROTOCOL_VERSION . '&type=profile&sec=' . $sec);
+               . '&dfrn_version=' . DFRN_PROTOCOL_VERSION . '&type=profile&sec=' . $sec . $dest );
        
 }