mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +08:00
#18997: Fixing Media Picker upload
In MVC 4, IsLocalUrl is more restrictive and would not accept paths like 'images' Removing the test is safe as the Media service will prevent unauthorized usage. Work Item: 18997 --HG-- branch : 1.x
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
}
|
||||
<p class="media-picker-field media-picker-field-@name.HtmlClassify()">
|
||||
@if (Html.IsPicture((string)Model.ContentField.Url)) {
|
||||
<img src="@Href(Model.ContentField.Url)"@if (!String.IsNullOrWhiteSpace(Model.ContentField.Class)) {
|
||||
<img src="@Url.Content(Model.ContentField.Url)"@if (!String.IsNullOrWhiteSpace(Model.ContentField.Class)) {
|
||||
<text> class="@Model.ContentField.Class"</text>
|
||||
}@if (!String.IsNullOrWhiteSpace(Model.ContentField.Style)) {
|
||||
<text> style="@Model.ContentField.Style"</text>
|
||||
@@ -21,7 +21,7 @@
|
||||
}/>
|
||||
}
|
||||
else if (!String.IsNullOrWhiteSpace(Model.ContentField.Url)) {
|
||||
<a href="@Href(Model.ContentField.Url)" class="value">@name</a>
|
||||
<a href="@Url.Content(Model.ContentField.Url)" class="value">@name</a>
|
||||
}
|
||||
</p>
|
||||
|
||||
@@ -35,5 +35,5 @@
|
||||
Height: @Model.ContentField.Height
|
||||
|
||||
You can also display an image using this example, and add the attributes you need:
|
||||
<img src="@Href(Model.ContentField.Url)" />
|
||||
<img src="@Url.Content(Model.ContentField.Url)" />
|
||||
*@
|
@@ -8,9 +8,6 @@
|
||||
var uploadAction = Url.Action("AddFromClient", "Admin", new { area = "Orchard.Media" });
|
||||
// media directory to save uploaded files into
|
||||
var mediaPath = Request["uploadpath"];
|
||||
if (!Url.IsLocalUrl(mediaPath)) {
|
||||
mediaPath = "";
|
||||
}
|
||||
}
|
||||
<div id="image-preview">
|
||||
<img alt="" id="img-loader" style="display:none" src="" />
|
||||
|
Reference in New Issue
Block a user