mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2025-08-08 22:42:29 -04:00
remove more v1 remnants
kudos @Ribas160
This commit is contained in:
parent
410cc909ce
commit
c99e6895dd
4 changed files with 22 additions and 23 deletions
|
@ -171,23 +171,28 @@ abstract class AbstractData
|
|||
abstract public function getAllPastes();
|
||||
|
||||
/**
|
||||
* Get next free slot for comment from postdate.
|
||||
* Get next free slot for comment from the creation timestamp
|
||||
*
|
||||
* The creation timestamp is usually a unix timestamp in seconds, but if a
|
||||
* comment already exists at that timestamp, a number, separated by a dot is
|
||||
* appended to it and incremented, then the function recurses until a free
|
||||
* slot is found.
|
||||
*
|
||||
* @access protected
|
||||
* @param array $comments
|
||||
* @param int|string $postdate
|
||||
* @param int|string $created
|
||||
* @return int|string
|
||||
*/
|
||||
protected function getOpenSlot(array &$comments, $postdate)
|
||||
protected function getOpenSlot(array &$comments, $created)
|
||||
{
|
||||
if (array_key_exists($postdate, $comments)) {
|
||||
$parts = explode('.', (string) $postdate, 2);
|
||||
if (array_key_exists($created, $comments)) {
|
||||
$parts = explode('.', (string) $created, 2);
|
||||
if (!array_key_exists(1, $parts)) {
|
||||
$parts[1] = 0;
|
||||
}
|
||||
++$parts[1];
|
||||
return $this->getOpenSlot($comments, implode('.', $parts));
|
||||
}
|
||||
return $postdate;
|
||||
return $created;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue