]> git.mxchange.org Git - friendica.git/blobdiff - boot.php
Merge pull request #7666 from MrPetovan/bug/7665-audio-tag
[friendica.git] / boot.php
index 4ade9eb1450a93bcbedf95311e8f32bcd9525af3..224eba1f45b4f6267d71a6c43b013363440e5178 100644 (file)
--- a/boot.php
+++ b/boot.php
@@ -31,7 +31,7 @@ use Friendica\Util\DateTimeFormat;
 
 define('FRIENDICA_PLATFORM',     'Friendica');
 define('FRIENDICA_CODENAME',     'Dalmatian Bellflower');
-define('FRIENDICA_VERSION',      '2019.06');
+define('FRIENDICA_VERSION',      '2019.09-rc');
 define('DFRN_PROTOCOL_VERSION',  '2.23');
 define('NEW_UPDATE_ROUTINE_VERSION', 1170);
 
@@ -334,6 +334,7 @@ function get_app()
  * @param array $args
  * @brief Returns a defaut value if the provided variable or array key is falsy
  * @return mixed
+ * @deprecated since version 2019.06, use native coalesce operator (??) instead
  */
 function defaults(...$args)
 {
@@ -412,7 +413,7 @@ function public_contact()
  *
  * @return int|bool visitor_id or false
  */
-function remote_user()
+function remote_user($uid = null)
 {
        // You cannot be both local and remote.
        // Unncommented by rabuzarus because remote authentication to local
@@ -421,13 +422,22 @@ function remote_user()
 //             return false;
 //     }
 
-       if (empty($_SESSION)) {
+       if (empty($_SESSION['authenticated'])) {
                return false;
        }
 
-       if (!empty($_SESSION['authenticated']) && !empty($_SESSION['visitor_id'])) {
+       if (!is_null($uid) && !empty($_SESSION['remote'])) {
+               /// @todo replace it with this:
+               // if (!empty($_SESSION['remote'][$uid])) ...
+               foreach ($_SESSION['remote'] as $visitor) {
+                       if ($visitor['uid'] == $uid) {
+                               return $visitor['cid'];
+                       }
+               }
+       } elseif (is_null($uid) && !empty($_SESSION['visitor_id'])) {
                return intval($_SESSION['visitor_id']);
        }
+
        return false;
 }