]> git.mxchange.org Git - friendica.git/blobdiff - boot.php
ignore exif orientation if we can't parse the particular flavour of exif
[friendica.git] / boot.php
index 7a186ad664ac66d90b06fddf78e8c810285ccc14..bb58d28086b2d3c26bb755a8b8e9e2b7f9fc4f12 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -11,7 +11,7 @@ require_once('include/cache.php');
 require_once('library/Mobile_Detect/Mobile_Detect.php');
 
 define ( 'FRIENDICA_PLATFORM',     'Friendica');
-define ( 'FRIENDICA_VERSION',      '3.0.1449' );
+define ( 'FRIENDICA_VERSION',      '3.0.1456' );
 define ( 'DFRN_PROTOCOL_VERSION',  '2.23'    );
 define ( 'DB_UPDATE_VERSION',      1154      );
 
@@ -1025,11 +1025,29 @@ if(! function_exists('get_max_import_size')) {
 
 if(! function_exists('profile_load')) {
        function profile_load(&$a, $nickname, $profile = 0) {
-               if(remote_user()) {
-                       $r = q("SELECT `profile-id` FROM `contact` WHERE `id` = %d LIMIT 1",
-                                       intval($_SESSION['visitor_id']));
-                       if(count($r))
-                               $profile = $r[0]['profile-id'];
+
+               $user = q("select uid from user where nickname = '%s' limit 1",
+                       dbesc($nickname)
+               );
+               
+               if(! ($user && count($user))) {
+                       logger('profile error: ' . $a->query_string, LOGGER_DEBUG);
+                       notice( t('Requested account is not available.') . EOL );
+                       $a->error = 404;
+                       return;
+               }
+
+               if(remote_user() && count($_SESSION['remote'])) {
+                       foreach($_SESSION['remote'] as $visitor) {
+                               if($visitor['uid'] == $user[0]['uid']) {
+                                       $r = q("SELECT `profile-id` FROM `contact` WHERE `id` = %d LIMIT 1",
+                                               intval($visitor['cid'])
+                                       );
+                                       if(count($r))
+                                               $profile = $r[0]['profile-id'];
+                                       break;
+                               }
+                       }
                }
 
                $r = null;
@@ -1144,8 +1162,14 @@ if(! function_exists('profile_sidebar')) {
 
                // don't show connect link to authenticated visitors either
 
-               if((remote_user()) && ($_SESSION['visitor_visiting'] == $profile['uid']))
-                       $connect = False;
+               if(remote_user() && count($_SESSION['remote'])) {
+                       foreach($_SESSION['remote'] as $visitor) {
+                               if($visitor['uid'] == $profile['uid']) {
+                                       $connect = false;
+                                       break;
+                               }
+                       }
+               }
 
                if(get_my_url() && $profile['unkmail'])
                        $wallmessage = t('Message');
@@ -1468,7 +1492,7 @@ if(! function_exists('proc_run')) {
 
                $cmdline = implode($args," ");
                if(get_config('system','proc_windows'))
-                       proc_close(proc_open('start /b ' . $cmdline,array(),$foo));
+                       proc_close(proc_open('cmd /c start /b ' . $cmdline,array(),$foo));
                else
                        proc_close(proc_open($cmdline." &",array(),$foo));
        }