Differential D8516 Diff 20210 src/applications/diffusion/conduit/ConduitAPI_diffusion_getcommits_Method.php
Changeset View
Changeset View
Standalone View
Standalone View
src/applications/diffusion/conduit/ConduitAPI_diffusion_getcommits_Method.php
Show All 35 Lines | final class ConduitAPI_diffusion_getcommits_Method | ||||
protected function execute(ConduitAPIRequest $request) { | protected function execute(ConduitAPIRequest $request) { | ||||
$results = array(); | $results = array(); | ||||
$commits = $request->getValue('commits'); | $commits = $request->getValue('commits'); | ||||
$commits = array_fill_keys($commits, array()); | $commits = array_fill_keys($commits, array()); | ||||
foreach ($commits as $name => $info) { | foreach ($commits as $name => $info) { | ||||
$matches = null; | $matches = null; | ||||
if (!preg_match('/^r([A-Z]+)([0-9a-f]+)$/', $name, $matches)) { | if (!preg_match('/^r([A-Z]+)([0-9a-f]+)\z/', $name, $matches)) { | ||||
$results[$name] = array( | $results[$name] = array( | ||||
'error' => 'ERR-UNPARSEABLE', | 'error' => 'ERR-UNPARSEABLE', | ||||
); | ); | ||||
unset($commits[$name]); | unset($commits[$name]); | ||||
continue; | continue; | ||||
} | } | ||||
$commits[$name] = array( | $commits[$name] = array( | ||||
'callsign' => $matches[1], | 'callsign' => $matches[1], | ||||
▲ Show 20 Lines • Show All 248 Lines • Show Last 20 Lines |