aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs
diff options
context:
space:
mode:
Diffstat (limited to 'Zotlabs')
-rw-r--r--Zotlabs/Daemon/Expire.php2
-rw-r--r--Zotlabs/Module/Cloud.php12
-rw-r--r--Zotlabs/Module/Dav.php2
-rw-r--r--Zotlabs/Module/Dreport.php1
-rw-r--r--Zotlabs/Module/Item.php31
-rw-r--r--Zotlabs/Module/Setup.php5
-rw-r--r--Zotlabs/Storage/Directory.php2
-rw-r--r--Zotlabs/Web/SessionHandler.php3
8 files changed, 20 insertions, 38 deletions
diff --git a/Zotlabs/Daemon/Expire.php b/Zotlabs/Daemon/Expire.php
index 0ba83b240..215513e87 100644
--- a/Zotlabs/Daemon/Expire.php
+++ b/Zotlabs/Daemon/Expire.php
@@ -38,7 +38,7 @@ class Expire {
logger('site_expire: ' . $site_expire);
- $r = q("SELECT channel_id, channel_address, channel_pageflags, channel_expire_days from channel where true");
+ $r = q("SELECT channel_id, channel_system, channel_address, channel_expire_days from channel where true");
if ($r) {
foreach ($r as $rr) {
diff --git a/Zotlabs/Module/Cloud.php b/Zotlabs/Module/Cloud.php
index 833b1b493..9845c5658 100644
--- a/Zotlabs/Module/Cloud.php
+++ b/Zotlabs/Module/Cloud.php
@@ -23,7 +23,6 @@ require_once('vendor/autoload.php');
class Cloud extends \Zotlabs\Web\Controller {
function init() {
- require_once('include/reddav.php');
if (! is_dir('store'))
os_mkdir('store', STORAGE_DEFAULT_PERMISSIONS, false);
@@ -79,17 +78,6 @@ class Cloud extends \Zotlabs\Web\Controller {
$is_readable = false;
- if($_SERVER['REQUEST_METHOD'] === 'GET') {
- try {
- $x = RedFileData('/' . \App::$cmd, $auth);
- }
- catch(\Exception $e) {
- if($e instanceof Sabre\DAV\Exception\Forbidden) {
- http_status_exit(401, 'Permission denied.');
- }
- }
- }
-
// provide a directory view for the cloud in Hubzilla
$browser = new \Zotlabs\Storage\Browser($auth);
$auth->setBrowserPlugin($browser);
diff --git a/Zotlabs/Module/Dav.php b/Zotlabs/Module/Dav.php
index 6528e0271..9b4b576c8 100644
--- a/Zotlabs/Module/Dav.php
+++ b/Zotlabs/Module/Dav.php
@@ -44,8 +44,6 @@ class Dav extends \Zotlabs\Web\Controller {
}
}
- require_once('include/reddav.php');
-
if (! is_dir('store'))
os_mkdir('store', STORAGE_DEFAULT_PERMISSIONS, false);
diff --git a/Zotlabs/Module/Dreport.php b/Zotlabs/Module/Dreport.php
index 17ed6515e..d2933b464 100644
--- a/Zotlabs/Module/Dreport.php
+++ b/Zotlabs/Module/Dreport.php
@@ -146,6 +146,7 @@ class Dreport extends \Zotlabs\Web\Controller {
'$title' => sprintf( t('Delivery report for %1$s'),substr($mid,0,32)) . '...',
'$table' => $table,
'$mid' => urlencode($mid),
+ '$options' => t('Options'),
'$push' => t('Redeliver'),
'$entries' => $entries
));
diff --git a/Zotlabs/Module/Item.php b/Zotlabs/Module/Item.php
index 369dd3948..235c5528e 100644
--- a/Zotlabs/Module/Item.php
+++ b/Zotlabs/Module/Item.php
@@ -93,7 +93,7 @@ class Item extends \Zotlabs\Web\Controller {
$origin = (($api_source && array_key_exists('origin',$_REQUEST)) ? intval($_REQUEST['origin']) : 1);
- // To represent message-ids on other networks - this will create an item_id record
+ // To represent message-ids on other networks - this will create an iconfig record
$namespace = (($api_source && array_key_exists('namespace',$_REQUEST)) ? strip_tags($_REQUEST['namespace']) : '');
$remote_id = (($api_source && array_key_exists('remote_id',$_REQUEST)) ? strip_tags($_REQUEST['remote_id']) : '');
@@ -535,7 +535,7 @@ class Item extends \Zotlabs\Web\Controller {
}
/**
- * fix naked links by passing through a callback to see if this is a red site
+ * fix naked links by passing through a callback to see if this is a hubzilla site
* (already known to us) which will get a zrl, otherwise link with url, add bookmark tag to both.
* First protect any url inside certain bbcode tags so we don't double link it.
*/
@@ -834,21 +834,23 @@ class Item extends \Zotlabs\Web\Controller {
if($orig_post)
$datarray['edit'] = true;
+ // suppress duplicates, *unless* you're editing an existing post. This could get picked up
+ // as a duplicate if you're editing it very soon after posting it initially and you edited
+ // some attribute besides the content, such as title or categories.
+
if(feature_enabled($profile_uid,'suppress_duplicates') && (! $orig_post)) {
- $z = q("select created from item where uid = %d and body = '%s'",
+ $z = q("select created from item where uid = %d and created > %s - INTERVAL %s and body = '%s' limit 1",
intval($profile_uid),
+ db_utcnow(),
+ db_quoteinterval('2 MINUTE'),
dbesc($body)
);
if($z) {
- foreach($z as $zz) {
- if($zz['created'] > datetime_convert('UTC','UTC', 'now - 2 minutes')) {
- $datarray['cancel'] = 1;
- notice( t('Duplicate post suppressed.') . EOL);
- logger('Duplicate post. Faking plugin cancel.');
- }
- }
+ $datarray['cancel'] = 1;
+ notice( t('Duplicate post suppressed.') . EOL);
+ logger('Duplicate post. Faking plugin cancel.');
}
}
@@ -903,7 +905,7 @@ class Item extends \Zotlabs\Web\Controller {
if($r) {
xchan_query($r);
$sync_item = fetch_post_tags($r);
- build_sync_packet($uid,array('item' => array(encode_item($sync_item[0],true))));
+ build_sync_packet($profile_uid,array('item' => array(encode_item($sync_item[0],true))));
}
}
if(! $nopush)
@@ -998,7 +1000,7 @@ class Item extends \Zotlabs\Web\Controller {
if($r) {
xchan_query($r);
$sync_item = fetch_post_tags($r);
- build_sync_packet($uid,array('item' => array(encode_item($sync_item[0],true))));
+ build_sync_packet($profile_uid,array('item' => array(encode_item($sync_item[0],true))));
}
}
@@ -1012,11 +1014,6 @@ class Item extends \Zotlabs\Web\Controller {
logger('post_complete');
-
-
-
-
-
// figure out how to return, depending on from whence we came
if($api_source)
diff --git a/Zotlabs/Module/Setup.php b/Zotlabs/Module/Setup.php
index c5d0ccc21..802f0c216 100644
--- a/Zotlabs/Module/Setup.php
+++ b/Zotlabs/Module/Setup.php
@@ -493,7 +493,6 @@ class Setup extends \Zotlabs\Web\Controller {
$this->check_add($ck_funcs, t('OpenSSL PHP module'), true, true);
$this->check_add($ck_funcs, t('mysqli or postgres PHP module'), true, true);
$this->check_add($ck_funcs, t('mb_string PHP module'), true, true);
- $this->check_add($ck_funcs, t('mcrypt PHP module'), true, true);
$this->check_add($ck_funcs, t('xml PHP module'), true, true);
if(function_exists('apache_get_modules')){
@@ -530,10 +529,6 @@ class Setup extends \Zotlabs\Web\Controller {
$ck_funcs[4]['status'] = false;
$ck_funcs[4]['help'] = t('Error: mb_string PHP module required but not installed.');
}
- if(! function_exists('mcrypt_encrypt')) {
- $ck_funcs[5]['status'] = false;
- $ck_funcs[5]['help'] = t('Error: mcrypt PHP module required but not installed.');
- }
if(! extension_loaded('xml')) {
$ck_funcs[6]['status'] = false;
$ck_funcs[6]['help'] = t('Error: xml PHP module required for DAV but not installed.');
diff --git a/Zotlabs/Storage/Directory.php b/Zotlabs/Storage/Directory.php
index 7a2d9e68b..b524b3cab 100644
--- a/Zotlabs/Storage/Directory.php
+++ b/Zotlabs/Storage/Directory.php
@@ -206,6 +206,8 @@ class Directory extends DAV\Node implements DAV\ICollection, DAV\IQuota {
throw new DAV\Exception\Forbidden('Permission denied.');
}
+ require_once('include/attach.php');
+
$mimetype = z_mime_content_type($name);
$c = q("SELECT * FROM channel WHERE channel_id = %d AND channel_removed = 0 LIMIT 1",
diff --git a/Zotlabs/Web/SessionHandler.php b/Zotlabs/Web/SessionHandler.php
index 6e7333b4b..93b27a7e8 100644
--- a/Zotlabs/Web/SessionHandler.php
+++ b/Zotlabs/Web/SessionHandler.php
@@ -24,7 +24,8 @@ class SessionHandler implements \SessionHandlerInterface {
return $r[0]['sess_data'];
}
else {
- q("INSERT INTO `session` (sid, expire) values ('%s', '%s')",
+ q("INSERT INTO `session` (sess_data, sid, expire) values ('%s', '%s', '%s')",
+ dbesc(''),
dbesc($id),
dbesc(time() + 300)
);