From: Michael Date: Sun, 19 Feb 2017 10:13:40 +0000 (+0000) Subject: Ensure that the spool path is set X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=9251d2af6fe855fa14adaf87c05037e5ec5efc99;p=friendica.git Ensure that the spool path is set --- diff --git a/include/items.php b/include/items.php index 1e38e3fdb4..24eb1b30fb 100644 --- a/include/items.php +++ b/include/items.php @@ -860,9 +860,12 @@ function item_store($arr,$force_parent = false, $notify = false, $dontcache = fa // We use "microtime" to keep the arrival order and "mt_rand" to avoid duplicates $file = 'item-'.round(microtime(true) * 10000).'-'.mt_rand().'.msg'; - $spool = get_spoolpath().'/'.$file; - file_put_contents($spool, json_encode($arr)); - logger("Item wasn't stored - Item was spooled into file ".$file, LOGGER_DEBUG); + $spoolpath = get_spoolpath(); + if ($spoolpath != "") { + $spool = $spoolpath.'/'.$file; + file_put_contents($spool, json_encode($arr)); + logger("Item wasn't stored - Item was spooled into file ".$file, LOGGER_DEBUG); + } return 0; } diff --git a/include/spool_post.php b/include/spool_post.php index 36bcab2a55..b4cce46b57 100644 --- a/include/spool_post.php +++ b/include/spool_post.php @@ -27,7 +27,7 @@ function spool_post_run($argv, $argc) { $path = get_spoolpath(); - if (is_writable($path)){ + if (($path != '') AND is_writable($path)){ if ($dh = opendir($path)) { while (($file = readdir($dh)) !== false) {