From d34106b512f5b92e696788daf1a0a7ab28eb8d89 Mon Sep 17 00:00:00 2001 From: "DESKTOP-M4V1LH5\\Jin" Date: Thu, 23 Aug 2018 11:47:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0DI=E4=B8=AD=E9=97=B4=E4=BB=B6?= =?UTF-8?q?=EF=BC=9B=20=E5=90=8E=E5=8F=B0=E5=A2=9E=E5=8A=A0=E8=BF=9C?= =?UTF-8?q?=E7=A8=8B=E4=BF=9D=E5=AD=98=E5=9B=BE=E7=89=87=20=E4=BF=AE?= =?UTF-8?q?=E5=A4=8D=E5=90=8E=E5=8F=B0=E7=BC=96=E8=BE=91=E7=AE=A1=E7=90=86?= =?UTF-8?q?=E7=BB=84=E6=9D=83=E9=99=90bug=20=E6=9B=B4=E6=96=B0CKEditor=20?= =?UTF-8?q?=E5=88=B0=204.10.0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + COMCMS.Common/MyDIMiddleware.cs | 27 + COMCMS.Common/ThumbnailHelper.cs | 78 ++ .../AdminCP/Controllers/ArticleController.cs | 12 + .../AdminCP/Controllers/MemberController.cs | 4 +- .../AdminCP/Controllers/ProductController.cs | 12 + .../AdminCP/Views/Article/AddArticle.cshtml | 8 + .../AdminCP/Views/Article/EditArticle.cshtml | 11 +- .../AdminCP/Views/Member/EditAdminRole.cshtml | 30 +- .../AdminCP/Views/Product/AddProduct.cshtml | 40 +- .../AdminCP/Views/Product/EditProduct.cshtml | 38 +- COMCMS.Web/COMCMS.Web.csproj | 5 + COMCMS.Web/Startup.cs | 2 +- COMCMS.Web/wwwroot/editor/ckeditor/CHANGES.md | 101 ++- .../wwwroot/editor/ckeditor/ckeditor.js | 753 +++++++++--------- .../wwwroot/editor/ckeditor/contents.css | 7 +- .../wwwroot/editor/ckeditor/lang/zh-cn.js | 2 +- COMCMS.Web/wwwroot/editor/ckeditor/lang/zh.js | 2 +- .../plugins/a11yhelp/dialogs/lang/bg.js | 14 +- .../plugins/a11yhelp/dialogs/lang/et.js | 4 +- .../plugins/a11yhelp/dialogs/lang/fa.js | 4 +- .../ckeditor/plugins/find/dialogs/find.js | 42 +- .../ckeditor/plugins/scayt/dialogs/options.js | 63 +- .../plugins/specialchar/dialogs/lang/bg.js | 2 +- .../tableselection/styles/tableselection.css | 6 - .../plugins/wsc/dialogs/tmpFrameset.html | 59 +- .../ckeditor/plugins/wsc/dialogs/wsc.js | 168 ++-- .../ckeditor/skins/moono-lisa/editor.css | 2 +- .../skins/moono-lisa/editor_gecko.css | 2 +- .../ckeditor/skins/moono-lisa/editor_ie.css | 2 +- .../ckeditor/skins/moono-lisa/editor_ie8.css | 2 +- .../skins/moono-lisa/editor_iequirks.css | 2 +- 32 files changed, 874 insertions(+), 631 deletions(-) create mode 100644 COMCMS.Common/MyDIMiddleware.cs diff --git a/.gitignore b/.gitignore index 509668d..c92bdbb 100644 --- a/.gitignore +++ b/.gitignore @@ -303,3 +303,4 @@ __pycache__/ # OpenCover UI analysis results OpenCover/ +COMCMS.Web/wwwroot/userfiles/ diff --git a/COMCMS.Common/MyDIMiddleware.cs b/COMCMS.Common/MyDIMiddleware.cs new file mode 100644 index 0000000..d9d757c --- /dev/null +++ b/COMCMS.Common/MyDIMiddleware.cs @@ -0,0 +1,27 @@ +using System; +using System.Collections.Generic; +using System.Text; +using Microsoft.AspNetCore.Builder; + +namespace COMCMS.Common +{ + public static class Extensions + { + + public static IApplicationBuilder UseMyMVCDI(this IApplicationBuilder builder) + { + DI.ServiceProvider = builder.ApplicationServices; + return builder; + } + } + /// + /// 依赖注入 + /// + public static class DI + { + public static IServiceProvider ServiceProvider + { + get;set; + } + } +} diff --git a/COMCMS.Common/ThumbnailHelper.cs b/COMCMS.Common/ThumbnailHelper.cs index f49d535..0137a40 100644 --- a/COMCMS.Common/ThumbnailHelper.cs +++ b/COMCMS.Common/ThumbnailHelper.cs @@ -4,11 +4,30 @@ using System.DrawingCore.Drawing2D; using System.DrawingCore.Imaging; using System.Text; using System.DrawingCore; +using System.Net; +using System.Text.RegularExpressions; +using Microsoft.AspNetCore.Hosting; +using System.IO; +using NewLife.Log; namespace COMCMS.Common { public class ThumbnailHelper { + /// + /// 目录分隔符 + /// windows 下是 \ linux 下面是 \ + /// + private static string DirectorySeparatorChar = Path.DirectorySeparatorChar.ToString(); + /// + /// 程序绝对目录 + /// + private static string _ContentRootPath = DI.ServiceProvider.GetService().ContentRootPath; + /// + /// 静态文件 + /// + private static string _WebRootPath = DI.ServiceProvider.GetService().WebRootPath; + #region 方式 public enum CutMode { @@ -126,6 +145,8 @@ namespace COMCMS.Common } #endregion + + #region 帮助方法 /// /// 保存图片 /// @@ -178,6 +199,63 @@ namespace COMCMS.Common return ImageFormat.Jpeg; } } + #endregion + + #region 内容远程保存图片 + /// + /// 保存内容种远程图片到本地 + /// + /// + /// + public static string SaveRemoteImgForContent(string content) + { + string recontent = content; + if (string.IsNullOrEmpty(content)) + return ""; + WebClient client = new WebClient(); + + Regex reg = new Regex("IMG[^>]*?src\\s*=\\s*(?:\"(?<1>[^\"]*)\"|'(?<1>[^\']*)')", RegexOptions.IgnoreCase); + MatchCollection m = reg.Matches(content); + foreach (Match math in m) + { + string imgUrl = math.Groups[1].Value; + Regex regName = new Regex(@"\w+(?:jpg|gif|bmp|png|jpeg)", RegexOptions.IgnoreCase);//不按点。这样可以兼容复制公众号文章 + string imgName = imgUrl.Substring(imgUrl.LastIndexOf("/") + 1, imgUrl.Length - imgUrl.LastIndexOf("/") - 1); + //判断是否是远程图片 + if (imgUrl.ToLower().StartsWith("http://") || imgUrl.ToLower().StartsWith("https://") || imgUrl.ToLower().StartsWith("ftp://")) + { + string imgsrc = imgName.ToLower(); + string ext = "jpg"; + if (imgsrc.EndsWith("gif")) ext = "gif"; + else if (imgsrc.EndsWith("png")) ext = "png"; + else if (imgsrc.EndsWith("jpeg")) ext = "jpeg"; + else if (imgsrc.EndsWith("bmp")) ext = "bmp"; + string strNewImgName = Utils.GetOrderNum() + "." + ext; + string savepath = $"{_WebRootPath}\\userfiles\\images\\auto\\{DateTime.Now.Year.ToString()}\\{DateTime.Now.ToString("MM")}";// + string imgNewSrc = $"/userfiles/images/auto/{DateTime.Now.Year.ToString()}/{DateTime.Now.ToString("MM")}/{strNewImgName}";//保存后路径 + //判断路径 + if (!Directory.Exists(savepath)) + Directory.CreateDirectory(savepath); + string fullpath = Path.Combine(savepath, strNewImgName);//图片 + try + { + //保存图片 + client.DownloadFile(imgUrl, fullpath); + recontent = recontent.Replace(imgUrl, imgNewSrc); + } + catch (Exception ex) + { + //throw new Exception(ex.Message); + XTrace.WriteLine($"远程保存图片保存图片:{imgUrl},错误:{ex.Message}"); + } + } + + } + + return recontent; + } + #endregion + } diff --git a/COMCMS.Web/Areas/AdminCP/Controllers/ArticleController.cs b/COMCMS.Web/Areas/AdminCP/Controllers/ArticleController.cs index 0a73ab9..07c98c3 100644 --- a/COMCMS.Web/Areas/AdminCP/Controllers/ArticleController.cs +++ b/COMCMS.Web/Areas/AdminCP/Controllers/ArticleController.cs @@ -301,6 +301,12 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers } } } + string content = model.Content; + if(Request.Form["autoSaveRemoteImg"] == "1" && !string.IsNullOrEmpty(content)) + { + content = ThumbnailHelper.SaveRemoteImgForContent(content); + model.Content = content; + } model.ItemImg = morIMG; model.AuthorId = Core.Admin.GetMyInfo().Id; model.Insert(); @@ -392,6 +398,12 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers model.UpdateTime = DateTime.Now; model.ItemImg = morIMG; + string content = model.Content; + if (Request.Form["autoSaveRemoteImg"] == "1" && !string.IsNullOrEmpty(content)) + { + content = ThumbnailHelper.SaveRemoteImgForContent(content); + model.Content = content; + } //model.AuthorId = Core.Admin.GetMyInfo().Id; model.Save(); //Tag.ModifyTags(model.Tags, RTType.RatuoModule.Article, model.Id, model.Title); diff --git a/COMCMS.Web/Areas/AdminCP/Controllers/MemberController.cs b/COMCMS.Web/Areas/AdminCP/Controllers/MemberController.cs index 7967ebf..d36a15b 100644 --- a/COMCMS.Web/Areas/AdminCP/Controllers/MemberController.cs +++ b/COMCMS.Web/Areas/AdminCP/Controllers/MemberController.cs @@ -134,7 +134,7 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers //执行添加管理组 [HttpPost] [MyAuthorize("add", "adminrole", "JSON")] - public IActionResult AddAdminRole(FormCollection fc) + public IActionResult AddAdminRole(IFormCollection fc) { string RoleName = fc["RoleName"]; string RoleDescription = fc["RoleDescription"]; @@ -236,7 +236,7 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers //执行编辑管理组 [HttpPost] [MyAuthorize("edit", "adminrole", "JSON")] - public IActionResult EditAdminRole(FormCollection fc) + public IActionResult EditAdminRole(IFormCollection fc) { string Id = fc["Id"]; string RoleName = fc["RoleName"]; diff --git a/COMCMS.Web/Areas/AdminCP/Controllers/ProductController.cs b/COMCMS.Web/Areas/AdminCP/Controllers/ProductController.cs index b8c7a85..90cd0cf 100644 --- a/COMCMS.Web/Areas/AdminCP/Controllers/ProductController.cs +++ b/COMCMS.Web/Areas/AdminCP/Controllers/ProductController.cs @@ -301,6 +301,12 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers } } } + string content = model.Content; + if (Request.Form["autoSaveRemoteImg"] == "1" && !string.IsNullOrEmpty(content)) + { + content = ThumbnailHelper.SaveRemoteImgForContent(content); + model.Content = content; + } model.ItemImg = morIMG; model.AuthorId = Core.Admin.GetMyInfo().Id; model.Insert(); @@ -399,6 +405,12 @@ namespace COMCMS.Web.Areas.AdminCP.Controllers model.UpdateTime = DateTime.Now; model.ItemImg = morIMG; + string content = model.Content; + if (Request.Form["autoSaveRemoteImg"] == "1" && !string.IsNullOrEmpty(content)) + { + content = ThumbnailHelper.SaveRemoteImgForContent(content); + model.Content = content; + } //model.AuthorId = Core.Admin.GetMyInfo().Id; model.Save(); //添加TAG diff --git a/COMCMS.Web/Areas/AdminCP/Views/Article/AddArticle.cshtml b/COMCMS.Web/Areas/AdminCP/Views/Article/AddArticle.cshtml index 5004d01..757bb41 100644 --- a/COMCMS.Web/Areas/AdminCP/Views/Article/AddArticle.cshtml +++ b/COMCMS.Web/Areas/AdminCP/Views/Article/AddArticle.cshtml @@ -122,6 +122,14 @@ +
+ +
+ +
+
diff --git a/COMCMS.Web/Areas/AdminCP/Views/Article/EditArticle.cshtml b/COMCMS.Web/Areas/AdminCP/Views/Article/EditArticle.cshtml index 1cc6cf0..61a7a4c 100644 --- a/COMCMS.Web/Areas/AdminCP/Views/Article/EditArticle.cshtml +++ b/COMCMS.Web/Areas/AdminCP/Views/Article/EditArticle.cshtml @@ -121,6 +121,15 @@ +
+ +
+ +
+
+
@if (!string.IsNullOrEmpty(Model.ItemImg)) { @@ -137,7 +146,7 @@
- +
diff --git a/COMCMS.Web/Areas/AdminCP/Views/Member/EditAdminRole.cshtml b/COMCMS.Web/Areas/AdminCP/Views/Member/EditAdminRole.cshtml index 9b2f6bb..4b533d1 100644 --- a/COMCMS.Web/Areas/AdminCP/Views/Member/EditAdminRole.cshtml +++ b/COMCMS.Web/Areas/AdminCP/Views/Member/EditAdminRole.cshtml @@ -34,8 +34,8 @@
@@ -99,9 +99,9 @@ } @@ -122,8 +122,26 @@ +@if (Model.IsSuperAdmin == 0) +{ + +} \ No newline at end of file diff --git a/COMCMS.Web/Areas/AdminCP/Views/Product/AddProduct.cshtml b/COMCMS.Web/Areas/AdminCP/Views/Product/AddProduct.cshtml index 54b5c6c..4172d20 100644 --- a/COMCMS.Web/Areas/AdminCP/Views/Product/AddProduct.cshtml +++ b/COMCMS.Web/Areas/AdminCP/Views/Product/AddProduct.cshtml @@ -18,7 +18,7 @@ @@ -36,11 +36,11 @@ @*
- -
- -
-
*@ + +
+ +
+ *@
@@ -73,11 +73,11 @@
@*
- -
- -
-
*@ + +
+ +
+ *@
@@ -85,11 +85,11 @@
@*
- -
- -
-
*@ + +
+ +
+ *@
@@ -125,6 +125,14 @@
+
+ +
+ +
+
@if (!string.IsNullOrEmpty(Model.ItemImg)) { diff --git a/COMCMS.Web/Areas/AdminCP/Views/Product/EditProduct.cshtml b/COMCMS.Web/Areas/AdminCP/Views/Product/EditProduct.cshtml index 544258f..7f6b063 100644 --- a/COMCMS.Web/Areas/AdminCP/Views/Product/EditProduct.cshtml +++ b/COMCMS.Web/Areas/AdminCP/Views/Product/EditProduct.cshtml @@ -36,11 +36,11 @@
@*
- -
- -
-
*@ + +
+ +
+ *@
@@ -73,11 +73,11 @@
@*
- -
- -
-
*@ + +
+ +
+ *@
@@ -85,11 +85,11 @@
@*
- -
- -
-
*@ + +
+ +
+ *@
@@ -125,6 +125,14 @@
+
+ +
+ +
+
@if (!string.IsNullOrEmpty(Model.ItemImg)) { diff --git a/COMCMS.Web/COMCMS.Web.csproj b/COMCMS.Web/COMCMS.Web.csproj index cc2eab1..1e382df 100644 --- a/COMCMS.Web/COMCMS.Web.csproj +++ b/COMCMS.Web/COMCMS.Web.csproj @@ -30,6 +30,9 @@ + + + @@ -42,6 +45,7 @@ + @@ -189,6 +193,7 @@ + diff --git a/COMCMS.Web/Startup.cs b/COMCMS.Web/Startup.cs index 5501737..dfe2d20 100644 --- a/COMCMS.Web/Startup.cs +++ b/COMCMS.Web/Startup.cs @@ -108,7 +108,7 @@ namespace COMCMS.Web app.UseStatusCodePagesWithReExecute("/StatusCode/{0}"); //启用Session app.UseSession(); - + app.UseMyMVCDI(); app.UseHttpsRedirection(); app.UseStaticFiles(); app.UseCookiePolicy(); diff --git a/COMCMS.Web/wwwroot/editor/ckeditor/CHANGES.md b/COMCMS.Web/wwwroot/editor/ckeditor/CHANGES.md index 9a2d236..1205b92 100644 --- a/COMCMS.Web/wwwroot/editor/ckeditor/CHANGES.md +++ b/COMCMS.Web/wwwroot/editor/ckeditor/CHANGES.md @@ -1,11 +1,74 @@ CKEditor 4 Changelog ==================== +## CKEditor 4.10 + +New Features: + +* [#1751](https://github.com/ckeditor/ckeditor-dev/issues/1751): Introduced the **Autocomplete** feature that consists of the following plugins: + * [Autocomplete](https://ckeditor.com/cke4/addon/autocomplete) – Provides contextual completion feature for custom text matches based on user input. + * [Text Watcher](https://ckeditor.com/cke4/addon/textWatcher) – Checks whether an editor's text change matches the chosen criteria. + * [Text Match](https://ckeditor.com/cke4/addon/textMatch) – Allows to search [`CKEDITOR.dom.range`](https://docs.ckeditor.com/ckeditor4/latest/api/CKEDITOR_dom_range.html) for matching text. +* [#1703](https://github.com/ckeditor/ckeditor-dev/issues/1703): Introduced the [Mentions](https://ckeditor.com/cke4/addon/mentions) plugin providing smart completion feature for custom text matches based on user input starting with a chosen marker character. +* [#1746](https://github.com/ckeditor/ckeditor-dev/issues/1703): Introduced the [Emoji](https://ckeditor.com/cke4/addon/emoji) plugin providing completion feature for emoji ideograms. +* [#1761](https://github.com/ckeditor/ckeditor-dev/issues/1761): The [Auto Link](https://ckeditor.com/cke4/addon/autolink) plugin now supports email links. + +Fixed Issues: + +* [#1458](https://github.com/ckeditor/ckeditor-dev/issues/1458): [Edge] Fixed: After blurring the editor it takes 2 clicks to focus a widget. +* [#1034](https://github.com/ckeditor/ckeditor-dev/issues/1034): Fixed: JAWS leaves forms mode after pressing the Enter key in an inline editor instance. +* [#1748](https://github.com/ckeditor/ckeditor-dev/pull/1748): Fixed: Missing [`CKEDITOR.dialog.definition.onHide`](https://docs.ckeditor.com/ckeditor4/latest/api/CKEDITOR_dialog_definition.html#property-onHide) API documentation. Thanks to [sunnyone](https://github.com/sunnyone)! +* [#1321](https://github.com/ckeditor/ckeditor-dev/issues/1321): Ideographic space character (`\u3000`) is lost when pasting text. +* [#1776](https://github.com/ckeditor/ckeditor-dev/issues/1776): Empty caption placeholder of the [Image Base](https://ckeditor.com/cke4/addon/imagebase) plugin is not hidden when blurred. +* [#1592](https://github.com/ckeditor/ckeditor-dev/issues/1592): The [Image Base](https://ckeditor.com/cke4/addon/imagebase) plugin caption is not visible after paste. +* [#620](https://github.com/ckeditor/ckeditor-dev/issues/620): Fixed: The [`config.forcePasteAsPlainText`](https://docs.ckeditor.com/ckeditor4/latest/api/CKEDITOR_config.html#cfg-forcePasteAsPlainText) option is not respected in internal and cross-editor pasting. +* [#1467](https://github.com/ckeditor/ckeditor-dev/issues/1467): Fixed: The resizing cursor of the [Table Resize](https://ckeditor.com/cke4/addon/tableresize) plugin appearing in the middle of a merged cell. + +API Changes: + +* [#850](https://github.com/ckeditor/ckeditor-dev/issues/850): Backward incompatibility: Replaced the `replace` dialog from the [Find / Replace](https://ckeditor.com/cke4/addon/find) plugin with a `tabId` option in the `find` command. +* [#1582](https://github.com/ckeditor/ckeditor-dev/issues/1582): The [`CKEDITOR.editor.addCommand()`](https://docs.ckeditor.com/ckeditor4/latest/api/CKEDITOR_editor.html#method-addCommand) method can now accept a [`CKEDITOR.command`](https://docs.ckeditor.com/ckeditor4/latest/api/CKEDITOR_command.html) instance as a parameter. +* [#1712](https://github.com/ckeditor/ckeditor-dev/issues/1712): The [`extraPlugins`](https://docs.ckeditor.com/ckeditor4/latest/api/CKEDITOR_config.html#cfg-extraPlugins), [`removePlugins`](https://docs.ckeditor.com/ckeditor4/latest/api/CKEDITOR_config.html#cfg-removePlugins) and [`plugins`](https://docs.ckeditor.com/ckeditor4/latest/api/CKEDITOR_config.html#cfg-plugins) configuration options allow whitespace. +* [#1802](https://github.com/ckeditor/ckeditor-dev/issues/1802): The [`extraPlugins`](https://docs.ckeditor.com/ckeditor4/latest/api/CKEDITOR_config.html#cfg-extraPlugins), [`removePlugins`](https://docs.ckeditor.com/ckeditor4/latest/api/CKEDITOR_config.html#cfg-removePlugins) and [`plugins`](https://docs.ckeditor.com/ckeditor4/latest/api/CKEDITOR_config.html#cfg-plugins) configuration options allow passing plugin names as an array. +* [#1724](https://github.com/ckeditor/ckeditor-dev/issues/1724): Added an option to the [`getClientRect()`](https://docs.ckeditor.com/ckeditor4/latest/api/CKEDITOR_dom_element.html#method-getClientRect) function allowing to retrieve an absolute bounding rectangle of the element, i.e. a position relative to the upper-left corner of the topmost viewport. +* [#1498](https://github.com/ckeditor/ckeditor-dev/issues/1498) : Added a new [`getClientRects()`](https://docs.ckeditor.com/ckeditor4/latest/api/CKEDITOR_dom_range.html#method-getClientRects) method to `CKEDITOR.dom.range`. It returns a list of rectangles for each selected element. +* [#1993](https://github.com/ckeditor/ckeditor-dev/issues/1993): Added the [`CKEDITOR.tools.throttle()`](http://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR_tools.html#method-throttle) function. + +Other Changes: + +* Updated [SCAYT](https://ckeditor.com/cke4/addon/scayt) (Spell Check As You Type) and [WebSpellChecker](https://ckeditor.com/cke4/addon/wsc) (WSC) plugins: + * Language dictionary update: Added support for the Uzbek Latin language. + * Languages no longer supported as additional languages: Manx - Isle of Man (`gv_GB`) and Interlingua (`ia_XR`). + * Extended and improved language dictionaries: Georgian and Swedish. Also added the missing word _"Ensure"_ to the American, British and Canada English language. + * [#141](https://github.com/WebSpellChecker/ckeditor-plugin-scayt/issues/141) Fixed: SCAYT throws "Uncaught Error: Error in RangyWrappedRange module: createRange(): Parameter must be a Window object or DOM node". + * [#153](https://github.com/WebSpellChecker/ckeditor-plugin-scayt/issues/153) [Chrome] Fixed: Correcting a word in the widget in SCAYT moves focus to another editable. + * [#155](https://github.com/WebSpellChecker/ckeditor-plugin-scayt/issues/155) [IE8] Fixed: SCAYT throws an error and does not work. + * [#156](https://github.com/WebSpellChecker/ckeditor-plugin-scayt/issues/156) [IE10] Fixed: SCAYT does not seem to work. + * Fixed: After some text is dragged and dropped, the markup is not refreshed for grammar problems in SCAYT. + * Fixed: Request to FastCGI fails when the user tries to replace a word with non-English characters with a proper suggestion in WSC. + * [Firefox] Fixed: Ctrl+Z removes focus in SCAYT. + * Grammar support for default languages was improved. + * New application source URL was added in SCAYT. + * Removed green marks and legend related to grammar-supported languages in the Languages tab of SCAYT. Grammar is now supported for almost all the anguages in the list for an additional fee. + * Fixed: JavaScript error in the console: "Cannot read property 'split' of undefined" in SCAYT and WSC. + * [IE10] Fixed: Markup is not set for a specific case in SCAYT. + * Fixed: Accessibility issue: No `alt` attribute for the logo image in the About tab of SCAYT. + +## CKEditor 4.9.2 + +**Security Updates:** + +* Fixed XSS vulnerability in the [Enhanced Image](https://ckeditor.com/cke4/addon/image2) (`image2`) plugin reported by [Kyaw Min Thein](https://twitter.com/kyawminthein99). + + Issue summary: It was possible to execute XSS inside CKEditor using the `` tag and specially crafted HTML. Please note that the default presets (Basic/Standard/Full) do not include this plugin, so you are only at risk if you made a custom build and enabled this plugin. + +We would like to thank the [Drupal security team](https://www.drupal.org/drupal-security-team) for bringing this matter to our attention and coordinating the fix and release process! + ## CKEditor 4.9.1 Fixed Issues: -* [#1835](https://github.com/ckeditor/ckeditor-dev/issues/1835): Fixed: Integration between [CKFinder](https://ckeditor.com/ckeditor-4/ckfinder/) and [File Browser](https://ckeditor.com/cke4/addon/filebrowser) plugin does not work. +* [#1835](https://github.com/ckeditor/ckeditor-dev/issues/1835): Fixed: Integration between [CKFinder](https://ckeditor.com/ckeditor-4/ckfinder/) and the [File Browser](https://ckeditor.com/cke4/addon/filebrowser) plugin does not work. ## CKEditor 4.9 @@ -44,7 +107,7 @@ Fixed Issues: API Changes: -* [#1346](https://github.com/ckeditor/ckeditor-dev/issues/1346): [Balloon Toolbar](https://ckeditor.com/cke4/addon/balloontoolbar) [context manager API](https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.plugins.balloontoolbar.contextManager) is now available in the [`pluginDefinition.init`](https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.pluginDefinition-method-init) method of the [requiring](https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.pluginDefinition-property-requires) plugin. +* [#1346](https://github.com/ckeditor/ckeditor-dev/issues/1346): [Balloon Toolbar](https://ckeditor.com/cke4/addon/balloontoolbar) [context manager API](https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.plugins.balloontoolbar.contextManager) is now available in the [`pluginDefinition.init()`](https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.pluginDefinition-method-init) method of the [requiring](https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.pluginDefinition-property-requires) plugin. * [#1530](https://github.com/ckeditor/ckeditor-dev/issues/1530): Added the possibility to use custom icons for [buttons](https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR_ui_button.html). Other Changes: @@ -75,9 +138,9 @@ New Features: * [#468](https://github.com/ckeditor/ckeditor-dev/issues/468): [Edge] Introduced support for the Clipboard API. * [#607](https://github.com/ckeditor/ckeditor-dev/issues/607): Manually inserted Hex color is prefixed with a hash character (`#`) if needed. It ensures a valid Hex color value is used when setting the table cell border or background color with the [Color Dialog](https://ckeditor.com/cke4/addon/colordialog) window. * [#584](https://github.com/ckeditor/ckeditor-dev/issues/584): [Font size and Family](https://ckeditor.com/cke4/addon/font) and [Format](https://ckeditor.com/cke4/addon/format) drop-downs are not toggleable anymore. Default option to reset styles added. -* [#856](https://github.com/ckeditor/ckeditor-dev/issues/856): Introduced the [`CKEDITOR.tools.keystrokeToArray`](https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.tools-method-keystrokeToArray) method. It converts a keystroke into its string representation, returning every key name as a separate array element. -* [#1053](https://github.com/ckeditor/ckeditor-dev/issues/1053): Introduced the [`CKEDITOR.tools.object.merge`](https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.tools.object-method-merge) method. It allows to merge two objects, returning the new object with all properties from both objects deeply cloned. -* [#1073](https://github.com/ckeditor/ckeditor-dev/issues/1073): Introduced the [`CKEDITOR.tools.array.every`](https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.tools.array-method-every) method. It invokes a given test function on every array element and returns `true` if all elements pass the test. +* [#856](https://github.com/ckeditor/ckeditor-dev/issues/856): Introduced the [`CKEDITOR.tools.keystrokeToArray()`](https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.tools-method-keystrokeToArray) method. It converts a keystroke into its string representation, returning every key name as a separate array element. +* [#1053](https://github.com/ckeditor/ckeditor-dev/issues/1053): Introduced the [`CKEDITOR.tools.object.merge()`](https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.tools.object-method-merge) method. It allows to merge two objects, returning the new object with all properties from both objects deeply cloned. +* [#1073](https://github.com/ckeditor/ckeditor-dev/issues/1073): Introduced the [`CKEDITOR.tools.array.every()`](https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.tools.array-method-every) method. It invokes a given test function on every array element and returns `true` if all elements pass the test. Fixed Issues: @@ -89,7 +152,7 @@ Fixed Issues: * [#842](https://github.com/ckeditor/ckeditor-dev/issues/842): Fixed: List style not restored when toggling list indent level in the [Indent List](https://ckeditor.com/cke4/addon/indentlist) plugin. * [#711](https://github.com/ckeditor/ckeditor-dev/issues/711): Fixed: Dragging widgets should only work with the left mouse button. * [#862](https://github.com/ckeditor/ckeditor-dev/issues/862): Fixed: The "Object Styles" group in the [Styles Combo](https://ckeditor.com/cke4/addon/stylescombo) plugin is visible only if the whole element is selected. -* [#994](https://github.com/ckeditor/ckeditor-dev/pull/994): Fixed: Typo in the [`CKEDITOR.focusManager.focus`](https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.focusManager-method-focus) API documentation. Thanks to [benjy](https://github.com/benjy)! +* [#994](https://github.com/ckeditor/ckeditor-dev/pull/994): Fixed: Typo in the [`CKEDITOR.focusManager.focus()`](https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.focusManager-method-focus) API documentation. Thanks to [benjy](https://github.com/benjy)! * [#1014](https://github.com/ckeditor/ckeditor-dev/issues/1014): Fixed: The [Table Tools](https://ckeditor.com/cke4/addon/tabletools) Cell Properties dialog is now [Advanced Content Filter](https://docs.ckeditor.com/ckeditor4/docs/#!/guide/dev_acf) aware — it is not possible to change the cell width or height if corresponding styles are disabled. * [#877](https://github.com/ckeditor/ckeditor-dev/issues/877): Fixed: A list with custom bullets with exotic characters crashes the editor when [pasted from Word](https://ckeditor.com/cke4/addon/pastefromword). * [#605](https://github.com/ckeditor/ckeditor-dev/issues/605): Fixed: Inline widgets do not preserve trailing spaces. @@ -110,7 +173,7 @@ Fixed Issues: API Changes: * [#1097](https://github.com/ckeditor/ckeditor-dev/issues/1097): Widget [`upcast`](https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.plugins.widget.definition-property-upcast) methods are now called in the [widget definition's](https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.plugins.widget-property-definition) context. -* [#1118](https://github.com/ckeditor/ckeditor-dev/issues/1118): Added the `show` option in the [`balloonPanel.attach`](https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.ui.balloonPanel-method-attach) method, allowing to attach a hidden [Balloon Panel](https://ckeditor.com/cke4/addon/balloonpanel) instance. +* [#1118](https://github.com/ckeditor/ckeditor-dev/issues/1118): Added the `show` option in the [`balloonPanel.attach()`](https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.ui.balloonPanel-method-attach) method, allowing to attach a hidden [Balloon Panel](https://ckeditor.com/cke4/addon/balloonpanel) instance. * [#1145](https://github.com/ckeditor/ckeditor-dev/issues/1145): Added the [`skipNotifications`](https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.fileTools.uploadWidgetDefinition-property-skipNotifications) option to the [`CKEDITOR.fileTools.uploadWidgetDefinition`](https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.fileTools.uploadWidgetDefinition), allowing to switch off default notifications displayed by upload widgets. Other Changes: @@ -139,7 +202,7 @@ Other Changes: * Updated the [WebSpellChecker](https://ckeditor.com/cke4/addon/wsc) plugin: * [#40](https://github.com/WebSpellChecker/ckeditor-plugin-wsc/issues/40): Fixed: IE10 throws an error when spell checking is started. -* [#800](https://github.com/ckeditor/ckeditor-dev/issues/800): Added the [`CKEDITOR.dom.selection.isCollapsed`](https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.dom.selection-method-isCollapsed) method which is a simpler way to check if the selection is collapsed. +* [#800](https://github.com/ckeditor/ckeditor-dev/issues/800): Added the [`CKEDITOR.dom.selection.isCollapsed()`](https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.dom.selection-method-isCollapsed) method which is a simpler way to check if the selection is collapsed. * [#830](https://github.com/ckeditor/ckeditor-dev/issues/830): Added an option to define which dialog tab should be shown by default when creating [`CKEDITOR.dialogCommand`](https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.dialogCommand). ## CKEditor 4.7.2 @@ -162,15 +225,15 @@ Fixed Issues: * [#501](https://github.com/ckeditor/ckeditor-dev/issues/501): Fixed: Double click does not open the dialog for modifying anchors inserted via the [Link](https://ckeditor.com/cke4/addon/link) plugin. * [#9780](https://dev.ckeditor.com/ticket/9780): [IE8-9] Fixed: Clicking inside an empty [read-only](https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.editor-property-readOnly) editor throws an error. * [#16820](https://dev.ckeditor.com/ticket/16820): [IE10] Fixed: Clicking below a single horizontal rule throws an error. -* [#426](https://github.com/ckeditor/ckeditor-dev/issues/426): Fixed: The [`range.cloneContents`](https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.dom.range-method-cloneContents) method selects the whole element when the selection starts at the beginning of that element. -* [#644](https://github.com/ckeditor/ckeditor-dev/issues/644): Fixed: The [`range.extractContents`](https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.dom.range-method-extractContents) method returns an incorrect result when multiple nodes are selected. -* [#684](https://github.com/ckeditor/ckeditor-dev/issues/684): Fixed: The [`elementPath.contains`](https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.dom.elementPath-method-contains) method incorrectly excludes the last element instead of root when the `fromTop` parameter is set to `true`. +* [#426](https://github.com/ckeditor/ckeditor-dev/issues/426): Fixed: The [`range.cloneContents()`](https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.dom.range-method-cloneContents) method selects the whole element when the selection starts at the beginning of that element. +* [#644](https://github.com/ckeditor/ckeditor-dev/issues/644): Fixed: The [`range.extractContents()`](https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.dom.range-method-extractContents) method returns an incorrect result when multiple nodes are selected. +* [#684](https://github.com/ckeditor/ckeditor-dev/issues/684): Fixed: The [`elementPath.contains()`](https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.dom.elementPath-method-contains) method incorrectly excludes the last element instead of root when the `fromTop` parameter is set to `true`. Other Changes: * Updated the [SCAYT](https://ckeditor.com/cke4/addon/scayt) (Spell Check As You Type) plugin: * [#148](https://github.com/WebSpellChecker/ckeditor-plugin-scayt/issues/148): Fixed: SCAYT leaves underlined word after the CKEditor Replace dialog corrects it. -* [#751](https://github.com/ckeditor/ckeditor-dev/issues/751): Added the [`CKEDITOR.dom.nodeList.toArray`](https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.dom.nodeList-method-toArray) method which returns an array representation of a [node list](https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.dom.nodeList). +* [#751](https://github.com/ckeditor/ckeditor-dev/issues/751): Added the [`CKEDITOR.dom.nodeList.toArray()`](https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.dom.nodeList-method-toArray) method which returns an array representation of a [node list](https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.dom.nodeList). ## CKEditor 4.7.1 @@ -189,7 +252,7 @@ Fixed Issues: * [#424](https://github.com/ckeditor/ckeditor-dev/issues/424): Fixed: Error thrown by [Tab Key Handling](https://ckeditor.com/cke4/addon/tab) and [Indent List](https://ckeditor.com/cke4/addon/indentlist) plugins when pressing Tab with no selection in inline editor. * [#476](https://github.com/ckeditor/ckeditor-dev/issues/476): Fixed: Anchors inserted with the [Link](https://ckeditor.com/cke4/addon/link) plugin on collapsed selection cannot be edited. * [#417](https://github.com/ckeditor/ckeditor-dev/issues/417): Fixed: The [Table Resize](https://ckeditor.com/cke4/addon/tableresize) plugin throws an error when used with a table with only header or footer rows. -* [#523](https://github.com/ckeditor/ckeditor-dev/issues/523): Fixed: The [`editor.getCommandKeystroke`](https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.editor-method-getCommandKeystroke) method does not obtain the correct keystroke. +* [#523](https://github.com/ckeditor/ckeditor-dev/issues/523): Fixed: The [`editor.getCommandKeystroke()`](https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.editor-method-getCommandKeystroke) method does not obtain the correct keystroke. * [#534](https://github.com/ckeditor/ckeditor-dev/issues/534): [IE] Fixed: [Paste from Word](https://ckeditor.com/cke4/addon/pastefromword) does not work in Quirks Mode. * [#450](https://github.com/ckeditor/ckeditor-dev/issues/450): Fixed: [`CKEDITOR.filter`](https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.filter) incorrectly transforms the `margin` CSS property. @@ -209,8 +272,8 @@ New Features: * [#16847](https://dev.ckeditor.com/ticket/16847): Added support for parsing and inlining any formatting created using the Microsoft Word style system to the [Paste from Word](https://ckeditor.com/cke4/addon/pastefromword) plugin. * [#16818](https://dev.ckeditor.com/ticket/16818): Added table cell height parsing in the [Paste from Word](https://ckeditor.com/cke4/addon/pastefromword) plugin. * [#16850](https://dev.ckeditor.com/ticket/16850): Added a new [`config.enableContextMenu`](https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.config-cfg-enableContextMenu) configuration option for enabling and disabling the [context menu](https://ckeditor.com/cke4/addon/contextmenu). -* [#16937](https://dev.ckeditor.com/ticket/16937): The `command` parameter in [CKEDITOR.editor.getCommandKeystroke](http://docs.ckeditor.dev/#!/api/CKEDITOR.editor-method-getCommandKeystroke) now also accepts a command name as an argument. -* [#17010](https://dev.ckeditor.com/ticket/17010): The [`CKEDITOR.dom.range.shrink`](https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.dom.range-method-shrink) method now allows for skipping bogus `
` elements. +* [#16937](https://dev.ckeditor.com/ticket/16937): The `command` parameter in [`CKEDITOR.editor.getCommandKeystroke()`](http://docs.ckeditor.dev/#!/api/CKEDITOR.editor-method-getCommandKeystroke) now also accepts a command name as an argument. +* [#17010](https://dev.ckeditor.com/ticket/17010): The [`CKEDITOR.dom.range.shrink()`](https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR.dom.range-method-shrink) method now allows for skipping bogus `
` elements. Fixed Issues: @@ -244,7 +307,7 @@ Fixed Issues: * [#14407](https://dev.ckeditor.com/ticket/14407): [IE] Fixed: Non-editable widgets can be edited. * [#16927](https://dev.ckeditor.com/ticket/16927): Fixed: An error thrown if a bundle containing the [Color Button](https://ckeditor.com/cke4/addon/colorbutton) plugin is run in ES5 strict mode. Thanks to [Igor Rubinovich](https://github.com/IgorRubinovich)! * [#16920](https://dev.ckeditor.com/ticket/16920): Fixed: Several plugins not using the [Dialog](https://ckeditor.com/cke4/addon/dialog) plugin as a direct dependency. -* [PR#336](https://github.com/ckeditor/ckeditor-dev/pull/336): Fixed: Typo in [`CKEDITOR.getCss`](https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR-method-getCss) API documentation. Thanks to [knusperpixel](https://github.com/knusperpixel)! +* [PR#336](https://github.com/ckeditor/ckeditor-dev/pull/336): Fixed: Typo in [`CKEDITOR.getCss()`](https://docs.ckeditor.com/ckeditor4/docs/#!/api/CKEDITOR-method-getCss) API documentation. Thanks to [knusperpixel](https://github.com/knusperpixel)! * [#17027](https://dev.ckeditor.com/ticket/17027): Fixed: Command event data should be initialized as an empty object. * Fixed the behavior of HTML parser when parsing `src`/`srcdoc` attributes of the `