Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2694008
D25575.1734770698.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
1 KB
Referenced Files
None
Subscribers
None
D25575.1734770698.diff
View Options
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
Details
Attached
Mime Type
text/plain
Expires
Sat, Dec 21, 08:44 (12 h, 11 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1021113
Default Alt Text
D25575.1734770698.diff (1 KB)
Attached To
Mode
D25575: Make sure `offset` is an integer
Attached
Detach File
Event Timeline
Log In to Comment