FileObject: remove +e where used as its always appended nowadays (https://github.com/opnsense/core/commit/55204f9d77b9cb74f314edd5f4b778bbb1aaccf3)

Just a precaution, if for some reason, php in a future version would crash on receiving the same modifier twice, it feels safer to not having it.
This commit is contained in:
Ad Schellevis
2026-10-10 18:02:33 +02:00
parent f681fc26b3
commit 93af50075e
2 changed files with 2 additions and 2 deletions
@@ -412,7 +412,7 @@ abstract class BaseModel
return $class_info->newInstance(true)->getNodeContent();
}
$cache_filename = self::getCacheFileName();
$fobj = new \OPNsense\Core\FileObject($cache_filename, 'a+e', 0660, LOCK_EX, 'wwwonly:wheel');
$fobj = new \OPNsense\Core\FileObject($cache_filename, 'a+', 0660, LOCK_EX, 'wwwonly:wheel');
$cache_payload = $fobj->readJson() ?? [];
if (!isset($cache_payload['persisted_at']) || $cache_payload['persisted_at'] != $persisted_at) {
/**
@@ -45,7 +45,7 @@ class NetworkInterface extends BaseModel
*/
private function store_if_todo($id, $payload)
{
$fobj = new FileObject($this->todo_file, 'a+e', 0600, LOCK_EX);
$fobj = new FileObject($this->todo_file, 'a+', 0600, LOCK_EX);
$data = $fobj->readJson() ?? [];
$data[$id] = array_merge($data[$id] ?? [], $payload);
$fobj->truncate(0)->writeJson($data);