Merge remote-tracking branch 'mike/master' into dev

This commit is contained in:
Mario Vavti 2017-08-16 10:16:33 +02:00
commit 1c5629263b
5 changed files with 26 additions and 12 deletions

View File

@ -2,7 +2,7 @@
namespace Zotlabs\Module; namespace Zotlabs\Module;
require_once('include/zot.php'); require_once('include/zot.php');
require_once('addon/pubcrawl/HTTPSig.php');
class Ap_probe extends \Zotlabs\Web\Controller { class Ap_probe extends \Zotlabs\Web\Controller {
@ -21,16 +21,19 @@ class Ap_probe extends \Zotlabs\Web\Controller {
$addr = $_GET['addr']; $addr = $_GET['addr'];
if($_GET['magenv']) { if($_GET['magenv']) {
$headers = 'Accept: application/magic-envelope+json, application/ld+json; profile="https://www.w3.org/ns/activitystreams"'; $headers = 'Accept: application/magic-envelope+json, application/activity+json, application/ld+json; profile="https://www.w3.org/ns/activitystreams"';
} }
else { else {
$headers = 'Accept: application/ld+json; profile="https://www.w3.org/ns/activitystreams"'; $headers = 'Accept: application/activity+json, application/ld+json; profile="https://www.w3.org/ns/activitystreams"';
} }
$redirects = 0; $redirects = 0;
$x = z_fetch_url($addr,true,$redirects, [ 'headers' => [ $headers ]]); $x = z_fetch_url($addr,true,$redirects, [ 'headers' => [ $headers ]]);
if($x['success']) if($x['success'])
$o .= '<pre>' . $x['header'] . '</pre>' . EOL; $o .= '<pre>' . $x['header'] . '</pre>' . EOL;
$o .= 'verify returns: ' . \HTTPSig::verify($x) . EOL;
$o .= '<pre>' . str_replace(['\\n','\\'],["\n",''],jindent($x['body'])) . '</pre>'; $o .= '<pre>' . str_replace(['\\n','\\'],["\n",''],jindent($x['body'])) . '</pre>';
} }
return $o; return $o;

View File

@ -40,6 +40,20 @@ class HTTPHeaders {
function fetch() { function fetch() {
return $this->parsed; return $this->parsed;
} }
function fetcharr() {
$ret = [];
if($this->parsed) {
foreach($this->parsed as $x) {
foreach($x as $y => $z) {
$ret[$y] = $z;
}
}
}
return $ret;
}
} }

View File

@ -1600,7 +1600,6 @@ function item_store($arr, $allow_exec = false, $deliver = true) {
$arr['aid'] = ((x($arr,'aid')) ? intval($arr['aid']) : 0); $arr['aid'] = ((x($arr,'aid')) ? intval($arr['aid']) : 0);
$arr['mid'] = ((x($arr,'mid')) ? notags(trim($arr['mid'])) : random_string()); $arr['mid'] = ((x($arr,'mid')) ? notags(trim($arr['mid'])) : random_string());
$arr['revision'] = ((x($arr,'revision') && intval($arr['revision']) > 0) ? intval($arr['revision']) : 0); $arr['revision'] = ((x($arr,'revision') && intval($arr['revision']) > 0) ? intval($arr['revision']) : 0);
logger('revision: ' . $arr['revision']);
$arr['author_xchan'] = ((x($arr,'author_xchan')) ? notags(trim($arr['author_xchan'])) : ''); $arr['author_xchan'] = ((x($arr,'author_xchan')) ? notags(trim($arr['author_xchan'])) : '');
$arr['owner_xchan'] = ((x($arr,'owner_xchan')) ? notags(trim($arr['owner_xchan'])) : ''); $arr['owner_xchan'] = ((x($arr,'owner_xchan')) ? notags(trim($arr['owner_xchan'])) : '');

View File

@ -2401,13 +2401,6 @@ function handle_tag($a, &$body, &$access_tag, &$str_tags, $profile_uid, $tag, $d
//...do nothing //...do nothing
return $replaced; return $replaced;
} }
if($tag == '#getzot') {
$basetag = 'getzot';
$url = 'http://hubzilla.org';
$newtag = '#[zrl=' . $url . ']' . $basetag . '[/zrl]';
$body = str_replace($tag,$newtag,$body);
$replaced = true;
}
if(! $replaced) { if(! $replaced) {
//base tag has the tags name only //base tag has the tags name only

View File

@ -272,6 +272,7 @@ var last_filestorage_id = null;
var mediaPlaying = false; var mediaPlaying = false;
var contentHeightDiff = 0; var contentHeightDiff = 0;
var liveRecurse = 0; var liveRecurse = 0;
var savedTitle = '';
$(function() { $(function() {
$.ajaxSetup({cache: false}); $.ajaxSetup({cache: false});
@ -401,11 +402,13 @@ function NavUpdate() {
if(data.network == 0) { if(data.network == 0) {
data.network = ''; data.network = '';
$('.net-update, .net-button').hide(); $('.net-update, .net-button').hide();
document.title = savedTitle;
} else { } else {
$('.net-update, .net-button').show(); $('.net-update, .net-button').show();
document.title = '(' + data.network + ') ' + savedTitle;
} }
$('.net-update').html(data.network); $('.net-update').html(data.network);
if(data.pubs == 0) { if(data.pubs == 0) {
data.pubs = ''; data.pubs = '';
$('.pubs-update, .pubs-button').hide(); $('.pubs-update, .pubs-button').hide();
@ -1384,6 +1387,8 @@ $(document).ready(function() {
numbers : aStr['t17'], numbers : aStr['t17'],
}; };
savedTitle = document.title;
}); });
function zFormError(elm,x) { function zFormError(elm,x) {