1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/hubzilla_ynh.git synced 2024-09-03 19:26:21 +02:00
hubzilla_ynh/sources/addons/dfedfix/dfedfix.php

30 lines
No EOL
811 B
PHP

<?php
/**
* Name: Dfedfix
* Description: Fix Diaspora federation until the proper fix is deployed
* Version: 1.0
* Author: Mike Macgirvin
*/
function dfedfix_load() {
register_hook('personal_xrd', 'addon/dfedfix/dfedfix.php', 'dfedfix_personal_xrd');
}
function dfedfix_unload() {
unregister_hook('personal_xrd', 'addon/dfedfix/dfedfix.php', 'dfedfix_personal_xrd');
}
function dfedfix_personal_xrd(&$a,&$b) {
logger('dfedfix: ' . print_r($b,true));
$x = $b['xml'];
$x = str_replace('</Subject>','</Subject>
<Alias>' . z_root() . '/channel/' . $b['user']['channel_address'] . '</Alias>',$x);
$x = str_replace('.AQAB" />','.AQAB "/>
<Link rel="salmon" href="' . z_root() . '/receive/users/' . $b['user']['channel_guid'] . str_replace('.','',$a->get_hostname()) . '"/>',$x);
$b['xml'] = $x;
}