#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:
Sebastien Ros
2012-09-19 15:57:30 -07:00
parent 7fb5905b47
commit 8eff22d501
2 changed files with 3 additions and 6 deletions

View File

@@ -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)" />
*@

View File

@@ -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="" />