Skip to content

Commit a46267a

Browse files
committed
Fix h1 report 3399809
1 parent ac23ace commit a46267a

File tree

1 file changed

+7
-14
lines changed

1 file changed

+7
-14
lines changed

www/admin/inventory-retrieve.php

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@
2424
// Security check
2525
OA_Permission::enforceAccount(OA_ACCOUNT_MANAGER, OA_ACCOUNT_ADVERTISER);
2626

27-
2827
$aEntityMap = [];
28+
$idx = 0;
2929

3030
if (!empty($clientid)) {
3131
if (!OA_Permission::hasAccessToObject('clients', $clientid)) {
@@ -39,20 +39,13 @@
3939

4040
foreach ($aCampaigns as $campaignId => $aCampaign) {
4141
$campaignName = $aCampaign['name'];
42-
$aEntityMap[$campaignId] = $campaignName;
42+
$aEntityMap[$campaignId] = [
43+
'name' => $campaignName,
44+
'idx' => $idx++,
45+
];
4346
}
4447
}
4548

49+
MAX_header('Content-Type: application/json');
4650

47-
48-
if (count($aEntityMap)) {
49-
$idx = 0;
50-
foreach ($aEntityMap as $k => $v) {
51-
$aEntityMap[$k] = $k . ': { "name": "' . addslashes($v) . '","idx":"' . ($idx++) . '" }';
52-
}
53-
54-
echo "{" . implode(', ', $aEntityMap) . "}";
55-
exit;
56-
}
57-
58-
echo "{ }";
51+
echo json_encode($aEntityMap, JSON_FORCE_OBJECT);

0 commit comments

Comments
 (0)