]> git.mxchange.org Git - friendica.git/commitdiff
Merge branch 'develop' into improvement/move-app-to-src-2
authorHypolite Petovan <mrpetovan@gmail.com>
Sun, 7 May 2017 16:58:11 +0000 (12:58 -0400)
committerGitHub <noreply@github.com>
Sun, 7 May 2017 16:58:11 +0000 (12:58 -0400)
12 files changed:
1  2 
boot.php
include/Probe.php
include/acl_selectors.php
include/api.php
include/dbstructure.php
include/diaspora.php
include/ostatus.php
include/pubsubpublish.php
include/socgraph.php
mod/admin.php
mod/contacts.php
mod/receive.php

diff --cc boot.php
Simple merge
index 89145298675aa2d833d6f8c16620fc0325ff16ec,bed13fdf3df175c7e5d24f9c849b02aafdea55e0..85f64d29bc2e8a4f6d64842a5dc39e819e5daa42
@@@ -1219,4 -1223,42 +1224,41 @@@ class Probe 
  
                return $data;
        }
+       /**
+        * @brief Mix two paths together to possibly fix missing parts
+        *
+        * @param string $avatar Path to the avatar
+        * @param string $base Another path that is hopefully complete
+        *
+        * @return string fixed avatar path
+        */
+       public static function fix_avatar($avatar, $base) {
+               $base_parts = parse_url($base);
+               // Remove all parts that could create a problem
+               unset($base_parts['path']);
+               unset($base_parts['query']);
+               unset($base_parts['fragment']);
+               $avatar_parts = parse_url($avatar);
+               // Now we mix them
+               $parts = array_merge($base_parts, $avatar_parts);
+               // And put them together again
+               $scheme   = isset($parts['scheme']) ? $parts['scheme'] . '://' : '';
+               $host     = isset($parts['host']) ? $parts['host'] : '';
+               $port     = isset($parts['port']) ? ':' . $parts['port'] : '';
+               $path     = isset($parts['path']) ? $parts['path'] : '';
+               $query    = isset($parts['query']) ? '?' . $parts['query'] : '';
+               $fragment = isset($parts['fragment']) ? '#' . $parts['fragment'] : '';
+               $fixed = $scheme.$host.$port.$path.$query.$fragment;
+               logger('Base: '.$base.' - Avatar: '.$avatar.' - Fixed: '.$fixed, LOGGER_DATA);
+               return $fixed;
+       }
  }
 -?>
Simple merge
diff --cc include/api.php
Simple merge
Simple merge
Simple merge
index 82595529d2bc1f93cfea4dbbfb169abb04340f8f,7644eacc094ab434f72fd74c209a2958574b06b0..c3bdadf55b9522a714dc8ceaceb32ddc53d69d61
@@@ -3,7 -3,7 +3,8 @@@
   * @file include/ostatus.php
   */
  
 -use \Friendica\Core\Config;
 +use Friendica\App;
++use Friendica\Core\Config;
  
  require_once("include/Contact.php");
  require_once("include/threads.php");
Simple merge
Simple merge
diff --cc mod/admin.php
Simple merge
Simple merge
diff --cc mod/receive.php
index abc91ce37e15ee96d296b05d77cb9ede6506812e,15c9f1d412796b1de5e2cd08664bdb36dba59d15..9048642174706bd486689bc9fdbca5907c425902
@@@ -10,10 -9,10 +10,9 @@@ require_once('include/salmon.php')
  require_once('include/crypto.php');
  require_once('include/diaspora.php');
  
 -
  function receive_post(App $a) {
-       $enabled = intval(get_config('system','diaspora_enabled'));
-       if(! $enabled) {
+       $enabled = intval(get_config('system', 'diaspora_enabled'));
+       if (!$enabled) {
                logger('mod-diaspora: disabled');
                http_status_exit(500);
        }