Switching project access information to use JSON instead of serialization, fixes #493
This commit is contained in:
parent
490b9cf019
commit
2875badb0a
3 changed files with 19 additions and 4 deletions
|
|
@ -44,9 +44,25 @@ class Project extends ProjectBase
|
|||
return null;
|
||||
}
|
||||
|
||||
public function setAccessInformation($value)
|
||||
{
|
||||
if (is_array($value)) {
|
||||
$value = json_encode($value);
|
||||
}
|
||||
|
||||
parent::setAccessInformation($value);
|
||||
}
|
||||
|
||||
public function getAccessInformation($key = null)
|
||||
{
|
||||
$data = unserialize($this->data['access_information']);
|
||||
$info = $this->data['access_information'];
|
||||
|
||||
// Handle old-format (serialized) access information first:
|
||||
if (!empty($info) && substr($info, 0, 1) != '{') {
|
||||
$data = unserialize($info);
|
||||
} else {
|
||||
$data = json_decode($info, true);
|
||||
}
|
||||
|
||||
if (is_null($key)) {
|
||||
$rtn = $data;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue