mirror of
https://github.com/appwrite/appwrite.git
synced 2026-11-18 20:36:03 +00:00
fix(sites): stop listFrameworks leaking runtime commands
Response models filter nested Documents, not plain arrays. listFrameworks handed Config's raw rows straight to the response, so every key on them went out with it: each adapter's startCommand, plus the framework-level bundleCommand, envCommand and screenshotSleep. The console read that leaked start command and wrote it into sites as if the user had typed it. Wrap the rows in Documents so the declared models decide what ships.
This commit is contained in:
1 parent
93a36f2ba3
commit
a09d7553fb
1 file changed
+11
-1
@@ -79,9 +79,19 @@ class XList extends Base
|
||||
}
|
||||
}
|
||||
|
||||
// Response models only filter nested Documents. Handing over the raw config arrays
|
||||
// ships every key they carry, including the start, bundle and env commands that
|
||||
// belong to the runtime image.
|
||||
$frameworks = \array_map(fn (array $framework) => new Document(\array_replace($framework, [
|
||||
'adapters' => \array_map(
|
||||
fn (array $adapter) => new Document($adapter),
|
||||
$framework['adapters'] ?? []
|
||||
),
|
||||
])), \array_values($frameworks));
|
||||
|
||||
$response->dynamic(new Document([
|
||||
'total' => count($frameworks),
|
||||
'frameworks' => \array_values($frameworks)
|
||||
'frameworks' => $frameworks
|
||||
]), Response::MODEL_FRAMEWORK_LIST);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user