]> git.mxchange.org Git - friendica.git/commitdiff
Ensure that the spool path is set
authorMichael <heluecht@pirati.ca>
Sun, 19 Feb 2017 10:13:40 +0000 (10:13 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 19 Feb 2017 10:13:40 +0000 (10:13 +0000)
include/items.php
include/spool_post.php

index 1e38e3fdb424efe24c1fc005790a82eb07c12d00..24eb1b30fb7b97c823238d2a2989b9d9413b589e 100644 (file)
@@ -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;
        }
 
index 36bcab2a5570d865a851b84283b6abbe42990132..b4cce46b57eb6c9b02bbb09a6f35e5a913b09ac8 100644 (file)
@@ -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) {