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/addon/dfedfix/dfedfix.php
2016-04-17 22:42:29 +05:30

31 lines
No EOL
832 B
PHP

<?php
/**
* Name: Dfedfix
* Description: Fix Diaspora federation until the proper fix is deployed
* Version: 1.0
* Author: Mike Macgirvin
* Maintainer: none
*/
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('.','',App::get_hostname()) . '"/>',$x);
$b['xml'] = $x;
}