7 Commits
3.6 ... 3.6.1

Author SHA1 Message Date
Mario Vavti
d00761628f fix sql empty query error in db update 1216
(cherry picked from commit e4a1286aae)
2018-07-29 08:06:29 +02:00
Mario Vavti
6c10af29ee verrsion bump 2018-07-29 07:09:46 +02:00
Mario Vavti
ae62d6fb86 wrong class name
(cherry picked from commit 5dbd11c6ed)
2018-07-29 07:05:29 +02:00
zotlabs
d2e0ecd6a3 fix unsanitised xchan_name
(cherry picked from commit 9701516228)
2018-07-29 07:05:07 +02:00
zotlabs
13386ddbd7 SECURITY: sanitise vcard fields
(cherry picked from commit 2367d94a42)
2018-07-29 07:04:38 +02:00
zotlabs
17291e04df app update and ownership issues
(cherry picked from commit e28dab17d6)
2018-07-28 21:18:28 +02:00
Mario Vavti
7062a7ce66 fix sql error
(cherry picked from commit ec3a066e4e)
2018-07-26 09:34:48 +02:00
5 changed files with 80 additions and 18 deletions

View File

@@ -140,10 +140,15 @@ class Apps {
foreach(self::$available_apps as $iapp) {
if($iapp['app_id'] == hash('whirlpool',$app['name'])) {
$notfound = false;
if(($iapp['app_version'] != $app['version'])
if(($iapp['app_version'] !== $app['version'])
|| ($app['plugin'] && (! $iapp['app_plugin']))) {
return intval($iapp['app_id']);
}
if(($iapp['app_url'] !== $app['url'])
|| ($iapp['app_photo'] !== $app['photo'])) {
return intval($iapp['app_id']);
}
}
}
@@ -198,12 +203,11 @@ class Apps {
if($lines) {
foreach($lines as $x) {
if(preg_match('/^([a-zA-Z].*?):(.*?)$/ism',$x,$matches)) {
$ret[$matches[1]] = trim(str_replace(array('$baseurl','$nick'),array($baseurl,$address),$matches[2]));
$ret[$matches[1]] = trim($matches[2]);
}
}
}
if(! $ret['photo'])
$ret['photo'] = $baseurl . '/' . get_default_profile_photo(80);
@@ -372,9 +376,24 @@ class Apps {
$papp['papp'] = self::papp_encode($papp);
// This will catch somebody clicking on a system "available" app that hasn't had the path macros replaced
// and they are allowed to see the app
if(strstr($papp['url'],'$baseurl') || strstr($papp['url'],'$nick') || strstr($papp['photo'],'$baseurl') || strstr($pap['photo'],'$nick')) {
$view_channel = local_channel();
if(! $view_channel) {
$sys = get_sys_channel();
$view_channel = $sys['channel_id'];
}
self::app_macros($view_channel,$papp);
}
if(! strstr($papp['url'],'://'))
$papp['url'] = z_root() . ((strpos($papp['url'],'/') === 0) ? '' : '/') . $papp['url'];
foreach($papp as $k => $v) {
if(strpos($v,'http') === 0 && $k != 'papp') {
if(! (local_channel() && strpos($v,z_root()) === 0)) {
@@ -787,6 +806,29 @@ class Apps {
}
static public function app_macros($uid,&$arr) {
if(! intval($uid))
return;
$baseurl = z_root();
$channel = channelx_by_n($uid);
$address = (($channel) ? $channel['channel_address'] : '');
//future expansion
$observer = \App::get_observer();
$arr['url'] = str_replace(array('$baseurl','$nick'),array($baseurl,$address),$arr['url']);
$arr['photo'] = str_replace(array('$baseurl','$nick'),array($baseurl,$address),$arr['photo']);
}
static public function app_store($arr) {
//logger('app_store: ' . print_r($arr,true));
@@ -796,6 +838,7 @@ class Apps {
$sys = get_sys_channel();
self::app_macros($arr['uid'],$arr);
$darray['app_url'] = ((x($arr,'url')) ? $arr['url'] : '');
$darray['app_channel'] = ((x($arr,'uid')) ? $arr['uid'] : 0);
@@ -881,11 +924,14 @@ class Apps {
$darray = array();
$ret = array('success' => false);
self::app_macros($arr['uid'],$arr);
$darray['app_url'] = ((x($arr,'url')) ? $arr['url'] : '');
$darray['app_channel'] = ((x($arr,'uid')) ? $arr['uid'] : 0);
$darray['app_id'] = ((x($arr,'guid')) ? $arr['guid'] : 0);
if((! $darray['app_url']) || (! $darray['app_channel']) || (! $darray['app_id']))
if((! $darray['app_url']) || (! $darray['app_id']))
return $ret;
if($arr['photo'] && (strpos($arr['photo'],'icon:') !== 0) && (! strstr($arr['photo'],z_root()))) {
@@ -972,9 +1018,6 @@ class Apps {
$ret['type'] = 'personal';
if($app['app_id'])
$ret['guid'] = $app['app_id'];
if($app['app_id'])
$ret['guid'] = $app['app_id'];

19
Zotlabs/Update/_1216.php Normal file
View File

@@ -0,0 +1,19 @@
<?php
namespace Zotlabs\Update;
class _1216 {
function run() {
$r = dbq("UPDATE xchan set xchan_name = 'unknown' where xchan_name like '%<%' ");
if($r) {
return UPDATE_SUCCESS;
}
else {
return UPDATE_FAILED;
}
}
}

View File

@@ -50,11 +50,11 @@ require_once('include/attach.php');
require_once('include/bbcode.php');
define ( 'PLATFORM_NAME', 'hubzilla' );
define ( 'STD_VERSION', '3.6' );
define ( 'STD_VERSION', '3.6.1' );
define ( 'ZOT_REVISION', '6.0a' );
define ( 'DB_UPDATE_VERSION', 1215 );
define ( 'DB_UPDATE_VERSION', 1216 );
define ( 'PROJECT_BASE', __DIR__ );

View File

@@ -382,7 +382,7 @@ function contact_remove($channel_id, $abook_id) {
$r = fetch_post_tags($r,true);
foreach($r as $rr) {
$x = q("select uid from term where otype = %d and oid = %d ttype = %d limit 1",
$x = q("select uid from term where otype = %d and oid = %d and ttype = %d limit 1",
intval(TERM_OBJ_POST),
intval($rr['id']),
intval(TERM_FILE)

View File

@@ -1923,23 +1923,23 @@ function scrape_vcard($url) {
$level2 = $item->getElementsByTagName('*');
foreach($level2 as $x) {
if(attribute_contains($x->getAttribute('id'),'pod_location'))
$ret['pod_location'] = $x->textContent;
$ret['pod_location'] = escape_tags($x->textContent);
if(attribute_contains($x->getAttribute('class'),'fn'))
$ret['fn'] = $x->textContent;
$ret['fn'] = escape_tags($x->textContent);
if(attribute_contains($x->getAttribute('class'),'uid'))
$ret['uid'] = $x->textContent;
$ret['uid'] = escape_tags($x->textContent);
if(attribute_contains($x->getAttribute('class'),'nickname'))
$ret['nick'] = $x->textContent;
$ret['nick'] = escape_tags($x->textContent);
if(attribute_contains($x->getAttribute('class'),'searchable'))
$ret['searchable'] = $x->textContent;
$ret['searchable'] = escape_tags($x->textContent);
if(attribute_contains($x->getAttribute('class'),'key'))
$ret['public_key'] = $x->textContent;
if(attribute_contains($x->getAttribute('class'),'given_name'))
$ret['given_name'] = $x->textContent;
$ret['given_name'] = escape_tags($x->textContent);
if(attribute_contains($x->getAttribute('class'),'family_name'))
$ret['family_name'] = $x->textContent;
$ret['family_name'] = escxape_tags($x->textContent);
if(attribute_contains($x->getAttribute('class'),'url'))
$ret['url'] = $x->textContent;
$ret['url'] = escape_tags($x->textContent);
if((attribute_contains($x->getAttribute('class'),'photo'))
|| (attribute_contains($x->getAttribute('class'),'avatar'))) {