]> git.mxchange.org Git - friendica.git/blobdiff - mod/p.php
Merge pull request #2932 from Hypolite/issue/missing-private-image-src
[friendica.git] / mod / p.php
index df904372add3165ecc3315acd67927337378865a..8da044e9323916e742b2b1bb24404fefe854acdf 100644 (file)
--- a/mod/p.php
+++ b/mod/p.php
@@ -31,11 +31,13 @@ function p_init($a){
                        $parts = parse_url($r[0]["author-link"]);
                        $host = $parts["scheme"]."://".$parts["host"];
 
-                       $location = $host."/p/".$guid.".xml";
+                       if (normalise_link($host) != normalise_link(App::get_baseurl())) {
+                               $location = $host."/p/".urlencode($guid).".xml";
 
-                       header("HTTP/1.1 301 Moved Permanently");
-                       header("Location:".$location);
-                       killme();
+                               header("HTTP/1.1 301 Moved Permanently");
+                               header("Location:".$location);
+                               killme();
+                       }
                }
 
                header($_SERVER["SERVER_PROTOCOL"].' 404 '.t('Not Found'));