Merge branch 'dev-v7' of https://github.com/umbraco/Umbraco-CMS into dev-v7
This commit is contained in:
@@ -0,0 +1,38 @@
|
||||
using System.Linq;
|
||||
using Umbraco.Core.Configuration;
|
||||
using Umbraco.Core.Logging;
|
||||
using Umbraco.Core.Models.Rdbms;
|
||||
using Umbraco.Core.Persistence.SqlSyntax;
|
||||
|
||||
namespace Umbraco.Core.Persistence.Migrations.Upgrades.TargetVersionSevenThreeOne
|
||||
{
|
||||
/// <summary>
|
||||
/// This fixes the storage of user languages from the old format like en_us to en-US
|
||||
/// </summary>
|
||||
[Migration("7.3.1", 0, GlobalSettings.UmbracoMigrationName)]
|
||||
public class UpdateUserLanguagesToIsoCode : MigrationBase
|
||||
{
|
||||
public UpdateUserLanguagesToIsoCode(ISqlSyntaxProvider sqlSyntax, ILogger logger) : base(sqlSyntax, logger)
|
||||
{
|
||||
}
|
||||
|
||||
public override void Up()
|
||||
{
|
||||
var userData = Context.Database.Fetch<UserDto>(new Sql().Select("*").From<UserDto>(SqlSyntax));
|
||||
foreach (var user in userData.Where(x => x.UserLanguage.Contains("_")))
|
||||
{
|
||||
var languageParts = user.UserLanguage.Split('_');
|
||||
if (languageParts.Length == 2)
|
||||
{
|
||||
Update.Table("umbracoUser")
|
||||
.Set(new {userLanguage = languageParts[0] + "-" + languageParts[1].ToUpperInvariant()})
|
||||
.Where(new {id = user.Id});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public override void Down()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -435,6 +435,7 @@
|
||||
<Compile Include="Media\Exif\TIFFHeader.cs" />
|
||||
<Compile Include="Media\Exif\TIFFStrip.cs" />
|
||||
<Compile Include="Media\Exif\Utility.cs" />
|
||||
<Compile Include="Persistence\Migrations\Upgrades\TargetVersionSevenThreeOne\UpdateUserLanguagesToIsoCode.cs" />
|
||||
<Compile Include="Persistence\RecordPersistenceType.cs" />
|
||||
<Compile Include="Persistence\Relators\AccessRulesRelator.cs" />
|
||||
<Compile Include="Persistence\Repositories\AuditRepository.cs" />
|
||||
|
||||
@@ -471,7 +471,7 @@ namespace Umbraco.Web.Editors
|
||||
{
|
||||
tempFiles.Notifications.Add(new Notification(
|
||||
Services.TextService.Localize("speechBubbles/operationFailedHeader"),
|
||||
"Cannot upload file " + file + ", it is not an approved file type",
|
||||
"Cannot upload file " + file.Headers.ContentDisposition.FileName + ", it is not an approved file type",
|
||||
SpeechBubbleIcon.Warning));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,6 @@ using umbraco.BasePages;
|
||||
using umbraco.BusinessLogic;
|
||||
using umbraco.businesslogic.Exceptions;
|
||||
using umbraco.cms.businesslogic.media;
|
||||
using umbraco.cms.businesslogic.propertytype;
|
||||
using umbraco.cms.businesslogic.web;
|
||||
using umbraco.controls;
|
||||
using umbraco.presentation.channels.businesslogic;
|
||||
@@ -28,7 +27,9 @@ using umbraco.providers;
|
||||
using umbraco.cms.presentation.Trees;
|
||||
using Umbraco.Core.IO;
|
||||
using Umbraco.Core;
|
||||
using Umbraco.Core.Models;
|
||||
using Umbraco.Core.Services;
|
||||
using PropertyType = umbraco.cms.businesslogic.propertytype.PropertyType;
|
||||
|
||||
namespace umbraco.cms.presentation.user
|
||||
{
|
||||
@@ -106,8 +107,8 @@ namespace umbraco.cms.presentation.user
|
||||
userType.Items.Add(li);
|
||||
}
|
||||
}
|
||||
|
||||
var userCulture = Services.TextService.ConvertToSupportedCultureWithRegionCode(new CultureInfo(u.Language));
|
||||
|
||||
var userCulture = UserExtensions.GetUserCulture(u.Language, Services.TextService);
|
||||
|
||||
// Populate ui language lsit
|
||||
foreach (var lang in Services.TextService.GetSupportedCultures())
|
||||
|
||||
@@ -161,7 +161,7 @@ namespace umbraco.presentation.umbraco.webservices
|
||||
var ext = uploadFile.FileName.Substring(uploadFile.FileName.LastIndexOf('.') + 1).ToLower();
|
||||
if (UmbracoConfig.For.UmbracoSettings().Content.DisallowedUploadFiles.Contains(ext))
|
||||
{
|
||||
LogHelper.Warn<MediaUploader>("Cannot upload file " + uploadFile + ", it is not an approved file type");
|
||||
LogHelper.Warn<MediaUploader>("Cannot upload file " + uploadFile.FileName + ", it is not approved in `disallowedUploadFiles` in ~/config/UmbracoSettings.config");
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user