just mark dead hubloc deleted - don't remove them. This could cause problems. Also clean up fetch_url/post_url header option
This commit is contained in:
parent
6a82ccecd0
commit
c4608d4c82
@ -38,6 +38,7 @@ function z_fetch_url($url, $binary = false, $redirects = 0, $opts = array()) {
|
||||
return false;
|
||||
|
||||
@curl_setopt($ch, CURLOPT_HEADER, true);
|
||||
@curl_setopt($ch, CURLINFO_HEADER_OUT, true);
|
||||
@curl_setopt($ch, CURLOPT_CAINFO, get_capath());
|
||||
@curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true);
|
||||
@curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);
|
||||
@ -47,11 +48,8 @@ function z_fetch_url($url, $binary = false, $redirects = 0, $opts = array()) {
|
||||
if($ciphers)
|
||||
@curl_setopt($ch, CURLOPT_SSL_CIPHER_LIST, $ciphers);
|
||||
|
||||
if (x($opts,'accept_content')){
|
||||
@curl_setopt($ch,CURLOPT_HTTPHEADER, array (
|
||||
"Accept: " . $opts['accept_content']
|
||||
));
|
||||
}
|
||||
if(x($opts,'headers'))
|
||||
@curl_setopt($ch, CURLOPT_HTTPHEADER, $opts['headers']);
|
||||
|
||||
if(x($opts,'timeout') && intval($opts['timeout'])) {
|
||||
@curl_setopt($ch, CURLOPT_TIMEOUT, $opts['timeout']);
|
||||
@ -166,6 +164,7 @@ function z_post_url($url,$params, $redirects = 0, $opts = array()) {
|
||||
return ret;
|
||||
|
||||
@curl_setopt($ch, CURLOPT_HEADER, true);
|
||||
@curl_setopt($ch, CURLINFO_HEADER_OUT, true);
|
||||
@curl_setopt($ch, CURLOPT_CAINFO, get_capath());
|
||||
@curl_setopt($ch, CURLOPT_RETURNTRANSFER,true);
|
||||
@curl_setopt($ch, CURLOPT_POST,1);
|
||||
@ -176,12 +175,6 @@ function z_post_url($url,$params, $redirects = 0, $opts = array()) {
|
||||
if($ciphers)
|
||||
@curl_setopt($ch, CURLOPT_SSL_CIPHER_LIST, $ciphers);
|
||||
|
||||
|
||||
if (x($opts,'accept_content')){
|
||||
@curl_setopt($ch,CURLOPT_HTTPHEADER, array (
|
||||
"Accept: " . $opts['accept_content']
|
||||
));
|
||||
}
|
||||
if(x($opts,'headers'))
|
||||
@curl_setopt($ch, CURLOPT_HTTPHEADER, $opts['headers']);
|
||||
|
||||
|
@ -266,6 +266,7 @@ function photo_upload($channel, $observer, $args) {
|
||||
proc_run('php', "include/notifier.php", 'wall-new', $item_id);
|
||||
|
||||
$ret['success'] = true;
|
||||
$ret['item'] = $arr;
|
||||
$ret['body'] = $arr['body'];
|
||||
$ret['resource_id'] = $photo_hash;
|
||||
$ret['photoitem_id'] = $item_id;
|
||||
|
@ -1844,8 +1844,10 @@ function sync_locations($sender,$arr,$absolute = false) {
|
||||
if($absolute && $xisting) {
|
||||
foreach($xisting as $x) {
|
||||
if(! array_key_exists('updated',$x)) {
|
||||
logger('sync_locations: removing unreferenced hub location ' . $x['hubloc_url']);
|
||||
$r = q("delete from hubloc where hubloc_id = %d limit 1",
|
||||
logger('sync_locations: deleting unreferenced hub location ' . $x['hubloc_url']);
|
||||
$r = q("update hubloc set hubloc_flags = (hubloc_flags ^ %d), hubloc_updated = '%s' where hubloc_id = %d limit 1",
|
||||
intval(HUBLOC_FLAGS_DELETED),
|
||||
dbesc(datetime_convert()),
|
||||
intval($x['hubloc_id'])
|
||||
);
|
||||
$what .= 'removed_hub';
|
||||
|
Reference in New Issue
Block a user