This commit is contained in:
nobody 2021-12-15 00:36:57 -08:00
parent 7631722d16
commit 654000ed28
6 changed files with 23 additions and 17 deletions

View file

@ -801,13 +801,14 @@ class Libzot
$deleted_changed = 1;
}
if ($arr['channel_type'] === 'collection') {
$px = 2;
} elseif ($arr['channel_type'] === 'group') {
$px = 1;
} else {
$px = 0;
}
$px = 0;
if (isset($arr['channel_type'])) {
if ($arr['channel_type'] === 'collection') {
$px = 2;
} elseif ($arr['channel_type'] === 'group') {
$px = 1;
}
}
if (array_key_exists('public_forum', $arr) && intval($arr['public_forum'])) {
$px = 1;
}
@ -3587,7 +3588,7 @@ class Libzot
public static function is_zot_request()
{
$x = getBestSupportedMimeType(['application/x-zot+json', 'application/x-nomad']);
$x = getBestSupportedMimeType(['application/x-zot+json', 'application/x-nomad+json']);
return (($x) ? true : false);
}

View file

@ -297,7 +297,11 @@ class Libzotdir
$arr = [];
$arr['xprof_hash'] = $hash;
$arr['xprof_dob'] = ((isset($profile['birthday']) && $profile['birthday'] === '0000-00-00') ? $profile['birthday'] : datetime_convert('', '', $profile['birthday'], 'Y-m-d')); // !!!! check this for 0000 year
if (isset($profile['birthday'])) {
$arr['xprof_dob'] = (($profile['birthday'] === '0000-00-00')
? $profile['birthday']
: datetime_convert('', '', $profile['birthday'], 'Y-m-d')); // !!!! check this for 0000 year
}
$arr['xprof_age'] = (isset($profile['age']) ? intval($profile['age']) : 0);
$arr['xprof_desc'] = ((isset($profile['description']) && $profile['description']) ? htmlspecialchars($profile['description'], ENT_COMPAT, 'UTF-8', false) : '');
$arr['xprof_gender'] = ((isset($profile['gender']) && $profile['gender']) ? htmlspecialchars($profile['gender'], ENT_COMPAT, 'UTF-8', false) : '');

View file

@ -891,11 +891,11 @@ class App {
// normally self::$hostname (also scheme and port) will be filled in during startup.
// Set it manually from $_SERVER variables only if it wasn't.
if (! self::$hostname) {
self::$hostname = punify(get_host());
self::$scheme = 'http';
if (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']) {
self::$scheme = 'https';
}
@ -920,7 +920,7 @@ class App {
// Rewrite rules on the server will convert incoming paths to a request parameter.
// Strip this path information from our stored copy of the query_string, in case
// we need to re-use the rest of the original query.
if (isset($_SERVER['QUERY_STRING']) && substr($_SERVER['QUERY_STRING'], 0, 4) === "req=") {
self::$query_string = str_replace(['<','>'],['&lt;','&gt;'],substr($_SERVER['QUERY_STRING'], 4));
// removing leading '/' - maybe a nginx problem
@ -934,7 +934,7 @@ class App {
// Here is where start breaking out the URL path information to both route the
// web request based on the leading path component, and also to use remaining
// path components as C-style arguments to our individual controller modules.
if (isset($_GET['req'])) {
self::$cmd = escape_tags(trim($_GET['req'],'/\\'));
}
@ -1416,8 +1416,9 @@ function z_root() {
* @return string
*/
function absurl($path) {
if (strpos($path, '/') === 0)
if (strpos($path, '/') === 0) {
return z_path() . $path;
}
return $path;
}

View file

@ -123,7 +123,7 @@ Let's go ahead and add some code to implement our post_local hook handler.
$cities = [];
$zones = timezone_identifiers_list();
foreach ($zones as $zone) {
if ((strpos($zone,'/')) &amp;&amp; (! stristr($zone,'US/')) &amp;&amp; (! stristr($zone,'Etc/'))) {
if ((strpos($zone,'/')) &amp;&amp; (stristr($zone,'US/') === false) &amp;&amp; (stristr($zone,'Etc/') === false)) {
$cities[] = str_replace('_', ' ',substr($zone,strrpos($zone,'/') + 1));
}
}

View file

@ -2996,7 +2996,7 @@ function handle_tag(&$body, &$str_tags, $profile_uid, $tag, $in_network = true)
}
// is the link already in str_tags?
if (! stristr($str_tags, $newtag)) {
if (is_string($newtag) && ! stristr($str_tags, $newtag)) {
// append or set str_tags
if (strlen($str_tags)) {
$str_tags .= ',';

View file

@ -1,2 +1,2 @@
<?php
define ( 'STD_VERSION', '21.12.04' );
define ( 'STD_VERSION', '21.12.15' );