jordansamuel / PASTE

Paste is a project that started from the files pastebin.com used before it was bought.
https://phpaste.sourceforge.io/
GNU General Public License v3.0
295 stars 105 forks source link

[Bug] `conTime` throws TypeError given `$secs` is 0 #164

Closed bunder2015 closed 3 years ago

bunder2015 commented 3 years ago

I ran into some problems testing PASTE on a new install... (php 7.4.19)

count(): Parameter must be an array or an object that implements Countable in includes/functions.php on line 133
array_splice() expects parameter 1 to be array, null given in includes/functions.php on line 133

I think this happens only on new posts because the time since pasting is zero. Checking $secs for 0 and setting it to 1 before the array assignment seems to fix this.