-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix for #101 (access to restricted resources) #102
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -399,6 +399,10 @@ public function getVersionDetails($class = 'vxResource',$id = 0, $json = false, | |
/* Class specific processing */ | ||
switch ($class) { | ||
case 'vxResource': | ||
$resource = $this->modx->getObject('modResource',$v->get('content_id')); | ||
if(!$resource) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This check should be removed; just because a resource no longer exists does not mean it should not be available in VersionX. Restoring resources that were deleted is kind of a big deal for a versioning plugin. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, you're right. I will check for a better solution later on. |
||
return false; | ||
} | ||
$vArray = array_merge($vArray,$vArray['fields']); | ||
|
||
if ($vArray['parent'] != 0) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ew, Mark-from-5-years-ago, y u no use braces 😧