Skip to content

Commit

Permalink
[Fixes OrchardCMS#4723] Orchard.Core.Contents - Verify type exists on…
Browse files Browse the repository at this point in the history
… create content
  • Loading branch information
rtpHarry committed Oct 13, 2016
1 parent cf81574 commit d8d89d4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Orchard.Web/Core/Contents/Controllers/AdminController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,10 @@ public ActionResult Create(string id, int? containerId) {
if (string.IsNullOrEmpty(id))
return CreatableTypeList(containerId);

if (_contentDefinitionManager.GetTypeDefinition(id) == null) {
return RedirectToAction("Create", new { id = "" });
}

var contentItem = _contentManager.New(id);

if (!Services.Authorizer.Authorize(Permissions.EditContent, contentItem, T("Cannot create content")))
Expand Down

0 comments on commit d8d89d4

Please sign in to comment.