Page MenuHomePhorge

D25575.1734730083.diff
No OneTemporary

D25575.1734730083.diff

diff --git a/src/applications/conduit/protocol/ConduitAPIRequest.php b/src/applications/conduit/protocol/ConduitAPIRequest.php
--- a/src/applications/conduit/protocol/ConduitAPIRequest.php
+++ b/src/applications/conduit/protocol/ConduitAPIRequest.php
@@ -17,6 +17,13 @@
return coalesce(idx($this->params, $key), $default);
}
+ public function getIntValue($key, $default = 'undefined_magic_text') {
+ if ($default === 'undefined_magic_text' && !$this->getValueExists($key)) {
+ throw new Exception(pht('Required int param not provided: %s', $key));
+ }
+ return (int)$this->getValue($key, $default);
+ }
+
public function getValueExists($key) {
return array_key_exists($key, $this->params);
}
diff --git a/src/applications/diffusion/conduit/DiffusionHistoryQueryConduitAPIMethod.php b/src/applications/diffusion/conduit/DiffusionHistoryQueryConduitAPIMethod.php
--- a/src/applications/diffusion/conduit/DiffusionHistoryQueryConduitAPIMethod.php
+++ b/src/applications/diffusion/conduit/DiffusionHistoryQueryConduitAPIMethod.php
@@ -51,8 +51,8 @@
$path = null;
}
- $offset = $request->getValue('offset');
- $limit = $request->getValue('limit');
+ $offset = $request->getIntValue('offset');
+ $limit = $request->getIntValue('limit', 100);
if (phutil_nonempty_string($against_hash)) {
$commit_range = "{$against_hash}..{$commit_hash}";

File Metadata

Mime Type
text/plain
Expires
Fri, Dec 20, 21:28 (16 h, 43 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1021113
Default Alt Text
D25575.1734730083.diff (1 KB)

Event Timeline