Commit 15004990 authored by Zot's avatar Zot

move dreamhost hack to addon

parent d24dd4ff
......@@ -920,6 +920,12 @@ function diaspora_comment($importer,$xml,$msg) {
$parent_guid = notags(unxmlify($xml['parent_guid']));
$diaspora_handle = notags(diaspora_get_author($xml));
$created_at = ((array_key_exists('created_at',$xml))
? datetime_convert('UTC','UTC',unxmlify($xml['created_at'])) : datetime_convert());
$thr_parent = ((array_key_exists('thread_parent_guid',$xml))
? notags(unxmlify($xml['thread_parent_guid'])) : '');
$text = unxmlify($xml['text']);
$author_signature = notags(unxmlify($xml['author_signature']));
$parent_author_signature = (($xml['parent_author_signature']) ? notags(unxmlify($xml['parent_author_signature'])) : '');
......@@ -1138,12 +1144,11 @@ function diaspora_comment($importer,$xml,$msg) {
$datarray['verb'] = ACTIVITY_POST;
$datarray['mid'] = $guid;
$datarray['parent_mid'] = $parent_item['mid'];
$datarray['thr_parent'] = $thr_parent;
// set the route to that of the parent so downstream hubs won't reject it.
$datarray['route'] = $parent_item['route'];
// No timestamps for comments? OK, we'll the use current time.
$datarray['changed'] = $datarray['created'] = $datarray['edited'] = datetime_convert();
$datarray['changed'] = $datarray['created'] = $datarray['edited'] = $created_at;
$datarray['item_private'] = $parent_item['item_private'];
$datarray['owner_xchan'] = $parent_item['owner_xchan'];
......
<?php
/**
* Name: Dreamhost
* Description: Improved operation on Dreamhost shared hosting
* Version: 1.0
* Maintainer: none;
*/
function dreamhost_load() {
Zotlabs\Extend\Hook::register('page_not_found', 'addon/dreamhost/dreamhost.php','dreamhost_page_not_found');
}
function dreamhost_unload() {
Zotlabs\Extend\Hook::unregister('page_not_found', 'addon/dreamhost/dreamhost.php','dreamhost_page_not_found');
}
function dreamhost_page_not_found($x) {
if((array_key_exists('QUERY_STRING',$_SERVER))
&& ($_SERVER['QUERY_STRING'] === 'q=internal_error.html')) {
logger('Original URI =' . $_SERVER['REQUEST_URI'],LOGGER_DEBUG);
goaway(z_root() . $_SERVER['REQUEST_URI']);
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment