mirror of
https://github.com/PrivateBin/PrivateBin.git
synced 2025-08-14 09:15:44 -04:00
working on JsonApi tests
This commit is contained in:
parent
76dc01b959
commit
59569bf9fc
10 changed files with 128 additions and 134 deletions
|
@ -71,23 +71,16 @@ class Filesystem extends AbstractData
|
|||
*
|
||||
* @access public
|
||||
* @param string $pasteid
|
||||
* @return \stdClass|false
|
||||
* @return array|false
|
||||
*/
|
||||
public function read($pasteid)
|
||||
{
|
||||
if (!$this->exists($pasteid)) {
|
||||
return false;
|
||||
}
|
||||
$paste = DataStore::get(self::_dataid2path($pasteid) . $pasteid . '.php');
|
||||
if (property_exists($paste->meta, 'attachment')) {
|
||||
$paste->attachment = $paste->meta->attachment;
|
||||
unset($paste->meta->attachment);
|
||||
if (property_exists($paste->meta, 'attachmentname')) {
|
||||
$paste->attachmentname = $paste->meta->attachmentname;
|
||||
unset($paste->meta->attachmentname);
|
||||
}
|
||||
}
|
||||
return $paste;
|
||||
return self::upgradePreV1Format(
|
||||
DataStore::get(self::_dataid2path($pasteid) . $pasteid . '.php')
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue