Merge pull request #12624 from nextcloud/bugfix/noid/validate-all-rich-objects

Validate all rich objects
pull/12838/head
Morris Jobke 8 years ago committed by GitHub
commit d8314b102e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      apps/dav/lib/CalDAV/Activity/Provider/Base.php
  2. 2
      apps/dav/tests/unit/CalDAV/Activity/Provider/BaseTest.php
  3. 2
      apps/files_sharing/lib/Activity/Providers/Groups.php
  4. 10
      lib/private/RichObjectStrings/Validator.php

@ -160,7 +160,7 @@ abstract class Base implements IProvider {
}
return [
'type' => 'group',
'type' => 'user-group',
'id' => $gid,
'name' => $this->groupDisplayNames[$gid],
];

@ -182,7 +182,7 @@ class BaseTest extends TestCase {
*/
public function testGenerateGroupParameter($gid) {
$this->assertEquals([
'type' => 'group',
'type' => 'user-group',
'id' => $gid,
'name' => $gid,
], $this->invokePrivate($this->provider, 'generateGroupParameter', [$gid]));

@ -150,7 +150,7 @@ class Groups extends Base {
}
return [
'type' => 'group',
'type' => 'user-group',
'id' => $gid,
'name' => $this->groupDisplayNames[$gid],
];

@ -71,11 +71,17 @@ class Validator implements IValidator {
foreach ($matches[1] as $parameter) {
if (!isset($parameters[$parameter])) {
throw new InvalidObjectExeption('Parameter is undefined');
} else {
$this->validateParameter($parameters[$parameter]);
}
}
}
foreach ($parameters as $parameter) {
if (!\is_array($parameter)) {
throw new InvalidObjectExeption('Parameter is malformed');
}
$this->validateParameter($parameter);
}
}
/**

Loading…
Cancel
Save