fixes U4-6333, U4-6348

This commit is contained in:
Shannon
2015-03-03 17:36:53 +11:00
parent d32cf12c6f
commit f708a24401
4 changed files with 27 additions and 48 deletions

View File

@@ -9,12 +9,13 @@
*/
function LegacyController($scope, $routeParams, $element) {
var url = $routeParams.url;
var toClean = "*?(){}[];:%<>/\\|&'\"";
var url = decodeURIComponent($routeParams.url.toLowerCase().trimStart("javascript:"));
var toClean = "*(){}[];:<>\\|'\"";
for (var i = 0; i < toClean.length; i++) {
url = url.replace(toClean[i], "");
var reg = new RegExp("\\" + toClean[i], "g");
url = url.replace(reg, "");
}
$scope.legacyPath = decodeURIComponent(url);
$scope.legacyPath = url;
}
angular.module("umbraco").controller('Umbraco.LegacyController', LegacyController);

View File

@@ -1,16 +1,24 @@
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="endPreview.aspx.cs" Inherits="umbraco.presentation.endPreview" %>
<%@ Page Language="C#" AutoEventWireup="true" Inherits="System.Web.UI.Page" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
Redirecting...
</div>
</form>
</body>
</html>
protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
global::umbraco.presentation.preview.PreviewContent.ClearPreviewCookie();
if (!Uri.IsWellFormedUriString(Request.QueryString["redir"], UriKind.Relative))
{
Response.Redirect("/", true);
}
Uri url;
if (!Uri.TryCreate(Request.QueryString["redir"], UriKind.Relative, out url))
{
Response.Redirect("/", true);
}
Response.Redirect(url.ToString(), true);
}
</script>5

View File

@@ -934,9 +934,6 @@
<Compile Include="umbraco.presentation\umbraco\dialogs\publish.aspx.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="umbraco.presentation\umbraco\endPreview.aspx.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="umbraco.presentation\umbraco\helpRedirect.aspx.cs">
<SubType>ASPXCodeBehind</SubType>
</Compile>

View File

@@ -1,27 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace umbraco.presentation
{
public partial class endPreview : BasePages.UmbracoEnsuredPage
{
protected void Page_Load(object sender, EventArgs e)
{
preview.PreviewContent.ClearPreviewCookie();
Response.Redirect(helper.Request("redir"), true);
}
/// <summary>
/// form1 control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlForm form1;
}
}