From 15ef20926261723fc0d5375ee374068218d2296f Mon Sep 17 00:00:00 2001 From: dean Date: Mon, 26 Sep 2022 10:07:11 +0800 Subject: [PATCH 01/30] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vendor/thinkcmf/cmf/src/lib/Upload.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/vendor/thinkcmf/cmf/src/lib/Upload.php b/vendor/thinkcmf/cmf/src/lib/Upload.php index 679478544..9dcc84f67 100644 --- a/vendor/thinkcmf/cmf/src/lib/Upload.php +++ b/vendor/thinkcmf/cmf/src/lib/Upload.php @@ -122,6 +122,9 @@ class Upload if (empty($userId)) { $token = $this->request->header('Authorization'); + if (substr($token, 0, 7) === 'Bearer ') { + $token = substr($token, 7); + } if (empty($token)) { $token = $this->request->header('XX-Token'); } -- Gitee From d404ca351a482a7d7a2fc69cb5a0945902da7abd Mon Sep 17 00:00:00 2001 From: dean Date: Sat, 29 Oct 2022 01:13:16 +0800 Subject: [PATCH 02/30] admin.js --- public/static/js/admin.js | 120 +++++++++++++++----------- public/themes/default/demo/index.html | 10 ++- 2 files changed, 75 insertions(+), 55 deletions(-) diff --git a/public/static/js/admin.js b/public/static/js/admin.js index 4904fd582..0d13ae3de 100644 --- a/public/static/js/admin.js +++ b/public/static/js/admin.js @@ -873,7 +873,6 @@ function openIframeDialog(url, title, options) { /** * 打开地图对话框 - * * @param url * @param title * @param options @@ -915,61 +914,31 @@ function openMapDialog(url, title, options, callback) { * @param multi 是否可以多选 * @param filetype 文件类型,image,video,audio,file * @param app 应用名,CMF的应用名 + * @param openIn 打开窗口 */ -function openUploadDialog(dialog_title, callback, extra_params, multi, filetype, app) { - Wind.css('artDialog'); +function openUploadDialog(dialog_title, callback, extra_params, multi, filetype, app, openIn) { multi = multi ? 1 : 0; filetype = filetype ? filetype : 'image'; app = app ? app : GV.APP; var params = '&multi=' + multi + '&filetype=' + filetype + '&app=' + app; - openIframeLayer(GV.ROOT + 'user/Asset/webuploader?' + params, dialog_title, { - btn: ['确定'], - area: ['600px', '450px'], - yes: function (index, layero) { + openIn = openIn ? openIn : window; + openIn.openIframeLayer(GV.ROOT + 'user/Asset/webuploader?' + params, dialog_title, { + btn: ['确定'], area: ['600px', '450px'], yes: function (index, layero) { if (typeof callback == 'function') { - var body = layer.getChildFrame('body', index); + // var body = openIn.layer.getChildFrame('body', index); //得到iframe页的窗口对象,执行iframe页的方法:iframeWin.method(); - var iframeWin = window[layero.find('iframe')[0]['name']]; + var iframeWin = openIn[layero.find('iframe')[0]['name']]; var files = iframeWin.get_selected_files(); console.log(files); if (files && files.length > 0) { callback.apply(this, [this, files, extra_params]); - layer.close(index); + openIn.layer.close(index); } else { // return false; } - - } } - }) - return; - Wind.use("artDialog", "iframeTools", function () { - art.dialog.open(GV.ROOT + 'user/Asset/webuploader?' + params, { - title: dialog_title, - id: new Date().getTime(), - width: '600px', - height: '350px', - lock: true, - fixed: true, - background: "#CCCCCC", - opacity: 0, - ok: function () { - if (typeof callback == 'function') { - var iframewindow = this.iframe.contentWindow; - var files = iframewindow.get_selected_files(); - console.log(files); - if (files && files.length > 0) { - callback.apply(this, [this, files, extra_params]); - } else { - return false; - } - - } - }, - cancel: true - }); }); } @@ -980,34 +949,56 @@ function openUploadDialog(dialog_title, callback, extra_params, multi, filetype, * @param filetype 文件类型,image,video,audio,file * @param extra_params 额外参数,object * @param app 应用名,CMF的应用名 + * @param openIn 打开窗口 */ -function uploadOne(dialog_title, input_selector, filetype, extra_params, app) { +function uploadOne(dialog_title, input_selector, filetype, extra_params, app, openIn) { filetype = filetype ? filetype : 'file'; openUploadDialog(dialog_title, function (dialog, files) { $(input_selector).val(files[0].filepath); $(input_selector + '-preview').attr('href', files[0].preview_url); - $(input_selector + '-name').val(files[0].name); $(input_selector + '-name-text').text(files[0].name); - }, extra_params, 0, filetype, app); + }, extra_params, 0, filetype, app, openIn); } /** - * 单个图片上传 + * 单个文件上传(在父级窗口打开) * @param dialog_title 上传对话框标题 * @param input_selector 图片容器 + * @param filetype 文件类型,image,video,audio,file * @param extra_params 额外参数,object * @param app 应用名,CMF的应用名 */ -function uploadOneImage(dialog_title, input_selector, extra_params, app) { +function parentUploadOne(dialog_title, input_selector, filetype, extra_params, app) { + uploadOne(dialog_title, input_selector, filetype, extra_params, app, parent); +} + +/** + * 单个图片上传 + * @param dialog_title 上传对话框标题 + * @param input_selector 图片容器 + * @param extra_params 额外参数,object + * @param app 应用名,CMF的应用名 + * @param openIn 打开窗口 + */ +function uploadOneImage(dialog_title, input_selector, extra_params, app, openIn) { openUploadDialog(dialog_title, function (dialog, files) { $(input_selector).val(files[0].filepath); $(input_selector + '-preview').attr('src', files[0].preview_url); - $(input_selector + '-name').val(files[0].name); $(input_selector + '-name-text').text(files[0].name); + }, extra_params, 0, 'image', app, openIn); +} - }, extra_params, 0, 'image', app); +/** + * 单个图片上传(在父级窗口打开) + * @param dialog_title 上传对话框标题 + * @param input_selector 图片容器 + * @param extra_params 额外参数,object + * @param app 应用名,CMF的应用名 + */ +function parentUploadOneImage(dialog_title, input_selector, extra_params, app) { + uploadOneImage(dialog_title, input_selector, extra_params, app, parent); } /** @@ -1016,9 +1007,10 @@ function uploadOneImage(dialog_title, input_selector, extra_params, app) { * @param container_selector 图片容器 * @param item_tpl_wrapper_id 单个图片html模板容器id * @param extra_params 额外参数,object - * @param app 应用名,CMF 的应用名 + * @param app 应用名,CMF的应用名 + * @param openIn 打开窗口 */ -function uploadMultiImage(dialog_title, container_selector, item_tpl_wrapper_id, extra_params, app) { +function uploadMultiImage(dialog_title, container_selector, item_tpl_wrapper_id, extra_params, app, openIn) { openUploadDialog(dialog_title, function (dialog, files) { var tpl = $('#' + item_tpl_wrapper_id).html(); var html = ''; @@ -1033,7 +1025,19 @@ function uploadMultiImage(dialog_title, container_selector, item_tpl_wrapper_id, }); $(container_selector).append(html); - }, extra_params, 1, 'image', app); + }, extra_params, 1, 'image', app, openIn); +} + +/** + * 多图上传(在父级窗口打开) + * @param dialog_title 上传对话框标题 + * @param container_selector 图片容器 + * @param item_tpl_wrapper_id 单个图片html模板容器id + * @param extra_params 额外参数,object + * @param app 应用名,CMF的应用名 + */ +function parentUploadMultiImage(dialog_title, container_selector, item_tpl_wrapper_id, extra_params, app) { + uploadMultiImage(dialog_title, container_selector, item_tpl_wrapper_id, extra_params, app, parent) } /** @@ -1044,8 +1048,9 @@ function uploadMultiImage(dialog_title, container_selector, item_tpl_wrapper_id, * @param filetype 文件类型,image,video,audio,file * @param extra_params 额外参数,object * @param app 应用名,CMF 的应用名 + * @param openIn 打开窗口 */ -function uploadMultiFile(dialog_title, container_selector, item_tpl_wrapper_id, filetype, extra_params, app) { +function uploadMultiFile(dialog_title, container_selector, item_tpl_wrapper_id, filetype, extra_params, app, openIn) { filetype = filetype ? filetype : 'file'; openUploadDialog(dialog_title, function (dialog, files) { var tpl = $('#' + item_tpl_wrapper_id).html(); @@ -1061,7 +1066,20 @@ function uploadMultiFile(dialog_title, container_selector, item_tpl_wrapper_id, }); $(container_selector).append(html); - }, extra_params, 1, filetype, app); + }, extra_params, 1, filetype, app, openIn); +} + +/** + * 多文件上传 + * @param dialog_title 上传对话框标题 + * @param container_selector 图片容器 + * @param item_tpl_wrapper_id 单个图片html模板容器id + * @param filetype 文件类型,image,video,audio,file + * @param extra_params 额外参数,object + * @param app 应用名,CMF 的应用名 + */ +function parentUploadMultiFile(dialog_title, container_selector, item_tpl_wrapper_id, filetype, extra_params, app, openIn) { + uploadMultiFile(dialog_title, container_selector, item_tpl_wrapper_id, filetype, extra_params, app, parent) } /** diff --git a/public/themes/default/demo/index.html b/public/themes/default/demo/index.html index 866685d59..fc3cfccad 100644 --- a/public/themes/default/demo/index.html +++ b/public/themes/default/demo/index.html @@ -6,8 +6,10 @@ ThinkCMF {$site_info.site_name|default=''} - - + + + + @@ -100,13 +102,13 @@

请用键盘上的方向键或空格键导航

- - + -- Gitee From a0fc8fd2612ceb3e3a1ce008ea8641501b2ab607 Mon Sep 17 00:00:00 2001 From: dean Date: Sat, 29 Oct 2022 01:19:55 +0800 Subject: [PATCH 03/30] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=AC=AC=E4=B8=89?= =?UTF-8?q?=E6=96=B9=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- composer.lock | 90 ++++++----- vendor/composer/autoload_psr4.php | 2 +- vendor/composer/autoload_static.php | 6 +- vendor/composer/installed.json | 108 +++++++------ vendor/composer/installed.php | 36 ++--- vendor/ezyang/htmlpurifier/CHANGELOG.md | 6 + vendor/ezyang/htmlpurifier/VERSION | 2 +- vendor/ezyang/htmlpurifier/composer.json | 23 ++- .../library/HTMLPurifier.includes.php | 3 +- .../htmlpurifier/library/HTMLPurifier.php | 6 +- .../library/HTMLPurifier.safe-includes.php | 1 + .../HTMLPurifier/AttrTransform/NameSync.php | 5 + .../HTMLPurifier/AttrTransform/SafeParam.php | 5 + .../library/HTMLPurifier/AttrTypes.php | 1 + .../library/HTMLPurifier/ChildDef/List.php | 2 + .../library/HTMLPurifier/Config.php | 2 +- .../library/HTMLPurifier/ElementDef.php | 2 +- .../library/HTMLPurifier/Encoder.php | 8 +- .../HTMLModule/CommonAttributes.php | 1 + .../Injector/RemoveSpansWithoutAttributes.php | 15 +- .../library/HTMLPurifier/Length.php | 2 +- .../library/HTMLPurifier/Lexer.php | 9 +- .../library/HTMLPurifier/Lexer/PH5P.php | 2 +- .../HTMLPurifier/PropertyListIterator.php | 1 + .../library/HTMLPurifier/StringHash.php | 1 + .../HTMLPurifier/URIFilter/HostBlacklist.php | 2 +- .../library/HTMLPurifier/URIFilter/Munge.php | 10 +- vendor/league/flysystem/src/Adapter/Ftp.php | 4 +- vendor/phpmailer/phpmailer/VERSION | 2 +- vendor/phpmailer/phpmailer/composer.json | 2 +- .../phpmailer/language/phpmailer.lang-da.php | 10 +- .../phpmailer/language/phpmailer.lang-pl.php | 13 +- vendor/phpmailer/phpmailer/src/PHPMailer.php | 9 +- vendor/phpmailer/phpmailer/src/POP3.php | 2 +- vendor/phpmailer/phpmailer/src/SMTP.php | 3 +- vendor/services.php | 2 +- vendor/thinkcmf/cmf/think/App.php | 2 +- vendor/topthink/framework/src/think/App.php | 2 +- .../topthink/framework/src/think/Console.php | 7 +- vendor/topthink/framework/src/think/Lang.php | 54 ------- .../src/think/middleware/LoadLangPack.php | 28 ++-- .../src/db/concern/ModelRelationQuery.php | 19 --- .../think-orm/src/model/concern/Attribute.php | 2 +- .../src/model/concern/SoftDelete.php | 105 ++++-------- .../src/model/relation/BelongsTo.php | 4 +- .../think-orm/src/model/relation/HasOne.php | 4 +- .../think-orm/src/model/relation/MorphTo.php | 150 ++++++++++++------ vendor/topthink/think-trace/composer.json | 2 +- 48 files changed, 394 insertions(+), 383 deletions(-) create mode 100644 vendor/ezyang/htmlpurifier/CHANGELOG.md diff --git a/composer.lock b/composer.lock index e3ba31c32..193598587 100644 --- a/composer.lock +++ b/composer.lock @@ -52,20 +52,30 @@ }, { "name": "ezyang/htmlpurifier", - "version": "v4.14.0", + "version": "v4.16.0", "source": { "type": "git", "url": "https://github.com/ezyang/htmlpurifier.git", - "reference": "12ab42bd6e742c70c0a52f7b82477fcd44e64b75" + "reference": "523407fb06eb9e5f3d59889b3978d5bfe94299c8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/12ab42bd6e742c70c0a52f7b82477fcd44e64b75", - "reference": "12ab42bd6e742c70c0a52f7b82477fcd44e64b75", + "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/523407fb06eb9e5f3d59889b3978d5bfe94299c8", + "reference": "523407fb06eb9e5f3d59889b3978d5bfe94299c8", "shasum": "" }, "require": { - "php": ">=5.2" + "php": "~5.6.0 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 || ~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0" + }, + "require-dev": { + "cerdic/css-tidy": "^1.7 || ^2.0", + "simpletest/simpletest": "dev-master" + }, + "suggest": { + "cerdic/css-tidy": "If you want to use the filter 'Filter.ExtractStyleBlocks'.", + "ext-bcmath": "Used for unit conversion and imagecrash protection", + "ext-iconv": "Converts text to and from non-UTF-8 encodings", + "ext-tidy": "Used for pretty-printing HTML" }, "type": "library", "autoload": { @@ -97,22 +107,22 @@ ], "support": { "issues": "https://github.com/ezyang/htmlpurifier/issues", - "source": "https://github.com/ezyang/htmlpurifier/tree/v4.14.0" + "source": "https://github.com/ezyang/htmlpurifier/tree/v4.16.0" }, - "time": "2021-12-25T01:21:49+00:00" + "time": "2022-09-18T07:06:19+00:00" }, { "name": "league/flysystem", - "version": "1.1.9", + "version": "1.1.10", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "094defdb4a7001845300334e7c1ee2335925ef99" + "reference": "3239285c825c152bcc315fe0e87d6b55f5972ed1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/094defdb4a7001845300334e7c1ee2335925ef99", - "reference": "094defdb4a7001845300334e7c1ee2335925ef99", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/3239285c825c152bcc315fe0e87d6b55f5972ed1", + "reference": "3239285c825c152bcc315fe0e87d6b55f5972ed1", "shasum": "" }, "require": { @@ -185,7 +195,7 @@ ], "support": { "issues": "https://github.com/thephpleague/flysystem/issues", - "source": "https://github.com/thephpleague/flysystem/tree/1.1.9" + "source": "https://github.com/thephpleague/flysystem/tree/1.1.10" }, "funding": [ { @@ -193,7 +203,7 @@ "type": "other" } ], - "time": "2021-12-09T09:40:50+00:00" + "time": "2022-10-04T09:16:37+00:00" }, { "name": "league/flysystem-cached-adapter", @@ -405,16 +415,16 @@ }, { "name": "phpmailer/phpmailer", - "version": "v6.6.4", + "version": "v6.6.5", "source": { "type": "git", "url": "https://github.com/PHPMailer/PHPMailer.git", - "reference": "a94fdebaea6bd17f51be0c2373ab80d3d681269b" + "reference": "8b6386d7417526d1ea4da9edb70b8352f7543627" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/a94fdebaea6bd17f51be0c2373ab80d3d681269b", - "reference": "a94fdebaea6bd17f51be0c2373ab80d3d681269b", + "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/8b6386d7417526d1ea4da9edb70b8352f7543627", + "reference": "8b6386d7417526d1ea4da9edb70b8352f7543627", "shasum": "" }, "require": { @@ -438,8 +448,8 @@ "hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication", "league/oauth2-google": "Needed for Google XOAUTH2 authentication", "psr/log": "For optional PSR-3 debug logging", - "stevenmaguire/oauth2-microsoft": "Needed for Microsoft XOAUTH2 authentication", - "symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)" + "symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)", + "thenetworg/oauth2-azure": "Needed for Microsoft XOAUTH2 authentication" }, "type": "library", "autoload": { @@ -471,7 +481,7 @@ "description": "PHPMailer is a full-featured email creation and transfer class for PHP", "support": { "issues": "https://github.com/PHPMailer/PHPMailer/issues", - "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.6.4" + "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.6.5" }, "funding": [ { @@ -479,7 +489,7 @@ "type": "github" } ], - "time": "2022-08-22T09:22:00+00:00" + "time": "2022-10-07T12:23:10+00:00" }, { "name": "psr/cache", @@ -1094,16 +1104,16 @@ }, { "name": "topthink/framework", - "version": "v6.0.13", + "version": "v6.0.14", "source": { "type": "git", "url": "https://github.com/top-think/framework.git", - "reference": "126d5b2cbacb73d6e2a85cbc7a2c6ee59d0b3fa6" + "reference": "e621c239492d4f7e276e166b16aba3fb933d501e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/top-think/framework/zipball/126d5b2cbacb73d6e2a85cbc7a2c6ee59d0b3fa6", - "reference": "126d5b2cbacb73d6e2a85cbc7a2c6ee59d0b3fa6", + "url": "https://api.github.com/repos/top-think/framework/zipball/e621c239492d4f7e276e166b16aba3fb933d501e", + "reference": "e621c239492d4f7e276e166b16aba3fb933d501e", "shasum": "" }, "require": { @@ -1155,9 +1165,9 @@ ], "support": { "issues": "https://github.com/top-think/framework/issues", - "source": "https://github.com/top-think/framework/tree/v6.0.13" + "source": "https://github.com/top-think/framework/tree/v6.0.14" }, - "time": "2022-07-15T02:52:08+00:00" + "time": "2022-10-25T14:45:56+00:00" }, { "name": "topthink/think-helper", @@ -1207,16 +1217,16 @@ }, { "name": "topthink/think-orm", - "version": "v2.0.54", + "version": "v2.0.55", "source": { "type": "git", "url": "https://github.com/top-think/think-orm.git", - "reference": "97b061b47616301ff29fbd4c35ed9184e1162e4e" + "reference": "e1974a4c3b1b4c5b808fcc0863fc254e711dee13" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/top-think/think-orm/zipball/97b061b47616301ff29fbd4c35ed9184e1162e4e", - "reference": "97b061b47616301ff29fbd4c35ed9184e1162e4e", + "url": "https://api.github.com/repos/top-think/think-orm/zipball/e1974a4c3b1b4c5b808fcc0863fc254e711dee13", + "reference": "e1974a4c3b1b4c5b808fcc0863fc254e711dee13", "shasum": "" }, "require": { @@ -1256,9 +1266,9 @@ ], "support": { "issues": "https://github.com/top-think/think-orm/issues", - "source": "https://github.com/top-think/think-orm/tree/v2.0.54" + "source": "https://github.com/top-think/think-orm/tree/v2.0.55" }, - "time": "2022-07-05T05:25:51+00:00" + "time": "2022-09-27T14:18:43+00:00" }, { "name": "xia/migration", @@ -1312,21 +1322,21 @@ "packages-dev": [ { "name": "topthink/think-trace", - "version": "v1.4", + "version": "v1.5", "source": { "type": "git", "url": "https://github.com/top-think/think-trace.git", - "reference": "9a9fa8f767b6c66c5a133ad21ca1bc96ad329444" + "reference": "55027fd79abb744f32a3be8d9e1ccf873a3ca9b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/top-think/think-trace/zipball/9a9fa8f767b6c66c5a133ad21ca1bc96ad329444", - "reference": "9a9fa8f767b6c66c5a133ad21ca1bc96ad329444", + "url": "https://api.github.com/repos/top-think/think-trace/zipball/55027fd79abb744f32a3be8d9e1ccf873a3ca9b7", + "reference": "55027fd79abb744f32a3be8d9e1ccf873a3ca9b7", "shasum": "" }, "require": { "php": ">=7.1.0", - "topthink/framework": "^6.0.0" + "topthink/framework": "^6.0" }, "type": "library", "extra": { @@ -1357,9 +1367,9 @@ "description": "thinkphp debug trace", "support": { "issues": "https://github.com/top-think/think-trace/issues", - "source": "https://github.com/top-think/think-trace/tree/v1.4" + "source": "https://github.com/top-think/think-trace/tree/v1.5" }, - "time": "2020-06-29T05:27:28+00:00" + "time": "2022-10-26T07:56:45+00:00" } ], "aliases": [], diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php index 2ec2895e0..27e5bc9f8 100644 --- a/vendor/composer/autoload_psr4.php +++ b/vendor/composer/autoload_psr4.php @@ -11,7 +11,7 @@ return array( 'think\\trace\\' => array($vendorDir . '/topthink/think-trace/src'), 'think\\migration\\' => array($vendorDir . '/xia/migration/src'), 'think\\captcha\\' => array($vendorDir . '/thinkcmf/cmf-captcha/src'), - 'think\\' => array($vendorDir . '/thinkcmf/cmf/think', $vendorDir . '/topthink/framework/src/think', $vendorDir . '/topthink/think-helper/src', $vendorDir . '/topthink/think-orm/src'), + 'think\\' => array($vendorDir . '/thinkcmf/cmf/think', $vendorDir . '/topthink/think-helper/src', $vendorDir . '/topthink/think-orm/src', $vendorDir . '/topthink/framework/src/think'), 'themes\\' => array($baseDir . '/public/themes'), 'plugins\\' => array($baseDir . '/public/plugins'), 'mindplay\\annotations\\' => array($vendorDir . '/mindplay/annotations/src/annotations'), diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 016fc2359..e009cea41 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -92,9 +92,9 @@ class ComposerStaticInit409e436a19c882513f3c7d0ffdfd059f 'think\\' => array ( 0 => __DIR__ . '/..' . '/thinkcmf/cmf/think', - 1 => __DIR__ . '/..' . '/topthink/framework/src/think', - 2 => __DIR__ . '/..' . '/topthink/think-helper/src', - 3 => __DIR__ . '/..' . '/topthink/think-orm/src', + 1 => __DIR__ . '/..' . '/topthink/think-helper/src', + 2 => __DIR__ . '/..' . '/topthink/think-orm/src', + 3 => __DIR__ . '/..' . '/topthink/framework/src/think', ), 'themes\\' => array ( diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 7e4f44971..f7f1dad61 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -49,32 +49,42 @@ }, { "name": "ezyang/htmlpurifier", - "version": "v4.14.0", - "version_normalized": "4.14.0.0", + "version": "v4.16.0", + "version_normalized": "4.16.0.0", "source": { "type": "git", "url": "https://github.com/ezyang/htmlpurifier.git", - "reference": "12ab42bd6e742c70c0a52f7b82477fcd44e64b75" + "reference": "523407fb06eb9e5f3d59889b3978d5bfe94299c8" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/12ab42bd6e742c70c0a52f7b82477fcd44e64b75", - "reference": "12ab42bd6e742c70c0a52f7b82477fcd44e64b75", + "url": "https://api.github.com/repos/ezyang/htmlpurifier/zipball/523407fb06eb9e5f3d59889b3978d5bfe94299c8", + "reference": "523407fb06eb9e5f3d59889b3978d5bfe94299c8", "shasum": "" }, "require": { - "php": ">=5.2" + "php": "~5.6.0 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 || ~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0" }, - "time": "2021-12-25T01:21:49+00:00", + "require-dev": { + "cerdic/css-tidy": "^1.7 || ^2.0", + "simpletest/simpletest": "dev-master" + }, + "suggest": { + "cerdic/css-tidy": "If you want to use the filter 'Filter.ExtractStyleBlocks'.", + "ext-bcmath": "Used for unit conversion and imagecrash protection", + "ext-iconv": "Converts text to and from non-UTF-8 encodings", + "ext-tidy": "Used for pretty-printing HTML" + }, + "time": "2022-09-18T07:06:19+00:00", "type": "library", "installation-source": "dist", "autoload": { - "psr-0": { - "HTMLPurifier": "library/" - }, "files": [ "library/HTMLPurifier.composer.php" ], + "psr-0": { + "HTMLPurifier": "library/" + }, "exclude-from-classmap": [ "/library/HTMLPurifier/Language/" ] @@ -97,23 +107,23 @@ ], "support": { "issues": "https://github.com/ezyang/htmlpurifier/issues", - "source": "https://github.com/ezyang/htmlpurifier/tree/v4.14.0" + "source": "https://github.com/ezyang/htmlpurifier/tree/v4.16.0" }, "install-path": "../ezyang/htmlpurifier" }, { "name": "league/flysystem", - "version": "1.1.9", - "version_normalized": "1.1.9.0", + "version": "1.1.10", + "version_normalized": "1.1.10.0", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "094defdb4a7001845300334e7c1ee2335925ef99" + "reference": "3239285c825c152bcc315fe0e87d6b55f5972ed1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/094defdb4a7001845300334e7c1ee2335925ef99", - "reference": "094defdb4a7001845300334e7c1ee2335925ef99", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/3239285c825c152bcc315fe0e87d6b55f5972ed1", + "reference": "3239285c825c152bcc315fe0e87d6b55f5972ed1", "shasum": "" }, "require": { @@ -143,7 +153,7 @@ "spatie/flysystem-dropbox": "Allows you to use Dropbox storage", "srmklive/flysystem-dropbox-v2": "Allows you to use Dropbox storage for PHP 5 applications" }, - "time": "2021-12-09T09:40:50+00:00", + "time": "2022-10-04T09:16:37+00:00", "type": "library", "extra": { "branch-alias": { @@ -188,7 +198,7 @@ ], "support": { "issues": "https://github.com/thephpleague/flysystem/issues", - "source": "https://github.com/thephpleague/flysystem/tree/1.1.9" + "source": "https://github.com/thephpleague/flysystem/tree/1.1.10" }, "funding": [ { @@ -420,17 +430,17 @@ }, { "name": "phpmailer/phpmailer", - "version": "v6.6.4", - "version_normalized": "6.6.4.0", + "version": "v6.6.5", + "version_normalized": "6.6.5.0", "source": { "type": "git", "url": "https://github.com/PHPMailer/PHPMailer.git", - "reference": "a94fdebaea6bd17f51be0c2373ab80d3d681269b" + "reference": "8b6386d7417526d1ea4da9edb70b8352f7543627" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/a94fdebaea6bd17f51be0c2373ab80d3d681269b", - "reference": "a94fdebaea6bd17f51be0c2373ab80d3d681269b", + "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/8b6386d7417526d1ea4da9edb70b8352f7543627", + "reference": "8b6386d7417526d1ea4da9edb70b8352f7543627", "shasum": "" }, "require": { @@ -454,10 +464,10 @@ "hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication", "league/oauth2-google": "Needed for Google XOAUTH2 authentication", "psr/log": "For optional PSR-3 debug logging", - "stevenmaguire/oauth2-microsoft": "Needed for Microsoft XOAUTH2 authentication", - "symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)" + "symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)", + "thenetworg/oauth2-azure": "Needed for Microsoft XOAUTH2 authentication" }, - "time": "2022-08-22T09:22:00+00:00", + "time": "2022-10-07T12:23:10+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -489,7 +499,7 @@ "description": "PHPMailer is a full-featured email creation and transfer class for PHP", "support": { "issues": "https://github.com/PHPMailer/PHPMailer/issues", - "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.6.4" + "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.6.5" }, "funding": [ { @@ -1151,17 +1161,17 @@ }, { "name": "topthink/framework", - "version": "v6.0.13", - "version_normalized": "6.0.13.0", + "version": "v6.0.14", + "version_normalized": "6.0.14.0", "source": { "type": "git", "url": "https://github.com/top-think/framework.git", - "reference": "126d5b2cbacb73d6e2a85cbc7a2c6ee59d0b3fa6" + "reference": "e621c239492d4f7e276e166b16aba3fb933d501e" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/top-think/framework/zipball/126d5b2cbacb73d6e2a85cbc7a2c6ee59d0b3fa6", - "reference": "126d5b2cbacb73d6e2a85cbc7a2c6ee59d0b3fa6", + "url": "https://api.github.com/repos/top-think/framework/zipball/e621c239492d4f7e276e166b16aba3fb933d501e", + "reference": "e621c239492d4f7e276e166b16aba3fb933d501e", "shasum": "" }, "require": { @@ -1183,7 +1193,7 @@ "mockery/mockery": "^1.2", "phpunit/phpunit": "^7.0" }, - "time": "2022-07-15T02:52:08+00:00", + "time": "2022-10-25T14:45:56+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1215,7 +1225,7 @@ ], "support": { "issues": "https://github.com/top-think/framework/issues", - "source": "https://github.com/top-think/framework/tree/v6.0.13" + "source": "https://github.com/top-think/framework/tree/v6.0.14" }, "install-path": "../topthink/framework" }, @@ -1270,17 +1280,17 @@ }, { "name": "topthink/think-orm", - "version": "v2.0.54", - "version_normalized": "2.0.54.0", + "version": "v2.0.55", + "version_normalized": "2.0.55.0", "source": { "type": "git", "url": "https://github.com/top-think/think-orm.git", - "reference": "97b061b47616301ff29fbd4c35ed9184e1162e4e" + "reference": "e1974a4c3b1b4c5b808fcc0863fc254e711dee13" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/top-think/think-orm/zipball/97b061b47616301ff29fbd4c35ed9184e1162e4e", - "reference": "97b061b47616301ff29fbd4c35ed9184e1162e4e", + "url": "https://api.github.com/repos/top-think/think-orm/zipball/e1974a4c3b1b4c5b808fcc0863fc254e711dee13", + "reference": "e1974a4c3b1b4c5b808fcc0863fc254e711dee13", "shasum": "" }, "require": { @@ -1294,7 +1304,7 @@ "require-dev": { "phpunit/phpunit": "^7|^8|^9.5" }, - "time": "2022-07-05T05:25:51+00:00", + "time": "2022-09-27T14:18:43+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1322,30 +1332,30 @@ ], "support": { "issues": "https://github.com/top-think/think-orm/issues", - "source": "https://github.com/top-think/think-orm/tree/v2.0.54" + "source": "https://github.com/top-think/think-orm/tree/v2.0.55" }, "install-path": "../topthink/think-orm" }, { "name": "topthink/think-trace", - "version": "v1.4", - "version_normalized": "1.4.0.0", + "version": "v1.5", + "version_normalized": "1.5.0.0", "source": { "type": "git", "url": "https://github.com/top-think/think-trace.git", - "reference": "9a9fa8f767b6c66c5a133ad21ca1bc96ad329444" + "reference": "55027fd79abb744f32a3be8d9e1ccf873a3ca9b7" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/top-think/think-trace/zipball/9a9fa8f767b6c66c5a133ad21ca1bc96ad329444", - "reference": "9a9fa8f767b6c66c5a133ad21ca1bc96ad329444", + "url": "https://api.github.com/repos/top-think/think-trace/zipball/55027fd79abb744f32a3be8d9e1ccf873a3ca9b7", + "reference": "55027fd79abb744f32a3be8d9e1ccf873a3ca9b7", "shasum": "" }, "require": { "php": ">=7.1.0", - "topthink/framework": "^6.0.0" + "topthink/framework": "^6.0" }, - "time": "2020-06-29T05:27:28+00:00", + "time": "2022-10-26T07:56:45+00:00", "type": "library", "extra": { "think": { @@ -1376,7 +1386,7 @@ "description": "thinkphp debug trace", "support": { "issues": "https://github.com/top-think/think-trace/issues", - "source": "https://github.com/top-think/think-trace/tree/v1.4" + "source": "https://github.com/top-think/think-trace/tree/v1.5" }, "install-path": "../topthink/think-trace" }, diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 92bab3216..17711ac84 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -20,21 +20,21 @@ 'dev_requirement' => false, ), 'ezyang/htmlpurifier' => array( - 'pretty_version' => 'v4.14.0', - 'version' => '4.14.0.0', + 'pretty_version' => 'v4.16.0', + 'version' => '4.16.0.0', 'type' => 'library', 'install_path' => __DIR__ . '/../ezyang/htmlpurifier', 'aliases' => array(), - 'reference' => '12ab42bd6e742c70c0a52f7b82477fcd44e64b75', + 'reference' => '523407fb06eb9e5f3d59889b3978d5bfe94299c8', 'dev_requirement' => false, ), 'league/flysystem' => array( - 'pretty_version' => '1.1.9', - 'version' => '1.1.9.0', + 'pretty_version' => '1.1.10', + 'version' => '1.1.10.0', 'type' => 'library', 'install_path' => __DIR__ . '/../league/flysystem', 'aliases' => array(), - 'reference' => '094defdb4a7001845300334e7c1ee2335925ef99', + 'reference' => '3239285c825c152bcc315fe0e87d6b55f5972ed1', 'dev_requirement' => false, ), 'league/flysystem-cached-adapter' => array( @@ -80,12 +80,12 @@ ), ), 'phpmailer/phpmailer' => array( - 'pretty_version' => 'v6.6.4', - 'version' => '6.6.4.0', + 'pretty_version' => 'v6.6.5', + 'version' => '6.6.5.0', 'type' => 'library', 'install_path' => __DIR__ . '/../phpmailer/phpmailer', 'aliases' => array(), - 'reference' => 'a94fdebaea6bd17f51be0c2373ab80d3d681269b', + 'reference' => '8b6386d7417526d1ea4da9edb70b8352f7543627', 'dev_requirement' => false, ), 'psr/cache' => array( @@ -215,12 +215,12 @@ 'dev_requirement' => false, ), 'topthink/framework' => array( - 'pretty_version' => 'v6.0.13', - 'version' => '6.0.13.0', + 'pretty_version' => 'v6.0.14', + 'version' => '6.0.14.0', 'type' => 'library', 'install_path' => __DIR__ . '/../topthink/framework', 'aliases' => array(), - 'reference' => '126d5b2cbacb73d6e2a85cbc7a2c6ee59d0b3fa6', + 'reference' => 'e621c239492d4f7e276e166b16aba3fb933d501e', 'dev_requirement' => false, ), 'topthink/think-helper' => array( @@ -233,21 +233,21 @@ 'dev_requirement' => false, ), 'topthink/think-orm' => array( - 'pretty_version' => 'v2.0.54', - 'version' => '2.0.54.0', + 'pretty_version' => 'v2.0.55', + 'version' => '2.0.55.0', 'type' => 'library', 'install_path' => __DIR__ . '/../topthink/think-orm', 'aliases' => array(), - 'reference' => '97b061b47616301ff29fbd4c35ed9184e1162e4e', + 'reference' => 'e1974a4c3b1b4c5b808fcc0863fc254e711dee13', 'dev_requirement' => false, ), 'topthink/think-trace' => array( - 'pretty_version' => 'v1.4', - 'version' => '1.4.0.0', + 'pretty_version' => 'v1.5', + 'version' => '1.5.0.0', 'type' => 'library', 'install_path' => __DIR__ . '/../topthink/think-trace', 'aliases' => array(), - 'reference' => '9a9fa8f767b6c66c5a133ad21ca1bc96ad329444', + 'reference' => '55027fd79abb744f32a3be8d9e1ccf873a3ca9b7', 'dev_requirement' => true, ), 'xia/migration' => array( diff --git a/vendor/ezyang/htmlpurifier/CHANGELOG.md b/vendor/ezyang/htmlpurifier/CHANGELOG.md new file mode 100644 index 000000000..55cb9029c --- /dev/null +++ b/vendor/ezyang/htmlpurifier/CHANGELOG.md @@ -0,0 +1,6 @@ +# [4.16.0](https://github.com/ezyang/htmlpurifier/compare/v4.15.0...v4.16.0) (2022-09-18) + + +### Features + +* add semantic release ([#307](https://github.com/ezyang/htmlpurifier/issues/307)) ([db31243](https://github.com/ezyang/htmlpurifier/commit/db312435cb9d8d73395f75f9642a43ba6de5e903)), closes [#322](https://github.com/ezyang/htmlpurifier/issues/322) [#323](https://github.com/ezyang/htmlpurifier/issues/323) [#326](https://github.com/ezyang/htmlpurifier/issues/326) [#327](https://github.com/ezyang/htmlpurifier/issues/327) [#328](https://github.com/ezyang/htmlpurifier/issues/328) [#329](https://github.com/ezyang/htmlpurifier/issues/329) [#330](https://github.com/ezyang/htmlpurifier/issues/330) [#331](https://github.com/ezyang/htmlpurifier/issues/331) [#332](https://github.com/ezyang/htmlpurifier/issues/332) [#333](https://github.com/ezyang/htmlpurifier/issues/333) [#337](https://github.com/ezyang/htmlpurifier/issues/337) [#335](https://github.com/ezyang/htmlpurifier/issues/335) [ezyang/htmlpurifier#334](https://github.com/ezyang/htmlpurifier/issues/334) [#336](https://github.com/ezyang/htmlpurifier/issues/336) [#338](https://github.com/ezyang/htmlpurifier/issues/338) diff --git a/vendor/ezyang/htmlpurifier/VERSION b/vendor/ezyang/htmlpurifier/VERSION index 09ce0ce71..f029ee574 100644 --- a/vendor/ezyang/htmlpurifier/VERSION +++ b/vendor/ezyang/htmlpurifier/VERSION @@ -1 +1 @@ -4.14.0 \ No newline at end of file +4.15.0 \ No newline at end of file diff --git a/vendor/ezyang/htmlpurifier/composer.json b/vendor/ezyang/htmlpurifier/composer.json index 5f62d889d..d75582950 100644 --- a/vendor/ezyang/htmlpurifier/composer.json +++ b/vendor/ezyang/htmlpurifier/composer.json @@ -13,7 +13,11 @@ } ], "require": { - "php": ">=5.2" + "php": "~5.6.0 || ~7.0.0 || ~7.1.0 || ~7.2.0 || ~7.3.0 || ~7.4.0 || ~8.0.0 || ~8.1.0 || ~8.2.0" + }, + "require-dev": { + "cerdic/css-tidy": "^1.7 || ^2.0", + "simpletest/simpletest": "dev-master" }, "autoload": { "psr-0": { "HTMLPurifier": "library/" }, @@ -21,5 +25,20 @@ "exclude-from-classmap": [ "/library/HTMLPurifier/Language/" ] - } + }, + "suggest": { + "cerdic/css-tidy": "If you want to use the filter 'Filter.ExtractStyleBlocks'.", + "ext-iconv": "Converts text to and from non-UTF-8 encodings", + "ext-bcmath": "Used for unit conversion and imagecrash protection", + "ext-tidy": "Used for pretty-printing HTML" + }, + "config": { + "sort-packages": true + }, + "repositories": [ + { + "type": "vcs", + "url": "https://github.com/ezyang/simpletest.git" + } + ] } diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier.includes.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier.includes.php index ee81cac68..47ee0133d 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier.includes.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier.includes.php @@ -7,7 +7,7 @@ * primary concern and you are using an opcode cache. PLEASE DO NOT EDIT THIS * FILE, changes will be overwritten the next time the script is run. * - * @version 4.14.0 + * @version 4.15.0 * * @warning * You must *not* include any other HTML Purifier files before this file, @@ -107,6 +107,7 @@ require 'HTMLPurifier/AttrDef/HTML/Bool.php'; require 'HTMLPurifier/AttrDef/HTML/Nmtokens.php'; require 'HTMLPurifier/AttrDef/HTML/Class.php'; require 'HTMLPurifier/AttrDef/HTML/Color.php'; +require 'HTMLPurifier/AttrDef/HTML/ContentEditable.php'; require 'HTMLPurifier/AttrDef/HTML/FrameTarget.php'; require 'HTMLPurifier/AttrDef/HTML/ID.php'; require 'HTMLPurifier/AttrDef/HTML/Pixels.php'; diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier.php index 2177fc851..26f061276 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier.php @@ -19,7 +19,7 @@ */ /* - HTML Purifier 4.14.0 - Standards Compliant HTML Filtering + HTML Purifier 4.15.0 - Standards Compliant HTML Filtering Copyright (C) 2006-2008 Edward Z. Yang This library is free software; you can redistribute it and/or @@ -58,12 +58,12 @@ class HTMLPurifier * Version of HTML Purifier. * @type string */ - public $version = '4.14.0'; + public $version = '4.15.0'; /** * Constant with version of HTML Purifier. */ - const VERSION = '4.14.0'; + const VERSION = '4.15.0'; /** * Global configuration object. diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier.safe-includes.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier.safe-includes.php index a3261f8a3..94543f593 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier.safe-includes.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier.safe-includes.php @@ -101,6 +101,7 @@ require_once $__dir . '/HTMLPurifier/AttrDef/HTML/Bool.php'; require_once $__dir . '/HTMLPurifier/AttrDef/HTML/Nmtokens.php'; require_once $__dir . '/HTMLPurifier/AttrDef/HTML/Class.php'; require_once $__dir . '/HTMLPurifier/AttrDef/HTML/Color.php'; +require_once $__dir . '/HTMLPurifier/AttrDef/HTML/ContentEditable.php'; require_once $__dir . '/HTMLPurifier/AttrDef/HTML/FrameTarget.php'; require_once $__dir . '/HTMLPurifier/AttrDef/HTML/ID.php'; require_once $__dir . '/HTMLPurifier/AttrDef/HTML/Pixels.php'; diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/NameSync.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/NameSync.php index 36079b786..5a1fdbbfc 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/NameSync.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/NameSync.php @@ -8,6 +8,11 @@ class HTMLPurifier_AttrTransform_NameSync extends HTMLPurifier_AttrTransform { + /** + * @type HTMLPurifier_AttrDef_HTML_ID + */ + public $idDef; + public function __construct() { $this->idDef = new HTMLPurifier_AttrDef_HTML_ID(); diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/SafeParam.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/SafeParam.php index 1143b4b49..1033106b3 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/SafeParam.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTransform/SafeParam.php @@ -24,6 +24,11 @@ class HTMLPurifier_AttrTransform_SafeParam extends HTMLPurifier_AttrTransform */ private $uri; + /** + * @type HTMLPurifier_AttrDef_Enum + */ + public $wmode; + public function __construct() { $this->uri = new HTMLPurifier_AttrDef_URI(true); // embedded diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTypes.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTypes.php index 3b70520b6..e4429e86d 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTypes.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrTypes.php @@ -41,6 +41,7 @@ class HTMLPurifier_AttrTypes $this->info['IAlign'] = self::makeEnum('top,middle,bottom,left,right'); $this->info['LAlign'] = self::makeEnum('top,bottom,left,right'); $this->info['FrameTarget'] = new HTMLPurifier_AttrDef_HTML_FrameTarget(); + $this->info['ContentEditable'] = new HTMLPurifier_AttrDef_HTML_ContentEditable(); // unimplemented aliases $this->info['ContentType'] = new HTMLPurifier_AttrDef_Text(); diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/List.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/List.php index 4fc70e0ef..3d584e727 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/List.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ChildDef/List.php @@ -22,6 +22,8 @@ class HTMLPurifier_ChildDef_List extends HTMLPurifier_ChildDef // XXX: This whole business with 'wrap' is all a bit unsatisfactory public $elements = array('li' => true, 'ul' => true, 'ol' => true); + public $whitespace; + /** * @param array $children * @param HTMLPurifier_Config $config diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Config.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Config.php index 16a6b322b..797d26877 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Config.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Config.php @@ -21,7 +21,7 @@ class HTMLPurifier_Config * HTML Purifier's version * @type string */ - public $version = '4.14.0'; + public $version = '4.15.0'; /** * Whether or not to automatically finalize diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ElementDef.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ElementDef.php index d5311cedc..57cfd2bb0 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ElementDef.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/ElementDef.php @@ -176,7 +176,7 @@ class HTMLPurifier_ElementDef if (!empty($def->content_model)) { $this->content_model = - str_replace("#SUPER", $this->content_model, $def->content_model); + str_replace("#SUPER", (string)$this->content_model, $def->content_model); $this->child = false; } if (!empty($def->content_model_type)) { diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Encoder.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Encoder.php index 40a24266a..d4791cc1b 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Encoder.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Encoder.php @@ -398,8 +398,8 @@ class HTMLPurifier_Encoder // characters to their true byte-wise ASCII/UTF-8 equivalents. $str = strtr($str, self::testEncodingSupportsASCII($encoding)); return $str; - } elseif ($encoding === 'iso-8859-1') { - $str = utf8_encode($str); + } elseif ($encoding === 'iso-8859-1' && function_exists('mb_convert_encoding')) { + $str = mb_convert_encoding($str, 'UTF-8', 'ISO-8859-1'); return $str; } $bug = HTMLPurifier_Encoder::testIconvTruncateBug(); @@ -450,8 +450,8 @@ class HTMLPurifier_Encoder // Normal stuff $str = self::iconv('utf-8', $encoding . '//IGNORE', $str); return $str; - } elseif ($encoding === 'iso-8859-1') { - $str = utf8_decode($str); + } elseif ($encoding === 'iso-8859-1' && function_exists('mb_convert_encoding')) { + $str = mb_convert_encoding($str, 'ISO-8859-1', 'UTF-8'); return $str; } trigger_error('Encoding not supported', E_USER_ERROR); diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/CommonAttributes.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/CommonAttributes.php index a96ab1bef..7220c14cc 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/CommonAttributes.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/HTMLModule/CommonAttributes.php @@ -17,6 +17,7 @@ class HTMLPurifier_HTMLModule_CommonAttributes extends HTMLPurifier_HTMLModule 'class' => 'Class', 'id' => 'ID', 'title' => 'CDATA', + 'contenteditable' => 'ContentEditable', ), 'Lang' => array(), 'I18N' => array( diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Injector/RemoveSpansWithoutAttributes.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Injector/RemoveSpansWithoutAttributes.php index 9ee7aa84d..42d514447 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Injector/RemoveSpansWithoutAttributes.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Injector/RemoveSpansWithoutAttributes.php @@ -31,6 +31,16 @@ class HTMLPurifier_Injector_RemoveSpansWithoutAttributes extends HTMLPurifier_In */ private $context; + /** + * @type SplObjectStorage + */ + private $markForDeletion; + + public function __construct() + { + $this->markForDeletion = new SplObjectStorage(); + } + public function prepare($config, $context) { $this->attrValidator = new HTMLPurifier_AttrValidator(); @@ -64,7 +74,7 @@ class HTMLPurifier_Injector_RemoveSpansWithoutAttributes extends HTMLPurifier_In if ($current instanceof HTMLPurifier_Token_End && $current->name === 'span') { // Mark closing span tag for deletion - $current->markForDeletion = true; + $this->markForDeletion->attach($current); // Delete open span tag $token = false; } @@ -75,7 +85,8 @@ class HTMLPurifier_Injector_RemoveSpansWithoutAttributes extends HTMLPurifier_In */ public function handleEnd(&$token) { - if ($token->markForDeletion) { + if ($this->markForDeletion->contains($token)) { + $this->markForDeletion->detach($token); $token = false; } } diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Length.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Length.php index e70da55a9..b6ea12345 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Length.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Length.php @@ -78,7 +78,7 @@ class HTMLPurifier_Length if ($this->n === '0' && $this->unit === false) { return true; } - if (!ctype_lower($this->unit)) { + if ($this->unit === false || !ctype_lower($this->unit)) { $this->unit = strtolower($this->unit); } if (!isset(HTMLPurifier_Length::$allowedUnits[$this->unit])) { diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer.php index e9da3ed5e..c21f36491 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer.php @@ -48,6 +48,11 @@ class HTMLPurifier_Lexer */ public $tracksLineNumbers = false; + /** + * @type HTMLPurifier_EntityParser + */ + private $_entity_parser; + // -- STATIC ---------------------------------------------------------- /** @@ -306,8 +311,8 @@ class HTMLPurifier_Lexer { // normalize newlines to \n if ($config->get('Core.NormalizeNewlines')) { - $html = str_replace("\r\n", "\n", $html); - $html = str_replace("\r", "\n", $html); + $html = str_replace("\r\n", "\n", (string)$html); + $html = str_replace("\r", "\n", (string)$html); } if ($config->get('HTML.Trusted')) { diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer/PH5P.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer/PH5P.php index 72476ddf3..1564f283d 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer/PH5P.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/Lexer/PH5P.php @@ -4410,7 +4410,7 @@ class HTML5TreeConstructer foreach ($token['attr'] as $attr) { if (!$el->hasAttribute($attr['name'])) { - $el->setAttribute($attr['name'], $attr['value']); + $el->setAttribute($attr['name'], (string)$attr['value']); } } diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/PropertyListIterator.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/PropertyListIterator.php index 15b330ea3..f68fc8c30 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/PropertyListIterator.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/PropertyListIterator.php @@ -29,6 +29,7 @@ class HTMLPurifier_PropertyListIterator extends FilterIterator /** * @return bool */ + #[\ReturnTypeWillChange] public function accept() { $key = $this->getInnerIterator()->key(); diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/StringHash.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/StringHash.php index c07370197..c41ae3a76 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/StringHash.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/StringHash.php @@ -20,6 +20,7 @@ class HTMLPurifier_StringHash extends ArrayObject * @param mixed $index * @return mixed */ + #[\ReturnTypeWillChange] public function offsetGet($index) { $this->accessed[$index] = true; diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/HostBlacklist.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/HostBlacklist.php index a6645c17e..32197c0e6 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/HostBlacklist.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/HostBlacklist.php @@ -35,7 +35,7 @@ class HTMLPurifier_URIFilter_HostBlacklist extends HTMLPurifier_URIFilter public function filter(&$uri, $config, $context) { foreach ($this->blacklist as $blacklisted_host_fragment) { - if (strpos($uri->host, $blacklisted_host_fragment) !== false) { + if ($uri->host !== null && strpos($uri->host, $blacklisted_host_fragment) !== false) { return false; } } diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/Munge.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/Munge.php index 6e03315a1..e1393deb7 100644 --- a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/Munge.php +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/URIFilter/Munge.php @@ -100,11 +100,11 @@ class HTMLPurifier_URIFilter_Munge extends HTMLPurifier_URIFilter $string = $uri->toString(); // always available $this->replace['%s'] = $string; - $this->replace['%r'] = $context->get('EmbeddedURI', true); - $token = $context->get('CurrentToken', true); - $this->replace['%n'] = $token ? $token->name : null; - $this->replace['%m'] = $context->get('CurrentAttr', true); - $this->replace['%p'] = $context->get('CurrentCSSProperty', true); + $this->replace['%r'] = $context->get('EmbeddedURI', true) ?: ''; + $token = $context->get('CurrentToken', true) ?: ''; + $this->replace['%n'] = $token ? $token->name : ''; + $this->replace['%m'] = $context->get('CurrentAttr', true) ?: ''; + $this->replace['%p'] = $context->get('CurrentCSSProperty', true) ?: ''; // not always available if ($this->secretKey) { $this->replace['%t'] = hash_hmac("sha256", $string, $this->secretKey); diff --git a/vendor/league/flysystem/src/Adapter/Ftp.php b/vendor/league/flysystem/src/Adapter/Ftp.php index caa8b91d8..b7886bb2d 100644 --- a/vendor/league/flysystem/src/Adapter/Ftp.php +++ b/vendor/league/flysystem/src/Adapter/Ftp.php @@ -572,9 +572,9 @@ class Ftp extends AbstractFtpAdapter private function getRawExecResponseCode($command) { - $response = @ftp_raw($this->connection, trim($command)); + $response = @ftp_raw($this->connection, trim($command)) ?: []; - return (int) preg_replace('/\D/', '', implode(' ', $response)); + return (int) preg_replace('/\D/', '', implode(' ', (array) $response)); } private function hasFtpConnection(): bool diff --git a/vendor/phpmailer/phpmailer/VERSION b/vendor/phpmailer/phpmailer/VERSION index a08b5f1e8..653877f1f 100644 --- a/vendor/phpmailer/phpmailer/VERSION +++ b/vendor/phpmailer/phpmailer/VERSION @@ -1 +1 @@ -6.6.4 \ No newline at end of file +6.6.5 \ No newline at end of file diff --git a/vendor/phpmailer/phpmailer/composer.json b/vendor/phpmailer/phpmailer/composer.json index 1db6f03d8..9275fab48 100644 --- a/vendor/phpmailer/phpmailer/composer.json +++ b/vendor/phpmailer/phpmailer/composer.json @@ -51,7 +51,7 @@ "hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication", "league/oauth2-google": "Needed for Google XOAUTH2 authentication", "psr/log": "For optional PSR-3 debug logging", - "stevenmaguire/oauth2-microsoft": "Needed for Microsoft XOAUTH2 authentication", + "thenetworg/oauth2-azure": "Needed for Microsoft XOAUTH2 authentication", "symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)" }, "autoload": { diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-da.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-da.php index 1edba1d7a..8b7b38a6e 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-da.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-da.php @@ -14,16 +14,22 @@ $PHPMAILER_LANG['data_not_accepted'] = 'SMTP fejl: Data blev ikke accepteret. $PHPMAILER_LANG['empty_message'] = 'Meddelelsen er uden indhold'; $PHPMAILER_LANG['encoding'] = 'Ukendt encode-format: '; $PHPMAILER_LANG['execute'] = 'Kunne ikke afvikle: '; +$PHPMAILER_LANG['extension_missing'] = 'Udvidelse mangler: '; $PHPMAILER_LANG['file_access'] = 'Kunne ikke tilgå filen: '; $PHPMAILER_LANG['file_open'] = 'Fil fejl: Kunne ikke åbne filen: '; $PHPMAILER_LANG['from_failed'] = 'Følgende afsenderadresse er forkert: '; $PHPMAILER_LANG['instantiate'] = 'Email funktionen kunne ikke initialiseres.'; $PHPMAILER_LANG['invalid_address'] = 'Udgyldig adresse: '; +$PHPMAILER_LANG['invalid_header'] = 'Ugyldig header navn eller værdi'; +$PHPMAILER_LANG['invalid_hostentry'] = 'Ugyldig hostentry: '; +$PHPMAILER_LANG['invalid_host'] = 'Ugyldig vært: '; $PHPMAILER_LANG['mailer_not_supported'] = ' mailer understøttes ikke.'; $PHPMAILER_LANG['provide_address'] = 'Indtast mindst en modtagers email adresse.'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP fejl: Følgende modtagere er forkerte: '; +$PHPMAILER_LANG['recipients_failed'] = 'SMTP fejl: Følgende modtagere fejlede: '; $PHPMAILER_LANG['signing'] = 'Signeringsfejl: '; +$PHPMAILER_LANG['smtp_code'] = 'SMTP kode: '; +$PHPMAILER_LANG['smtp_code_ex'] = 'Yderligere SMTP info: '; $PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() fejlede.'; +$PHPMAILER_LANG['smtp_detail'] = 'Detalje: '; $PHPMAILER_LANG['smtp_error'] = 'SMTP server fejl: '; $PHPMAILER_LANG['variable_set'] = 'Kunne ikke definere eller nulstille variablen: '; -$PHPMAILER_LANG['extension_missing'] = 'Udvidelse mangler: '; diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-pl.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-pl.php index 23caa71be..b0469fdb7 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-pl.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-pl.php @@ -9,19 +9,18 @@ $PHPMAILER_LANG['authenticate'] = 'Błąd SMTP: Nie można przeprowadzi $PHPMAILER_LANG['connect_host'] = 'Błąd SMTP: Nie można połączyć się z wybranym hostem.'; $PHPMAILER_LANG['data_not_accepted'] = 'Błąd SMTP: Dane nie zostały przyjęte.'; $PHPMAILER_LANG['empty_message'] = 'Wiadomość jest pusta.'; -$PHPMAILER_LANG['encoding'] = 'Nieznany sposób kodowania znaków: '; +$PHPMAILER_LANG['encoding'] = 'Błędny sposób kodowania znaków: '; $PHPMAILER_LANG['execute'] = 'Nie można uruchomić: '; $PHPMAILER_LANG['file_access'] = 'Brak dostępu do pliku: '; $PHPMAILER_LANG['file_open'] = 'Nie można otworzyć pliku: '; -$PHPMAILER_LANG['from_failed'] = 'Następujący adres Nadawcy jest nieprawidłowy: '; +$PHPMAILER_LANG['from_failed'] = 'Następujący adres nadawcy jest nieprawidłowy lub nie istnieje: '; $PHPMAILER_LANG['instantiate'] = 'Nie można wywołać funkcji mail(). Sprawdź konfigurację serwera.'; -$PHPMAILER_LANG['invalid_address'] = 'Nie można wysłać wiadomości, ' . - 'następujący adres Odbiorcy jest nieprawidłowy: '; -$PHPMAILER_LANG['provide_address'] = 'Należy podać prawidłowy adres email Odbiorcy.'; +$PHPMAILER_LANG['invalid_address'] = 'Nie można wysłać wiadomości, ' . 'następujący adres odbiorcy jest nieprawidłowy lub nie istnieje: '; +$PHPMAILER_LANG['provide_address'] = 'Należy podać prawidłowy adres email odbiorcy.'; $PHPMAILER_LANG['mailer_not_supported'] = 'Wybrana metoda wysyłki wiadomości nie jest obsługiwana.'; -$PHPMAILER_LANG['recipients_failed'] = 'Błąd SMTP: Następujący odbiorcy są nieprawidłowi: '; +$PHPMAILER_LANG['recipients_failed'] = 'Błąd SMTP: Następujący odbiorcy są nieprawidłowi lub nie istnieją: '; $PHPMAILER_LANG['signing'] = 'Błąd podpisywania wiadomości: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() zakończone niepowodzeniem.'; +$PHPMAILER_LANG['smtp_connect_failed'] = 'Wywołanie funkcji SMTP Connect() zostało zakończone niepowodzeniem.'; $PHPMAILER_LANG['smtp_error'] = 'Błąd SMTP: '; $PHPMAILER_LANG['variable_set'] = 'Nie można ustawić lub zmodyfikować zmiennej: '; $PHPMAILER_LANG['extension_missing'] = 'Brakujące rozszerzenie: '; diff --git a/vendor/phpmailer/phpmailer/src/PHPMailer.php b/vendor/phpmailer/phpmailer/src/PHPMailer.php index 62424545a..7e6c88ff1 100644 --- a/vendor/phpmailer/phpmailer/src/PHPMailer.php +++ b/vendor/phpmailer/phpmailer/src/PHPMailer.php @@ -750,7 +750,7 @@ class PHPMailer * * @var string */ - const VERSION = '6.6.4'; + const VERSION = '6.6.5'; /** * Error severity: message only, continue processing. @@ -1671,7 +1671,7 @@ class PHPMailer return $this->mailSend($this->MIMEHeader, $this->MIMEBody); } } catch (Exception $exc) { - if ($this->Mailer === 'smtp' && $this->SMTPKeepAlive == true) { + if ($this->Mailer === 'smtp' && $this->SMTPKeepAlive == true && $this->smtp->connected()) { $this->smtp->reset(); } $this->setError($exc->getMessage()); @@ -1863,7 +1863,7 @@ class PHPMailer if (!static::isPermittedPath($path)) { return false; } - $readable = file_exists($path); + $readable = is_file($path); //If not a UNC path (expected to start with \\), check read permission, see #2069 if (strpos($path, '\\\\') !== 0) { $readable = $readable && is_readable($path); @@ -2101,6 +2101,9 @@ class PHPMailer $this->smtp->setDebugLevel($this->SMTPDebug); $this->smtp->setDebugOutput($this->Debugoutput); $this->smtp->setVerp($this->do_verp); + if ($this->Host === null) { + $this->Host = 'localhost'; + } $hosts = explode(';', $this->Host); $lastexception = null; diff --git a/vendor/phpmailer/phpmailer/src/POP3.php b/vendor/phpmailer/phpmailer/src/POP3.php index 78e91e49a..a3c9f4532 100644 --- a/vendor/phpmailer/phpmailer/src/POP3.php +++ b/vendor/phpmailer/phpmailer/src/POP3.php @@ -46,7 +46,7 @@ class POP3 * * @var string */ - const VERSION = '6.6.4'; + const VERSION = '6.6.5'; /** * Default POP3 port number. diff --git a/vendor/phpmailer/phpmailer/src/SMTP.php b/vendor/phpmailer/phpmailer/src/SMTP.php index cc1711d2e..312f753ce 100644 --- a/vendor/phpmailer/phpmailer/src/SMTP.php +++ b/vendor/phpmailer/phpmailer/src/SMTP.php @@ -35,7 +35,7 @@ class SMTP * * @var string */ - const VERSION = '6.6.4'; + const VERSION = '6.6.5'; /** * SMTP line break constant. @@ -682,7 +682,6 @@ class SMTP */ public function close() { - $this->setError(''); $this->server_caps = null; $this->helo_rply = null; if (is_resource($this->smtp_conn)) { diff --git a/vendor/services.php b/vendor/services.php index f3de1be1e..377b4dde4 100644 --- a/vendor/services.php +++ b/vendor/services.php @@ -1,5 +1,5 @@ 'app\\admin\\AppStoreService', diff --git a/vendor/thinkcmf/cmf/think/App.php b/vendor/thinkcmf/cmf/think/App.php index 4f3dc391a..ca9261262 100644 --- a/vendor/thinkcmf/cmf/think/App.php +++ b/vendor/thinkcmf/cmf/think/App.php @@ -39,7 +39,7 @@ use think\initializer\RegisterService; */ class App extends Container { - const VERSION = '6.0.13LTS'; + const VERSION = '6.0.14LTS'; /** * 应用调试模式 diff --git a/vendor/topthink/framework/src/think/App.php b/vendor/topthink/framework/src/think/App.php index b189cd954..1edadb6f3 100644 --- a/vendor/topthink/framework/src/think/App.php +++ b/vendor/topthink/framework/src/think/App.php @@ -39,7 +39,7 @@ use think\initializer\RegisterService; */ class App extends Container { - const VERSION = '6.0.13LTS'; + const VERSION = '6.0.14LTS'; /** * 应用调试模式 diff --git a/vendor/topthink/framework/src/think/Console.php b/vendor/topthink/framework/src/think/Console.php index 389d104d5..27f12baad 100644 --- a/vendor/topthink/framework/src/think/Console.php +++ b/vendor/topthink/framework/src/think/Console.php @@ -117,9 +117,9 @@ class Console */ protected function makeRequest() { - $uri = $this->app->config->get('app.url', 'http://localhost'); + $url = $this->app->config->get('app.url', 'http://localhost'); - $components = parse_url($uri); + $components = parse_url($url); $server = $_SERVER; @@ -127,6 +127,7 @@ class Console $server = array_merge($server, [ 'SCRIPT_FILENAME' => $components['path'], 'SCRIPT_NAME' => $components['path'], + 'REQUEST_URI' => $components['path'], ]); } @@ -150,8 +151,6 @@ class Console $server['HTTP_HOST'] .= ':' . $components['port']; } - $server['REQUEST_URI'] = $uri; - /** @var Request $request */ $request = $this->app->make('request'); diff --git a/vendor/topthink/framework/src/think/Lang.php b/vendor/topthink/framework/src/think/Lang.php index 5f16c464b..b89108482 100644 --- a/vendor/topthink/framework/src/think/Lang.php +++ b/vendor/topthink/framework/src/think/Lang.php @@ -287,58 +287,4 @@ class Lang return $value; } - /** - * 自动侦测设置获取语言选择 - * @deprecated - * @access public - * @param Request $request - * @return string - */ - public function detect(Request $request): string - { - // 自动侦测设置获取语言选择 - $langSet = ''; - - if ($request->get($this->config['detect_var'])) { - // url中设置了语言变量 - $langSet = strtolower($request->get($this->config['detect_var'])); - } elseif ($request->header($this->config['header_var'])) { - // Header中设置了语言变量 - $langSet = strtolower($request->header($this->config['header_var'])); - } elseif ($request->cookie($this->config['cookie_var'])) { - // Cookie中设置了语言变量 - $langSet = strtolower($request->cookie($this->config['cookie_var'])); - } elseif ($request->server('HTTP_ACCEPT_LANGUAGE')) { - // 自动侦测浏览器语言 - $match = preg_match('/^([a-z\d\-]+)/i', $request->server('HTTP_ACCEPT_LANGUAGE'), $matches); - if ($match) { - $langSet = strtolower($matches[1]); - if (isset($this->config['accept_language'][$langSet])) { - $langSet = $this->config['accept_language'][$langSet]; - } - } - } - - if (empty($this->config['allow_lang_list']) || in_array($langSet, $this->config['allow_lang_list'])) { - // 合法的语言 - $this->range = $langSet; - } - - return $this->range; - } - - /** - * 保存当前语言到Cookie - * @deprecated - * @access public - * @param Cookie $cookie Cookie对象 - * @return void - */ - public function saveToCookie(Cookie $cookie) - { - if ($this->config['use_cookie']) { - $cookie->set($this->config['cookie_var'], $this->range); - } - } - } diff --git a/vendor/topthink/framework/src/think/middleware/LoadLangPack.php b/vendor/topthink/framework/src/think/middleware/LoadLangPack.php index d6bf6a462..af0324b83 100644 --- a/vendor/topthink/framework/src/think/middleware/LoadLangPack.php +++ b/vendor/topthink/framework/src/think/middleware/LoadLangPack.php @@ -70,33 +70,35 @@ class LoadLangPack if ($request->get($this->config['detect_var'])) { // url中设置了语言变量 - $langSet = strtolower($request->get($this->config['detect_var'])); + $langSet = $request->get($this->config['detect_var']); } elseif ($request->header($this->config['header_var'])) { // Header中设置了语言变量 - $langSet = strtolower($request->header($this->config['header_var'])); + $langSet = $request->header($this->config['header_var']); } elseif ($request->cookie($this->config['cookie_var'])) { // Cookie中设置了语言变量 - $langSet = strtolower($request->cookie($this->config['cookie_var'])); + $langSet = $request->cookie($this->config['cookie_var']); } elseif ($request->server('HTTP_ACCEPT_LANGUAGE')) { // 自动侦测浏览器语言 - $match = preg_match('/^([a-z\d\-]+)/i', $request->server('HTTP_ACCEPT_LANGUAGE'), $matches); - if ($match) { - $langSet = strtolower($matches[1]); - if (isset($this->config['accept_language'][$langSet])) { - $langSet = $this->config['accept_language'][$langSet]; - } + $langSet = $request->server('HTTP_ACCEPT_LANGUAGE'); + } + + if (preg_match('/^([a-z\d\-]+)/i', $langSet, $matches)) { + $langSet = strtolower($matches[1]); + if (isset($this->config['accept_language'][$langSet])) { + $langSet = $this->config['accept_language'][$langSet]; } + } else { + $langSet = $this->lang->getLangSet(); } if (empty($this->config['allow_lang_list']) || in_array($langSet, $this->config['allow_lang_list'])) { // 合法的语言 - $range = $langSet; - $this->lang->setLangSet($range); + $this->lang->setLangSet($langSet); } else { - $range = $this->lang->getLangSet(); + $langSet = $this->lang->getLangSet(); } - return $range; + return $langSet; } /** diff --git a/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php b/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php index 0015a24ab..cabd65bb7 100644 --- a/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php +++ b/vendor/topthink/think-orm/src/db/concern/ModelRelationQuery.php @@ -559,23 +559,4 @@ trait ModelRelationQuery $result->refreshOrigin(); } - /** - * 查询软删除数据 - * @access public - * @return Query - */ - public function withTrashed() - { - return $this->model ? $this->model->queryWithTrashed() : $this; - } - - /** - * 只查询软删除数据 - * @access public - * @return Query - */ - public function onlyTrashed() - { - return $this->model ? $this->model->queryOnlyTrashed() : $this; - } } diff --git a/vendor/topthink/think-orm/src/model/concern/Attribute.php b/vendor/topthink/think-orm/src/model/concern/Attribute.php index 897d327f0..b14d25a89 100644 --- a/vendor/topthink/think-orm/src/model/concern/Attribute.php +++ b/vendor/topthink/think-orm/src/model/concern/Attribute.php @@ -383,7 +383,7 @@ trait Attribute } elseif (isset($this->type[$name])) { // 类型转换 $value = $this->writeTransform($value, $this->type[$name]); - } elseif (array_key_exists($name, $this->origin) && is_object($value) && method_exists($value, '__toString')) { + } elseif ((array_key_exists($name, $this->origin) || empty($this->origin)) && is_object($value) && method_exists($value, '__toString')) { // 对象类型 $value = $value->__toString(); } diff --git a/vendor/topthink/think-orm/src/model/concern/SoftDelete.php b/vendor/topthink/think-orm/src/model/concern/SoftDelete.php index 117f1ef7b..b7b10921b 100644 --- a/vendor/topthink/think-orm/src/model/concern/SoftDelete.php +++ b/vendor/topthink/think-orm/src/model/concern/SoftDelete.php @@ -18,14 +18,18 @@ use think\Model; /** * 数据软删除 * @mixin Model + * @method $this withTrashed() + * @method $this onlyTrashed() */ trait SoftDelete { - /** - * 是否包含软删除数据 - * @var bool - */ - protected $withTrashed = false; + + public function db($scope = []): Query + { + $query = parent::db($scope); + $this->withNoTrashed($query); + return $query; + } /** * 判断当前实例是否被软删除 @@ -43,74 +47,18 @@ trait SoftDelete return false; } - /** - * 查询软删除数据 - * @access public - * @return Query - */ - public static function withTrashed(): Query + public function scopeWithTrashed(Query $query) { - $model = new static(); - - return $model->withTrashedData(true)->db(); + $query->removeOption('soft_delete'); } - /** - * 查询软删除数据 - * @access public - * @return Query - */ - public function queryWithTrashed(): Query - { - return $this->withTrashedData(true)->db(); - } - - /** - * 是否包含软删除数据 - * @access protected - * @param bool $withTrashed 是否包含软删除数据 - * @return $this - */ - protected function withTrashedData(bool $withTrashed) - { - $this->withTrashed = $withTrashed; - return $this; - } - - /** - * 只查询软删除数据 - * @access public - * @return Query - */ - public static function onlyTrashed(): Query - { - $model = new static(); - $field = $model->getDeleteTimeField(true); - - if ($field) { - return $model - ->db() - ->useSoftDelete($field, $model->getWithTrashedExp()); - } - - return $model->db(); - } - - /** - * 只查询软删除数据 - * @access public - * @return Query - */ - public function queryOnlyTrashed(): Query + public function scopeOnlyTrashed(Query $query) { $field = $this->getDeleteTimeField(true); if ($field) { - return $this->db() - ->useSoftDelete($field, $this->getWithTrashedExp()); + $query->useSoftDelete($field, $this->getWithTrashedExp()); } - - return $this->db(); } /** @@ -139,9 +87,9 @@ trait SoftDelete if ($name && !$force) { // 软删除 - $this->set($name, $this->autoWriteTimestamp($name)); + $this->set($name, $this->autoWriteTimestamp()); - $result = $this->exists()->withEvent(false)->save(); + $this->exists()->withEvent(false)->save(); $this->withEvent(true); } else { @@ -149,7 +97,7 @@ trait SoftDelete $where = $this->getWhere(); // 删除当前模型数据 - $result = $this->db() + $this->db() ->where($where) ->removeOption('soft_delete') ->delete(); @@ -172,8 +120,8 @@ trait SoftDelete /** * 删除记录 * @access public - * @param mixed $data 主键列表 支持闭包查询条件 - * @param bool $force 是否强制删除 + * @param mixed $data 主键列表 支持闭包查询条件 + * @param bool $force 是否强制删除 * @return bool */ public static function destroy($data, bool $force = false): bool @@ -182,18 +130,20 @@ trait SoftDelete if (empty($data) && 0 !== $data) { return false; } - // 仅当强制删除时包含软删除数据 $model = (new static()); + + $query = $model->db(false); + + // 仅当强制删除时包含软删除数据 if ($force) { - $model->withTrashedData(true); + $query->removeOption('soft_delete'); } - $query = $model->db(false); if (is_array($data) && key($data) !== 0) { $query->where($data); $data = null; } elseif ($data instanceof \Closure) { - call_user_func_array($data, [ & $query]); + call_user_func_array($data, [&$query]); $data = null; } elseif (is_null($data)) { return false; @@ -202,6 +152,7 @@ trait SoftDelete $resultSet = $query->select($data); foreach ($resultSet as $result) { + /** @var Model $result */ $result->force($force)->delete(); } @@ -211,7 +162,7 @@ trait SoftDelete /** * 恢复被软删除的记录 * @access public - * @param array $where 更新条件 + * @param array $where 更新条件 * @return bool */ public function restore($where = []): bool @@ -243,7 +194,7 @@ trait SoftDelete /** * 获取软删除字段 * @access protected - * @param bool $read 是否查询操作 写操作的时候会自动去掉表别名 + * @param bool $read 是否查询操作 写操作的时候会自动去掉表别名 * @return string|false */ protected function getDeleteTimeField(bool $read = false) @@ -269,7 +220,7 @@ trait SoftDelete /** * 查询的时候默认排除软删除数据 * @access protected - * @param Query $query + * @param Query $query * @return void */ protected function withNoTrashed(Query $query): void diff --git a/vendor/topthink/think-orm/src/model/relation/BelongsTo.php b/vendor/topthink/think-orm/src/model/relation/BelongsTo.php index dd54f52ca..741a2e8d4 100644 --- a/vendor/topthink/think-orm/src/model/relation/BelongsTo.php +++ b/vendor/topthink/think-orm/src/model/relation/BelongsTo.php @@ -241,7 +241,7 @@ class BelongsTo extends OneToOne if (!empty($this->bindAttr)) { // 绑定关联属性 $this->bindAttr($result, $relationModel); - $result->hidden([$relation]); + $result->hidden([$relation], true); } } } @@ -283,7 +283,7 @@ class BelongsTo extends OneToOne if (!empty($this->bindAttr)) { // 绑定关联属性 $this->bindAttr($result, $relationModel); - $result->hidden([$relation]); + $result->hidden([$relation], true); } } diff --git a/vendor/topthink/think-orm/src/model/relation/HasOne.php b/vendor/topthink/think-orm/src/model/relation/HasOne.php index 43f220c9d..5e5e50112 100644 --- a/vendor/topthink/think-orm/src/model/relation/HasOne.php +++ b/vendor/topthink/think-orm/src/model/relation/HasOne.php @@ -240,7 +240,7 @@ class HasOne extends OneToOne if (!empty($this->bindAttr)) { // 绑定关联属性 $this->bindAttr($result, $relationModel); - $result->hidden([$relation]); + $result->hidden([$relation], true); } } } @@ -282,7 +282,7 @@ class HasOne extends OneToOne if (!empty($this->bindAttr)) { // 绑定关联属性 $this->bindAttr($result, $relationModel); - $result->hidden([$relation]); + $result->hidden([$relation], true); } } diff --git a/vendor/topthink/think-orm/src/model/relation/MorphTo.php b/vendor/topthink/think-orm/src/model/relation/MorphTo.php index f53fe4fc5..74b16c277 100644 --- a/vendor/topthink/think-orm/src/model/relation/MorphTo.php +++ b/vendor/topthink/think-orm/src/model/relation/MorphTo.php @@ -13,6 +13,7 @@ namespace think\model\relation; use Closure; use think\db\exception\DbException as Exception; +use think\db\Query; use think\helper\Str; use think\Model; use think\model\Relation; @@ -46,14 +47,16 @@ class MorphTo extends Relation */ protected $relation; + protected $queryCaller = []; + /** * 架构函数 * @access public - * @param Model $parent 上级模型对象 - * @param string $morphType 多态字段名 - * @param string $morphKey 外键名 - * @param array $alias 多态别名定义 - * @param string $relation 关联名 + * @param Model $parent 上级模型对象 + * @param string $morphType 多态字段名 + * @param string $morphKey 外键名 + * @param array $alias 多态别名定义 + * @param ?string $relation 关联名 */ public function __construct(Model $parent, string $morphType, string $morphKey, array $alias = [], string $relation = null) { @@ -80,8 +83,8 @@ class MorphTo extends Relation /** * 延迟获取关联数据 * @access public - * @param array $subRelation 子关联名 - * @param Closure $closure 闭包查询条件 + * @param array $subRelation 子关联名 + * @param ?Closure $closure 闭包查询条件 * @return Model */ public function getRelation(array $subRelation = [], Closure $closure = null) @@ -95,7 +98,7 @@ class MorphTo extends Relation // 主键数据 $pk = $this->parent->$morphKey; - $relationModel = (new $model)->relation($subRelation)->find($pk); + $relationModel = $this->buildQuery((new $model)->relation($subRelation))->find($pk); if ($relationModel) { $relationModel->setParent(clone $this->parent); @@ -107,11 +110,11 @@ class MorphTo extends Relation /** * 根据关联条件查询当前模型 * @access public - * @param string $operator 比较操作符 - * @param integer $count 个数 - * @param string $id 关联表的统计字段 - * @param string $joinType JOIN类型 - * @param Query $query Query对象 + * @param string $operator 比较操作符 + * @param integer $count 个数 + * @param string $id 关联表的统计字段 + * @param string $joinType JOIN类型 + * @param Query $query Query对象 * @return Query */ public function has(string $operator = '>=', int $count = 1, string $id = '*', string $joinType = '', Query $query = null) @@ -122,22 +125,45 @@ class MorphTo extends Relation /** * 根据关联条件查询当前模型 * @access public - * @param mixed $where 查询条件(数组或者闭包) - * @param mixed $fields 字段 - * @param string $joinType JOIN类型 - * @param Query $query Query对象 + * @param mixed $where 查询条件(数组或者闭包) + * @param mixed $fields 字段 + * @param string $joinType JOIN类型 + * @param ?Query $query Query对象 * @return Query */ public function hasWhere($where = [], $fields = null, string $joinType = '', Query $query = null) { - throw new Exception('relation not support: hasWhere'); + $alias = class_basename($this->parent); + + $types = $this->parent->distinct()->column($this->morphType); + + $query = $query ?: $this->parent->db(); + + return $query->alias($alias) + ->where(function (Query $query) use ($types, $where, $alias) { + foreach ($types as $type) { + if ($type) { + $query->whereExists(function (Query $query) use ($type, $where, $alias) { + /** @var Model $model */ + $model = new ($this->parseModel($type)); + + $table = $model->getTable(); + $query + ->table($table) + ->where($alias . '.' . $this->morphType, $type) + ->whereRaw("`{$alias}`.`{$this->morphKey}`=`{$table}`.`{$model->getPk()}`") + ->where($where); + }, 'OR'); + } + } + }); } /** * 解析模型的完整命名空间 * @access protected - * @param string $model 模型名(或者完整类名) - * @return string + * @param string $model 模型名(或者完整类名) + * @return Model */ protected function parseModel(string $model): string { @@ -158,7 +184,7 @@ class MorphTo extends Relation /** * 设置多态别名 * @access public - * @param array $alias 别名定义 + * @param array $alias 别名定义 * @return $this */ public function setAlias(array $alias) @@ -173,7 +199,7 @@ class MorphTo extends Relation * @access public * @return $this */ - public function removeOption() + public function removeOption(string $option = '') { return $this; } @@ -181,11 +207,11 @@ class MorphTo extends Relation /** * 预载入关联查询 * @access public - * @param array $resultSet 数据集 - * @param string $relation 当前关联名 - * @param array $subRelation 子关联名 - * @param Closure $closure 闭包 - * @param array $cache 关联缓存 + * @param array $resultSet 数据集 + * @param string $relation 当前关联名 + * @param array $subRelation 子关联名 + * @param ?Closure $closure 闭包 + * @param array $cache 关联缓存 * @return void * @throws Exception */ @@ -211,8 +237,8 @@ class MorphTo extends Relation if (!\is_null($closure)) { $obj = $closure($obj); } - $pk = $obj->getPk(); - $list = $obj->with($subRelation) + $pk = $obj->getPk(); + $list = $obj->with($subRelation) ->cache($cache[0] ?? false, $cache[1] ?? null, $cache[2] ?? null) ->select($val); $data = []; @@ -242,11 +268,11 @@ class MorphTo extends Relation /** * 预载入关联查询 * @access public - * @param Model $result 数据对象 - * @param string $relation 当前关联名 - * @param array $subRelation 子关联名 - * @param Closure $closure 闭包 - * @param array $cache 关联缓存 + * @param Model $result 数据对象 + * @param string $relation 当前关联名 + * @param array $subRelation 子关联名 + * @param ?Closure $closure 闭包 + * @param array $cache 关联缓存 * @return void */ public function eagerlyResult(Model $result, string $relation, array $subRelation = [], Closure $closure = null, array $cache = []): void @@ -260,36 +286,42 @@ class MorphTo extends Relation /** * 关联统计 * @access public - * @param Model $result 数据对象 - * @param Closure $closure 闭包 - * @param string $aggregate 聚合查询方法 - * @param string $field 字段 + * @param Model $result 数据对象 + * @param ?Closure $closure 闭包 + * @param string $aggregate 聚合查询方法 + * @param string $field 字段 * @return integer */ public function relationCount(Model $result, Closure $closure = null, string $aggregate = 'count', string $field = '*') - {} + { + } /** * 多态MorphTo 关联模型预查询 * @access protected - * @param string $model 关联模型对象 - * @param string $relation 关联名 - * @param Model $result - * @param array $subRelation 子关联 - * @param array $cache 关联缓存 + * @param string $model 关联模型对象 + * @param string $relation 关联名 + * @param Model $result + * @param array $subRelation 子关联 + * @param array $cache 关联缓存 * @return void */ protected function eagerlyMorphToOne(string $model, string $relation, Model $result, array $subRelation = [], array $cache = []): void { // 预载入关联查询 支持嵌套预载入 $pk = $this->parent->{$this->morphKey}; - $data = (new $model)->with($subRelation) - ->cache($cache[0] ?? false, $cache[1] ?? null, $cache[2] ?? null) - ->find($pk); - if ($data) { - $data->setParent(clone $result); - $data->exists(true); + $data = null; + + if(\class_exists($model)){ + $data = (new $model)->with($subRelation) + ->cache($cache[0] ?? false, $cache[1] ?? null, $cache[2] ?? null) + ->find($pk); + + if ($data) { + $data->setParent(clone $result); + $data->exists(true); + } } $result->setRelation($relation, $data ?: null); @@ -298,8 +330,8 @@ class MorphTo extends Relation /** * 添加关联数据 * @access public - * @param Model $model 关联模型对象 - * @param string $type 多态类型 + * @param Model $model 关联模型对象 + * @param string $type 多态类型 * @return Model */ public function associate(Model $model, string $type = ''): Model @@ -332,4 +364,18 @@ class MorphTo extends Relation return $this->parent->setRelation($this->relation, null); } + protected function buildQuery(Query $query) + { + foreach ($this->queryCaller as $caller) { + call_user_func_array([$query, $caller[0]], $caller[1]); + } + + return $query; + } + + public function __call($method, $args) + { + $this->queryCaller[] = [$method, $args]; + return $this; + } } diff --git a/vendor/topthink/think-trace/composer.json b/vendor/topthink/think-trace/composer.json index 5af58545e..172a2d3c6 100644 --- a/vendor/topthink/think-trace/composer.json +++ b/vendor/topthink/think-trace/composer.json @@ -10,7 +10,7 @@ ], "require": { "php": ">=7.1.0", - "topthink/framework": "^6.0.0" + "topthink/framework": "^6.0" }, "autoload": { "psr-4": { -- Gitee From eaea60d185dd59cf5241b1853ad3bd4d5e3d5715 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=94=E4=BA=94?= <15093565100@163.com> Date: Tue, 1 Nov 2022 16:11:37 +0000 Subject: [PATCH 04/30] =?UTF-8?q?!41=20=E5=90=8C=E6=AD=A5=20*=20=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E6=B3=A8=E5=86=8C=E7=9B=B8=E5=85=B3=20*=20!39=20?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E6=B3=A8=E5=86=8C=E6=B5=81=E7=A8=8B=20*=20!4?= =?UTF-8?q?0=20=E5=90=8C=E6=AD=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../user/controller/RegisterController.php | 20 +++++++------------ 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/vendor/thinkcmf/cmf-app/src/user/controller/RegisterController.php b/vendor/thinkcmf/cmf-app/src/user/controller/RegisterController.php index a215a3d9a..cd560a4ba 100644 --- a/vendor/thinkcmf/cmf-app/src/user/controller/RegisterController.php +++ b/vendor/thinkcmf/cmf-app/src/user/controller/RegisterController.php @@ -54,6 +54,8 @@ class RegisterController extends HomeBaseController if ($isOpenRegistration) { unset($rules['code']); + } else { + $this->error('未开放注册功能!'); } $validate = new \think\Validate($rules); @@ -61,25 +63,17 @@ class RegisterController extends HomeBaseController 'code.require' => '验证码不能为空', 'password.require' => '密码不能为空', 'password.max' => '密码不能超过32个字符', - 'password.min' => '密码不能小于6个字符', - 'captcha.require' => '验证码不能为空', + 'password.min' => '密码不能小于6个字符' ]); $data = $this->request->post(); if (!$validate->check($data)) { $this->error($validate->getError()); } - - $captchaId = empty($data['_captcha_id']) ? '' : $data['_captcha_id']; - if (!cmf_captcha_check($data['captcha'], $captchaId)) { - $this->error('验证码错误'); - } - - if (!$isOpenRegistration) { - $errMsg = cmf_check_verification_code($data['username'], $data['code']); - if (!empty($errMsg)) { - $this->error($errMsg); - } + // 手机或短信验证码 + $errMsg = cmf_check_verification_code($data['username'], $data['code']); + if (!empty($errMsg)) { + $this->error($errMsg); } $register = new UserModel(); -- Gitee From 061010e7e77371160d653b6858ff9b8a5aa55e6c Mon Sep 17 00:00:00 2001 From: dean Date: Tue, 8 Nov 2022 17:59:34 +0800 Subject: [PATCH 05/30] =?UTF-8?q?=E4=BC=98=E5=8C=96=E7=BC=93=E5=AD=98?= =?UTF-8?q?=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vendor/thinkcmf/cmf/src/common.php | 3 +++ vendor/thinkcmf/cmf/src/listener/ModuleInitListener.php | 7 ++++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/vendor/thinkcmf/cmf/src/common.php b/vendor/thinkcmf/cmf/src/common.php index 8431a49fa..9c1acc362 100644 --- a/vendor/thinkcmf/cmf/src/common.php +++ b/vendor/thinkcmf/cmf/src/common.php @@ -14,6 +14,7 @@ use think\facade\Env; use dir\Dir; use think\facade\Route; use cmf\lib\Storage; +use think\facade\Cache; // 应用公共文件 @@ -392,6 +393,8 @@ function cmf_clear_cache() foreach ($dirs as $dir) { $dirTool->delDir($dir); } + + Cache::clear(); } /** diff --git a/vendor/thinkcmf/cmf/src/listener/ModuleInitListener.php b/vendor/thinkcmf/cmf/src/listener/ModuleInitListener.php index e94661b3a..ba3eeaf69 100644 --- a/vendor/thinkcmf/cmf/src/listener/ModuleInitListener.php +++ b/vendor/thinkcmf/cmf/src/listener/ModuleInitListener.php @@ -25,7 +25,12 @@ class ModuleInitListener /**--start InitAppHookListener--------------------------------------*/ $this->app = app(); $appName = $this->app->http->getName(); - $langSet = $this->app->lang->getLangSet(); + + if (!is_dir($this->app->getAppPath() . $appName) && !is_dir(root_path() . "vendor/thinkcmf/cmf-app/src/{$appName}")) { + return; + } + + $langSet = $this->app->lang->getLangSet(); // 加载核心应用语言包 $this->app->lang->load([ -- Gitee From 8fa67a171ea18725e6decfe7d0110532e296380b Mon Sep 17 00:00:00 2001 From: dean Date: Tue, 8 Nov 2022 18:01:09 +0800 Subject: [PATCH 06/30] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=90=8E=E5=8F=B0?= =?UTF-8?q?=E5=8A=A0=E5=AF=86=E7=A0=81=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cmf-app/src/admin/controller/IndexController.php | 6 +++++- .../cmf-app/src/admin/controller/RbacController.php | 2 +- vendor/thinkcmf/cmf-app/src/user/hooks.php | 6 ++++++ vendor/thinkcmf/cmf/src/controller/AdminBaseController.php | 2 +- 4 files changed, 13 insertions(+), 3 deletions(-) diff --git a/vendor/thinkcmf/cmf-app/src/admin/controller/IndexController.php b/vendor/thinkcmf/cmf-app/src/admin/controller/IndexController.php index 1d1a932aa..e334f57cd 100644 --- a/vendor/thinkcmf/cmf-app/src/admin/controller/IndexController.php +++ b/vendor/thinkcmf/cmf-app/src/admin/controller/IndexController.php @@ -21,7 +21,11 @@ class IndexController extends AdminBaseController public function initialize() { $adminSettings = cmf_get_option('admin_settings'); - if (empty($adminSettings['admin_password']) || $this->request->pathinfo() == $adminSettings['admin_password']) { + + if ( + empty($adminSettings['admin_password']) + || ($adminSettings['admin_password'] == str_replace('.html', '', $this->request->pathinfo())) + ) { $adminId = cmf_get_current_admin_id(); if (empty($adminId)) { session("__LOGIN_BY_CMF_ADMIN_PW__", 1);//设置后台登录加密码 diff --git a/vendor/thinkcmf/cmf-app/src/admin/controller/RbacController.php b/vendor/thinkcmf/cmf-app/src/admin/controller/RbacController.php index a76f5c4d3..79b23f8be 100644 --- a/vendor/thinkcmf/cmf-app/src/admin/controller/RbacController.php +++ b/vendor/thinkcmf/cmf-app/src/admin/controller/RbacController.php @@ -270,7 +270,7 @@ class RbacController extends AdminBaseController } $str = " - \$spacer \$name + \$spacer \$name \$app/\$controller/\$action "; $tree->init($result); diff --git a/vendor/thinkcmf/cmf-app/src/user/hooks.php b/vendor/thinkcmf/cmf-app/src/user/hooks.php index 7f3deb674..1d1c58957 100644 --- a/vendor/thinkcmf/cmf-app/src/user/hooks.php +++ b/vendor/thinkcmf/cmf-app/src/user/hooks.php @@ -33,4 +33,10 @@ return [ "description" => "用户管理第三方用户列表界面", //钩子描述 "once" => 1 // 是否只执行一次 ], + 'check_third_party_captcha' => [ + "type" => 2,//钩子类型(默认为应用钩子;2:应用钩子;3:模板钩子;4:后台模板钩子) + "name" => '第三方验证码检测', // 钩子名称 + "description" => "第三方验证码检测", //钩子描述 + "once" => 1 // 是否只执行一次 + ], ]; diff --git a/vendor/thinkcmf/cmf/src/controller/AdminBaseController.php b/vendor/thinkcmf/cmf/src/controller/AdminBaseController.php index 969b5389f..57d0e3859 100755 --- a/vendor/thinkcmf/cmf/src/controller/AdminBaseController.php +++ b/vendor/thinkcmf/cmf/src/controller/AdminBaseController.php @@ -119,7 +119,7 @@ class AdminBaseController extends BaseController $cmfAdminThemePath = config('template.cmf_admin_theme_path'); $cmfAdminDefaultTheme = cmf_get_current_admin_theme(); - $themePath = "{$cmfAdminThemePath}{$cmfAdminDefaultTheme}/"; + $themePath = WEB_ROOT . "{$cmfAdminThemePath}{$cmfAdminDefaultTheme}/"; // 基础视图目录 $app = isset($app) ? $app : $this->app->http->getName(); -- Gitee From c74cb7a188a9deb549cb5168e08f54d179582bec Mon Sep 17 00:00:00 2001 From: dean Date: Tue, 8 Nov 2022 18:01:40 +0800 Subject: [PATCH 07/30] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=B7=AF=E7=94=B1?= =?UTF-8?q?=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../thinkcmf/cmf/think/route/dispatch/Controller.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/vendor/thinkcmf/cmf/think/route/dispatch/Controller.php b/vendor/thinkcmf/cmf/think/route/dispatch/Controller.php index 25edc6ac2..3cabaee7a 100644 --- a/vendor/thinkcmf/cmf/think/route/dispatch/Controller.php +++ b/vendor/thinkcmf/cmf/think/route/dispatch/Controller.php @@ -49,7 +49,15 @@ class Controller extends Dispatch } // 获取应用名 - $appName = $result[0] ?: config('app.default_app'); + if (empty($result[0])) { + $appName = config('app.default_app'); + } else { + if ($result[0] == 'index.php') { + $appName = config('app.default_app'); + } else { + $appName = $result[0]; + } + } // 获取控制器名 $controller = strip_tags($result[1] ?: $this->rule->config('default_controller')); -- Gitee From c8536c2740ca2c22e691ed708ddc8e2fc931c729 Mon Sep 17 00:00:00 2001 From: dean Date: Tue, 8 Nov 2022 18:01:59 +0800 Subject: [PATCH 08/30] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=AC=AC=E4=B8=89?= =?UTF-8?q?=E6=96=B9=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AttrDef/HTML/ContentEditable.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/ContentEditable.php diff --git a/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/ContentEditable.php b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/ContentEditable.php new file mode 100644 index 000000000..5b03d3e37 --- /dev/null +++ b/vendor/ezyang/htmlpurifier/library/HTMLPurifier/AttrDef/HTML/ContentEditable.php @@ -0,0 +1,16 @@ +get('HTML.Trusted')) { + $allowed = array('', 'true', 'false'); + } + + $enum = new HTMLPurifier_AttrDef_Enum($allowed); + + return $enum->validate($string, $config, $context); + } +} -- Gitee From c074f710cdf89c0a667e00d7fe185162dea751ac Mon Sep 17 00:00:00 2001 From: dean Date: Mon, 12 Dec 2022 13:40:43 +0800 Subject: [PATCH 09/30] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E7=AC=AC=E4=B8=89?= =?UTF-8?q?=E6=96=B9=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- composer.lock | 22 ++++--- vendor/composer/autoload_psr4.php | 2 +- vendor/composer/autoload_static.php | 6 +- vendor/composer/installed.json | 24 +++---- vendor/composer/installed.php | 6 +- vendor/phpmailer/phpmailer/README.md | 22 +++---- vendor/phpmailer/phpmailer/VERSION | 2 +- vendor/phpmailer/phpmailer/composer.json | 10 +-- .../phpmailer/phpmailer/get_oauth_token.php | 20 ++++++ .../phpmailer/language/phpmailer.lang-es.php | 4 ++ vendor/phpmailer/phpmailer/src/PHPMailer.php | 62 +++++++++++++++---- vendor/phpmailer/phpmailer/src/POP3.php | 9 ++- vendor/phpmailer/phpmailer/src/SMTP.php | 2 +- vendor/services.php | 2 +- 14 files changed, 133 insertions(+), 60 deletions(-) diff --git a/composer.lock b/composer.lock index 193598587..0eff44529 100644 --- a/composer.lock +++ b/composer.lock @@ -415,16 +415,16 @@ }, { "name": "phpmailer/phpmailer", - "version": "v6.6.5", + "version": "v6.7.1", "source": { "type": "git", "url": "https://github.com/PHPMailer/PHPMailer.git", - "reference": "8b6386d7417526d1ea4da9edb70b8352f7543627" + "reference": "49cd7ea3d2563f028d7811f06864a53b1f15ff55" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/8b6386d7417526d1ea4da9edb70b8352f7543627", - "reference": "8b6386d7417526d1ea4da9edb70b8352f7543627", + "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/49cd7ea3d2563f028d7811f06864a53b1f15ff55", + "reference": "49cd7ea3d2563f028d7811f06864a53b1f15ff55", "shasum": "" }, "require": { @@ -434,17 +434,19 @@ "php": ">=5.5.0" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", - "doctrine/annotations": "^1.2", + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.2", + "doctrine/annotations": "^1.2.6 || ^1.13.3", "php-parallel-lint/php-console-highlighter": "^1.0.0", "php-parallel-lint/php-parallel-lint": "^1.3.2", "phpcompatibility/php-compatibility": "^9.3.5", "roave/security-advisories": "dev-latest", - "squizlabs/php_codesniffer": "^3.6.2", - "yoast/phpunit-polyfills": "^1.0.0" + "squizlabs/php_codesniffer": "^3.7.1", + "yoast/phpunit-polyfills": "^1.0.4" }, "suggest": { "ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses", + "ext-openssl": "Needed for secure SMTP sending and DKIM signing", + "greew/oauth2-azure-provider": "Needed for Microsoft Azure XOAUTH2 authentication", "hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication", "league/oauth2-google": "Needed for Google XOAUTH2 authentication", "psr/log": "For optional PSR-3 debug logging", @@ -481,7 +483,7 @@ "description": "PHPMailer is a full-featured email creation and transfer class for PHP", "support": { "issues": "https://github.com/PHPMailer/PHPMailer/issues", - "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.6.5" + "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.7.1" }, "funding": [ { @@ -489,7 +491,7 @@ "type": "github" } ], - "time": "2022-10-07T12:23:10+00:00" + "time": "2022-12-08T13:30:06+00:00" }, { "name": "psr/cache", diff --git a/vendor/composer/autoload_psr4.php b/vendor/composer/autoload_psr4.php index 27e5bc9f8..2ec2895e0 100644 --- a/vendor/composer/autoload_psr4.php +++ b/vendor/composer/autoload_psr4.php @@ -11,7 +11,7 @@ return array( 'think\\trace\\' => array($vendorDir . '/topthink/think-trace/src'), 'think\\migration\\' => array($vendorDir . '/xia/migration/src'), 'think\\captcha\\' => array($vendorDir . '/thinkcmf/cmf-captcha/src'), - 'think\\' => array($vendorDir . '/thinkcmf/cmf/think', $vendorDir . '/topthink/think-helper/src', $vendorDir . '/topthink/think-orm/src', $vendorDir . '/topthink/framework/src/think'), + 'think\\' => array($vendorDir . '/thinkcmf/cmf/think', $vendorDir . '/topthink/framework/src/think', $vendorDir . '/topthink/think-helper/src', $vendorDir . '/topthink/think-orm/src'), 'themes\\' => array($baseDir . '/public/themes'), 'plugins\\' => array($baseDir . '/public/plugins'), 'mindplay\\annotations\\' => array($vendorDir . '/mindplay/annotations/src/annotations'), diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index e009cea41..016fc2359 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -92,9 +92,9 @@ class ComposerStaticInit409e436a19c882513f3c7d0ffdfd059f 'think\\' => array ( 0 => __DIR__ . '/..' . '/thinkcmf/cmf/think', - 1 => __DIR__ . '/..' . '/topthink/think-helper/src', - 2 => __DIR__ . '/..' . '/topthink/think-orm/src', - 3 => __DIR__ . '/..' . '/topthink/framework/src/think', + 1 => __DIR__ . '/..' . '/topthink/framework/src/think', + 2 => __DIR__ . '/..' . '/topthink/think-helper/src', + 3 => __DIR__ . '/..' . '/topthink/think-orm/src', ), 'themes\\' => array ( diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index f7f1dad61..3f5f4cd93 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -430,17 +430,17 @@ }, { "name": "phpmailer/phpmailer", - "version": "v6.6.5", - "version_normalized": "6.6.5.0", + "version": "v6.7.1", + "version_normalized": "6.7.1.0", "source": { "type": "git", "url": "https://github.com/PHPMailer/PHPMailer.git", - "reference": "8b6386d7417526d1ea4da9edb70b8352f7543627" + "reference": "49cd7ea3d2563f028d7811f06864a53b1f15ff55" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/8b6386d7417526d1ea4da9edb70b8352f7543627", - "reference": "8b6386d7417526d1ea4da9edb70b8352f7543627", + "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/49cd7ea3d2563f028d7811f06864a53b1f15ff55", + "reference": "49cd7ea3d2563f028d7811f06864a53b1f15ff55", "shasum": "" }, "require": { @@ -450,24 +450,26 @@ "php": ">=5.5.0" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", - "doctrine/annotations": "^1.2", + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.2", + "doctrine/annotations": "^1.2.6 || ^1.13.3", "php-parallel-lint/php-console-highlighter": "^1.0.0", "php-parallel-lint/php-parallel-lint": "^1.3.2", "phpcompatibility/php-compatibility": "^9.3.5", "roave/security-advisories": "dev-latest", - "squizlabs/php_codesniffer": "^3.6.2", - "yoast/phpunit-polyfills": "^1.0.0" + "squizlabs/php_codesniffer": "^3.7.1", + "yoast/phpunit-polyfills": "^1.0.4" }, "suggest": { "ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses", + "ext-openssl": "Needed for secure SMTP sending and DKIM signing", + "greew/oauth2-azure-provider": "Needed for Microsoft Azure XOAUTH2 authentication", "hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication", "league/oauth2-google": "Needed for Google XOAUTH2 authentication", "psr/log": "For optional PSR-3 debug logging", "symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)", "thenetworg/oauth2-azure": "Needed for Microsoft XOAUTH2 authentication" }, - "time": "2022-10-07T12:23:10+00:00", + "time": "2022-12-08T13:30:06+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -499,7 +501,7 @@ "description": "PHPMailer is a full-featured email creation and transfer class for PHP", "support": { "issues": "https://github.com/PHPMailer/PHPMailer/issues", - "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.6.5" + "source": "https://github.com/PHPMailer/PHPMailer/tree/v6.7.1" }, "funding": [ { diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 17711ac84..b682cf353 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -80,12 +80,12 @@ ), ), 'phpmailer/phpmailer' => array( - 'pretty_version' => 'v6.6.5', - 'version' => '6.6.5.0', + 'pretty_version' => 'v6.7.1', + 'version' => '6.7.1.0', 'type' => 'library', 'install_path' => __DIR__ . '/../phpmailer/phpmailer', 'aliases' => array(), - 'reference' => '8b6386d7417526d1ea4da9edb70b8352f7543627', + 'reference' => '49cd7ea3d2563f028d7811f06864a53b1f15ff55', 'dev_requirement' => false, ), 'psr/cache' => array( diff --git a/vendor/phpmailer/phpmailer/README.md b/vendor/phpmailer/phpmailer/README.md index 56f971a49..3bba8262c 100644 --- a/vendor/phpmailer/phpmailer/README.md +++ b/vendor/phpmailer/phpmailer/README.md @@ -16,7 +16,7 @@ - Probably the world's most popular code for sending email from PHP! - Used by many open-source projects: WordPress, Drupal, 1CRM, SugarCRM, Yii, Joomla! and many more - Integrated SMTP support – send without a local mail server -- Send emails with multiple To, CC, BCC and Reply-to addresses +- Send emails with multiple To, CC, BCC, and Reply-to addresses - Multipart/alternative emails for mail clients that do not read HTML email - Add attachments, including inline - Support for UTF-8 content and 8bit, base64, binary, and quoted-printable encodings @@ -25,7 +25,7 @@ - Protects against header injection attacks - Error messages in over 50 languages! - DKIM and S/MIME signing support -- Compatible with PHP 5.5 and later, including PHP 8.1 +- Compatible with PHP 5.5 and later, including PHP 8.2 - Namespaced to prevent name clashes - Much more! @@ -38,7 +38,7 @@ The PHP `mail()` function usually sends via a local mail server, typically front *Please* don't be tempted to do it yourself – if you don't use PHPMailer, there are many other excellent libraries that you should look at before rolling your own. Try [SwiftMailer](https://swiftmailer.symfony.com/) -, [Laminas/Mail](https://docs.laminas.dev/laminas-mail/), [ZetaComponents](https://github.com/zetacomponents/Mail) etc. +, [Laminas/Mail](https://docs.laminas.dev/laminas-mail/), [ZetaComponents](https://github.com/zetacomponents/Mail), etc. ## License This software is distributed under the [LGPL 2.1](http://www.gnu.org/licenses/lgpl-2.1.html) license, along with the [GPL Cooperation Commitment](https://gplcc.github.io/gplcc/). Please read [LICENSE](https://github.com/PHPMailer/PHPMailer/blob/master/LICENSE) for information on the software availability and distribution. @@ -47,7 +47,7 @@ This software is distributed under the [LGPL 2.1](http://www.gnu.org/licenses/lg PHPMailer is available on [Packagist](https://packagist.org/packages/phpmailer/phpmailer) (using semantic versioning), and installation via [Composer](https://getcomposer.org) is the recommended way to install PHPMailer. Just add this line to your `composer.json` file: ```json -"phpmailer/phpmailer": "^6.5" +"phpmailer/phpmailer": "^6.7.1" ``` or run @@ -136,14 +136,14 @@ try { } ``` -You'll find plenty to play with in the [examples](https://github.com/PHPMailer/PHPMailer/tree/master/examples) folder, which covers many common scenarios including sending through gmail, building contact forms, sending to mailing lists, and more. +You'll find plenty to play with in the [examples](https://github.com/PHPMailer/PHPMailer/tree/master/examples) folder, which covers many common scenarios including sending through Gmail, building contact forms, sending to mailing lists, and more. If you are re-using the instance (e.g. when sending to a mailing list), you may need to clear the recipient list to avoid sending duplicate messages. See [the mailing list example](https://github.com/PHPMailer/PHPMailer/blob/master/examples/mailing_list.phps) for further guidance. That's it. You should now be ready to use PHPMailer! ## Localization -PHPMailer defaults to English, but in the [language](https://github.com/PHPMailer/PHPMailer/tree/master/language/) folder you'll find many translations for PHPMailer error messages that you may encounter. Their filenames contain [ISO 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the translations, for example `fr` for French. To specify a language, you need to tell PHPMailer which one to use, like this: +PHPMailer defaults to English, but in the [language](https://github.com/PHPMailer/PHPMailer/tree/master/language/) folder, you'll find many translations for PHPMailer error messages that you may encounter. Their filenames contain [ISO 639-1](http://en.wikipedia.org/wiki/ISO_639-1) language code for the translations, for example `fr` for French. To specify a language, you need to tell PHPMailer which one to use, like this: ```php //To load the French version @@ -178,9 +178,9 @@ Please disclose any vulnerabilities found responsibly – report security issues See [SECURITY](https://github.com/PHPMailer/PHPMailer/tree/master/SECURITY.md) and [PHPMailer's security advisories on GitHub](https://github.com/PHPMailer/PHPMailer/security). ## Contributing -Please submit bug reports, suggestions and pull requests to the [GitHub issue tracker](https://github.com/PHPMailer/PHPMailer/issues). +Please submit bug reports, suggestions, and pull requests to the [GitHub issue tracker](https://github.com/PHPMailer/PHPMailer/issues). -We're particularly interested in fixing edge-cases, expanding test coverage and updating translations. +We're particularly interested in fixing edge cases, expanding test coverage, and updating translations. If you found a mistake in the docs, or want to add something, go ahead and amend the wiki – anyone can edit it. @@ -204,7 +204,7 @@ Donations are very welcome, whether in beer 🍺, T-shirts 👕, or cold, hard c Available as part of the Tidelift Subscription. The maintainers of PHPMailer and thousands of other packages are working with Tidelift to deliver commercial -support and maintenance for the open source packages you use to build your applications. Save time, reduce risk, and +support and maintenance for the open-source packages you use to build your applications. Save time, reduce risk, and improve code health, while paying the maintainers of the exact packages you use. [Learn more.](https://tidelift.com/subscription/pkg/packagist-phpmailer-phpmailer?utm_source=packagist-phpmailer-phpmailer&utm_medium=referral&utm_campaign=enterprise&utm_term=repo) @@ -222,9 +222,9 @@ See [changelog](changelog.md). ### What's changed since moving from SourceForge? - Official successor to the SourceForge and Google Code projects. - Test suite. -- Continuous integration with Github Actions. +- Continuous integration with GitHub Actions. - Composer support. - Public development. - Additional languages and language strings. - CRAM-MD5 authentication support. -- Preserves full repo history of authors, commits and branches from the original SourceForge project. +- Preserves full repo history of authors, commits, and branches from the original SourceForge project. diff --git a/vendor/phpmailer/phpmailer/VERSION b/vendor/phpmailer/phpmailer/VERSION index 653877f1f..1d4202426 100644 --- a/vendor/phpmailer/phpmailer/VERSION +++ b/vendor/phpmailer/phpmailer/VERSION @@ -1 +1 @@ -6.6.5 \ No newline at end of file +6.7.1 \ No newline at end of file diff --git a/vendor/phpmailer/phpmailer/composer.json b/vendor/phpmailer/phpmailer/composer.json index 9275fab48..37e3d6e70 100644 --- a/vendor/phpmailer/phpmailer/composer.json +++ b/vendor/phpmailer/phpmailer/composer.json @@ -37,17 +37,19 @@ "ext-hash": "*" }, "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", - "doctrine/annotations": "^1.2", + "dealerdirect/phpcodesniffer-composer-installer": "^0.7.2", + "doctrine/annotations": "^1.2.6 || ^1.13.3", "php-parallel-lint/php-console-highlighter": "^1.0.0", "php-parallel-lint/php-parallel-lint": "^1.3.2", "phpcompatibility/php-compatibility": "^9.3.5", "roave/security-advisories": "dev-latest", - "squizlabs/php_codesniffer": "^3.6.2", - "yoast/phpunit-polyfills": "^1.0.0" + "squizlabs/php_codesniffer": "^3.7.1", + "yoast/phpunit-polyfills": "^1.0.4" }, "suggest": { "ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses", + "ext-openssl": "Needed for secure SMTP sending and DKIM signing", + "greew/oauth2-azure-provider": "Needed for Microsoft Azure XOAUTH2 authentication", "hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication", "league/oauth2-google": "Needed for Google XOAUTH2 authentication", "psr/log": "For optional PSR-3 debug logging", diff --git a/vendor/phpmailer/phpmailer/get_oauth_token.php b/vendor/phpmailer/phpmailer/get_oauth_token.php index ba66f6cae..cda0445c6 100644 --- a/vendor/phpmailer/phpmailer/get_oauth_token.php +++ b/vendor/phpmailer/phpmailer/get_oauth_token.php @@ -44,6 +44,8 @@ use League\OAuth2\Client\Provider\Google; use Hayageek\OAuth2\Client\Provider\Yahoo; //@see https://github.com/stevenmaguire/oauth2-microsoft use Stevenmaguire\OAuth2\Client\Provider\Microsoft; +//@see https://github.com/greew/oauth2-azure-provider +use Greew\OAuth2\Client\Provider\Azure; if (!isset($_GET['code']) && !isset($_POST['provider'])) { ?> @@ -57,11 +59,14 @@ if (!isset($_GET['code']) && !isset($_POST['provider'])) {

+ +

Enter id and secret

These details are obtained by setting up an app in your provider's developer console.

ClientId:

ClientSecret:

+

TenantID (only relevant for Azure):

@@ -77,18 +82,22 @@ session_start(); $providerName = ''; $clientId = ''; $clientSecret = ''; +$tenantId = ''; if (array_key_exists('provider', $_POST)) { $providerName = $_POST['provider']; $clientId = $_POST['clientId']; $clientSecret = $_POST['clientSecret']; + $tenantId = $_POST['tenantId']; $_SESSION['provider'] = $providerName; $_SESSION['clientId'] = $clientId; $_SESSION['clientSecret'] = $clientSecret; + $_SESSION['tenantId'] = $tenantId; } elseif (array_key_exists('provider', $_SESSION)) { $providerName = $_SESSION['provider']; $clientId = $_SESSION['clientId']; $clientSecret = $_SESSION['clientSecret']; + $tenantId = $_SESSION['tenantId']; } //If you don't want to use the built-in form, set your client id and secret here @@ -130,6 +139,17 @@ switch ($providerName) { ] ]; break; + case 'Azure': + $params['tenantId'] = $tenantId; + + $provider = new Azure($params); + $options = [ + 'scope' => [ + 'https://outlook.office.com/SMTP.Send', + 'offline_access' + ] + ]; + break; } if (null === $provider) { diff --git a/vendor/phpmailer/phpmailer/language/phpmailer.lang-es.php b/vendor/phpmailer/phpmailer/language/phpmailer.lang-es.php index 6ba746273..699204187 100644 --- a/vendor/phpmailer/phpmailer/language/phpmailer.lang-es.php +++ b/vendor/phpmailer/phpmailer/language/phpmailer.lang-es.php @@ -4,6 +4,7 @@ * Spanish PHPMailer language file: refer to English translation for definitive list * @package PHPMailer * @author Matt Sturdy + * @author Crystopher Glodzienski Cardoso */ $PHPMAILER_LANG['authenticate'] = 'Error SMTP: Imposible autentificar.'; @@ -25,3 +26,6 @@ $PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() falló.'; $PHPMAILER_LANG['smtp_error'] = 'Error del servidor SMTP: '; $PHPMAILER_LANG['variable_set'] = 'No se pudo configurar la variable: '; $PHPMAILER_LANG['extension_missing'] = 'Extensión faltante: '; +$PHPMAILER_LANG['smtp_code'] = 'Código del servidor SMTP: '; +$PHPMAILER_LANG['smtp_code_ex'] = 'Información adicional del servidor SMTP: '; +$PHPMAILER_LANG['invalid_header'] = 'Nombre o valor de encabezado no válido'; diff --git a/vendor/phpmailer/phpmailer/src/PHPMailer.php b/vendor/phpmailer/phpmailer/src/PHPMailer.php index 7e6c88ff1..e14cdbf57 100644 --- a/vendor/phpmailer/phpmailer/src/PHPMailer.php +++ b/vendor/phpmailer/phpmailer/src/PHPMailer.php @@ -750,7 +750,7 @@ class PHPMailer * * @var string */ - const VERSION = '6.6.5'; + const VERSION = '6.7.1'; /** * Error severity: message only, continue processing. @@ -858,7 +858,7 @@ class PHPMailer private function mailPassthru($to, $subject, $body, $header, $params) { //Check overloading of mail function to avoid double-encoding - if (ini_get('mbstring.func_overload') & 1) { + if ((int)ini_get('mbstring.func_overload') & 1) { $subject = $this->secureHeader($subject); } else { $subject = $this->encodeHeader($this->secureHeader($subject)); @@ -1124,6 +1124,22 @@ class PHPMailer return call_user_func_array([$this, 'addAnAddress'], $params); } + /** + * Set the boundaries to use for delimiting MIME parts. + * If you override this, ensure you set all 3 boundaries to unique values. + * The default boundaries include a "=_" sequence which cannot occur in quoted-printable bodies, + * as suggested by https://www.rfc-editor.org/rfc/rfc2045#section-6.7 + * + * @return void + */ + public function setBoundaries() + { + $this->uniqueid = $this->generateId(); + $this->boundary[1] = 'b1=_' . $this->uniqueid; + $this->boundary[2] = 'b2=_' . $this->uniqueid; + $this->boundary[3] = 'b3=_' . $this->uniqueid; + } + /** * Add an address to one of the recipient arrays or to the ReplyTo array. * Addresses that have been added already return false, but do not throw exceptions. @@ -1671,11 +1687,11 @@ class PHPMailer return $this->mailSend($this->MIMEHeader, $this->MIMEBody); } } catch (Exception $exc) { + $this->setError($exc->getMessage()); + $this->edebug($exc->getMessage()); if ($this->Mailer === 'smtp' && $this->SMTPKeepAlive == true && $this->smtp->connected()) { $this->smtp->reset(); } - $this->setError($exc->getMessage()); - $this->edebug($exc->getMessage()); if ($this->exceptions) { throw $exc; } @@ -2794,10 +2810,7 @@ class PHPMailer { $body = ''; //Create unique IDs and preset boundaries - $this->uniqueid = $this->generateId(); - $this->boundary[1] = 'b1_' . $this->uniqueid; - $this->boundary[2] = 'b2_' . $this->uniqueid; - $this->boundary[3] = 'b3_' . $this->uniqueid; + $this->setBoundaries(); if ($this->sign_key_file) { $body .= $this->getMailMIME() . static::$LE; @@ -2833,7 +2846,7 @@ class PHPMailer $altBodyEncoding = static::ENCODING_QUOTED_PRINTABLE; } //Use this as a preamble in all multipart message types - $mimepre = 'This is a multi-part message in MIME format.' . static::$LE . static::$LE; + $mimepre = ''; switch ($this->message_type) { case 'inline': $body .= $mimepre; @@ -3069,6 +3082,18 @@ class PHPMailer return $body; } + /** + * Get the boundaries that this message will use + * @return array + */ + public function getBoundaries() + { + if (empty($this->boundary)) { + $this->setBoundaries(); + } + return $this->boundary; + } + /** * Return the start of a message boundary. * @@ -4186,6 +4211,7 @@ class PHPMailer * @param string $name Custom header name * @param string|null $value Header value * + * @return bool True if a header was set successfully * @throws Exception */ public function addCustomHeader($name, $value = null) @@ -4635,17 +4661,29 @@ class PHPMailer } /** - * Remove trailing breaks from a string. + * Remove trailing whitespace from a string. * * @param string $text * - * @return string The text to remove breaks from + * @return string The text to remove whitespace from */ public static function stripTrailingWSP($text) { return rtrim($text, " \r\n\t"); } + /** + * Strip trailing line breaks from a string. + * + * @param string $text + * + * @return string The text to remove breaks from + */ + public static function stripTrailingBreaks($text) + { + return rtrim($text, "\r\n"); + } + /** * Return the current line break format string. * @@ -4809,7 +4847,7 @@ class PHPMailer $body = static::normalizeBreaks($body, self::CRLF); //Reduce multiple trailing line breaks to a single one - return static::stripTrailingWSP($body) . self::CRLF; + return static::stripTrailingBreaks($body) . self::CRLF; } /** diff --git a/vendor/phpmailer/phpmailer/src/POP3.php b/vendor/phpmailer/phpmailer/src/POP3.php index a3c9f4532..4ae52fb19 100644 --- a/vendor/phpmailer/phpmailer/src/POP3.php +++ b/vendor/phpmailer/phpmailer/src/POP3.php @@ -46,7 +46,7 @@ class POP3 * * @var string */ - const VERSION = '6.6.5'; + const VERSION = '6.7.1'; /** * Default POP3 port number. @@ -337,7 +337,12 @@ class POP3 */ public function disconnect() { - $this->sendString('QUIT'); + // If could not connect at all, no need to disconnect + if ($this->pop_conn === false) { + return; + } + + $this->sendString('QUIT' . static::LE); // RFC 1939 shows POP3 server sending a +OK response to the QUIT command. // Try to get it. Ignore any failures here. diff --git a/vendor/phpmailer/phpmailer/src/SMTP.php b/vendor/phpmailer/phpmailer/src/SMTP.php index 312f753ce..95b0d0bb4 100644 --- a/vendor/phpmailer/phpmailer/src/SMTP.php +++ b/vendor/phpmailer/phpmailer/src/SMTP.php @@ -35,7 +35,7 @@ class SMTP * * @var string */ - const VERSION = '6.6.5'; + const VERSION = '6.7.1'; /** * SMTP line break constant. diff --git a/vendor/services.php b/vendor/services.php index 377b4dde4..bace6cd13 100644 --- a/vendor/services.php +++ b/vendor/services.php @@ -1,5 +1,5 @@ 'app\\admin\\AppStoreService', -- Gitee From 6d984c1fa38e6223acd1558e285d26cc3a22371b Mon Sep 17 00:00:00 2001 From: dean Date: Tue, 20 Dec 2022 16:52:44 +0800 Subject: [PATCH 10/30] =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=90=8E=E5=8F=B0?= =?UTF-8?q?=E5=88=B7=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/themes/admin_simpleboot3/admin/index/index.html | 1 + 1 file changed, 1 insertion(+) diff --git a/public/themes/admin_simpleboot3/admin/index/index.html b/public/themes/admin_simpleboot3/admin/index/index.html index ff7554e2d..616c06fcf 100644 --- a/public/themes/admin_simpleboot3/admin/index/index.html +++ b/public/themes/admin_simpleboot3/admin/index/index.html @@ -366,6 +366,7 @@ //去掉/ 去掉_ 全部小写。 urlTmp = urlTmp.replace(/[\\/|_|]/g,""); urlTmp = urlTmp.replace(".html",""); + urlTmp = urlTmp.toLowerCase(); var menu = menus[urlTmp]; if (menu){ openapp(url,menu.id+menu.app,menu.name,true); -- Gitee From 6370587f782497659e396931c24e409eba8f3e11 Mon Sep 17 00:00:00 2001 From: dean Date: Thu, 22 Dec 2022 22:32:48 +0800 Subject: [PATCH 11/30] =?UTF-8?q?cli=E5=8A=A0=E8=BD=BD=E5=BA=94=E7=94=A8?= =?UTF-8?q?=E7=AC=AC=E4=B8=89=E6=96=B9=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vendor/thinkcmf/cmf/src/console/command/Cli.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/vendor/thinkcmf/cmf/src/console/command/Cli.php b/vendor/thinkcmf/cmf/src/console/command/Cli.php index 97c6c5720..71f50cfc0 100644 --- a/vendor/thinkcmf/cmf/src/console/command/Cli.php +++ b/vendor/thinkcmf/cmf/src/console/command/Cli.php @@ -96,9 +96,15 @@ EOT; if ($countUrl == 3) { $controller = cmf_parse_name($urlArr[1], 1); $action = $urlArr[2]; - $class = "app\\{$urlArr[0]}\\cli\\{$controller}Cli"; + $appName = $urlArr[0]; + $class = "app\\{$appName}\\cli\\{$controller}Cli"; if (class_exists($class)) { + // 加载应用第三方库 + $appAutoLoadFile = $this->app->getAppPath() . $appName . '/vendor/autoload.php'; + if (file_exists($appAutoLoadFile)) { + require_once $appAutoLoadFile; + } if (method_exists($class, $action)) { $object = new $class(); if ($isHelp) { -- Gitee From 471af229412a38ce176eae960b04bcfae61fe7f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=94=E4=BA=94?= <15093565100@163.com> Date: Mon, 9 Jan 2023 17:19:00 +0800 Subject: [PATCH 12/30] =?UTF-8?q?fix=20#I68BBR=20php=208.2=20=E5=8A=A8?= =?UTF-8?q?=E6=80=81=E5=B1=9E=E6=80=A7=20=E5=85=BC=E5=AE=B9=20#[\AllowDyna?= =?UTF-8?q?micProperties]=20https://gitee.com/thinkcmf/ThinkCMF/issues/I68?= =?UTF-8?q?BBR?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../cmf-app/src/admin/service/impl/AdminMenuServiceImpl.php | 1 + vendor/thinkcmf/cmf/src/listener/InitHookListener.php | 1 + vendor/thinkcmf/cmf/src/listener/ModuleInitListener.php | 1 + 3 files changed, 3 insertions(+) diff --git a/vendor/thinkcmf/cmf-app/src/admin/service/impl/AdminMenuServiceImpl.php b/vendor/thinkcmf/cmf-app/src/admin/service/impl/AdminMenuServiceImpl.php index 14ba2edc2..10a828b2d 100644 --- a/vendor/thinkcmf/cmf-app/src/admin/service/impl/AdminMenuServiceImpl.php +++ b/vendor/thinkcmf/cmf-app/src/admin/service/impl/AdminMenuServiceImpl.php @@ -15,6 +15,7 @@ namespace app\admin\service\impl; use app\admin\model\AdminMenuModel; use app\admin\service\AdminMenuService; +#[\AllowDynamicProperties] class AdminMenuServiceImpl implements AdminMenuService { public function __construct(AdminMenuModel $model) diff --git a/vendor/thinkcmf/cmf/src/listener/InitHookListener.php b/vendor/thinkcmf/cmf/src/listener/InitHookListener.php index eea08d55f..8157ed84c 100755 --- a/vendor/thinkcmf/cmf/src/listener/InitHookListener.php +++ b/vendor/thinkcmf/cmf/src/listener/InitHookListener.php @@ -17,6 +17,7 @@ use think\facade\Db; use think\facade\Response; use think\facade\Route; +#[\AllowDynamicProperties] class InitHookListener { diff --git a/vendor/thinkcmf/cmf/src/listener/ModuleInitListener.php b/vendor/thinkcmf/cmf/src/listener/ModuleInitListener.php index ba3eeaf69..b0db72813 100644 --- a/vendor/thinkcmf/cmf/src/listener/ModuleInitListener.php +++ b/vendor/thinkcmf/cmf/src/listener/ModuleInitListener.php @@ -17,6 +17,7 @@ use think\facade\Event; use think\facade\Response; use think\facade\Route; +#[\AllowDynamicProperties] class ModuleInitListener { // 行为扩展的执行入口必须是run -- Gitee From 99ba8bb457016d8e3a7434c38f0b65465404b17f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=94=E4=BA=94?= <15093565100@163.com> Date: Mon, 30 Jan 2023 17:25:21 +0800 Subject: [PATCH 13/30] =?UTF-8?q?=E4=B8=AD=E9=97=B4=E4=BB=B6=E5=8A=A0?= =?UTF-8?q?=E8=BD=BD=20include=20=20to=20include=5Fonce?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vendor/thinkcmf/cmf/think/Http.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vendor/thinkcmf/cmf/think/Http.php b/vendor/thinkcmf/cmf/think/Http.php index 886f1864f..51e6676ae 100644 --- a/vendor/thinkcmf/cmf/think/Http.php +++ b/vendor/thinkcmf/cmf/think/Http.php @@ -223,7 +223,7 @@ class Http protected function loadMiddleware(): void { if (is_file($this->app->getBasePath() . 'middleware.php')) { - $this->app->middleware->import(include $this->app->getBasePath() . 'middleware.php'); + $this->app->middleware->import(include_once $this->app->getBasePath() . 'middleware.php'); } $appRootNamespace = $this->app->getRootNamespace(); @@ -231,7 +231,7 @@ class Http $vendorMiddlewareFile = "{$rootPath}vendor/thinkcmf/cmf-{$appRootNamespace}/src/middleware.php"; if (is_file($vendorMiddlewareFile)) { - $this->app->middleware->import(include $vendorMiddlewareFile); + $this->app->middleware->import(include_once $vendorMiddlewareFile); } } @@ -252,7 +252,7 @@ class Http if (is_dir($routePath)) { $files = glob($routePath . '*.php'); foreach ($files as $file) { - include $file; + include_once $file; } } @@ -262,7 +262,7 @@ class Http if (is_dir($routePath)) { $files = glob($routePath . '*.php'); foreach ($files as $file) { - include $file; + include_once $file; } } } -- Gitee From 9d6621e0868940abbc74bd74fdb988d9b2298d71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=94=E4=BA=94?= <15093565100@163.com> Date: Tue, 31 Jan 2023 13:06:56 +0800 Subject: [PATCH 14/30] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20=E7=A1=AE=E5=AE=9E?= =?UTF-8?q?=E6=98=AF=20=E7=94=A8=E6=88=B7=E6=93=8D=E4=BD=9C=E8=AF=AD?= =?UTF-8?q?=E8=A8=80=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vendor/thinkcmf/cmf-app/src/admin/lang/en-us/user_menu.php | 5 +++++ vendor/thinkcmf/cmf-app/src/admin/lang/zh-cn/user_menu.php | 5 +++++ 2 files changed, 10 insertions(+) create mode 100644 vendor/thinkcmf/cmf-app/src/admin/lang/en-us/user_menu.php create mode 100644 vendor/thinkcmf/cmf-app/src/admin/lang/zh-cn/user_menu.php diff --git a/vendor/thinkcmf/cmf-app/src/admin/lang/en-us/user_menu.php b/vendor/thinkcmf/cmf-app/src/admin/lang/en-us/user_menu.php new file mode 100644 index 000000000..afb51cc35 --- /dev/null +++ b/vendor/thinkcmf/cmf-app/src/admin/lang/en-us/user_menu.php @@ -0,0 +1,5 @@ + 'User Operation Management', + 'USER_ADMINUSERACTION_SYNC' => 'User Action Synchronization' +]; \ No newline at end of file diff --git a/vendor/thinkcmf/cmf-app/src/admin/lang/zh-cn/user_menu.php b/vendor/thinkcmf/cmf-app/src/admin/lang/zh-cn/user_menu.php new file mode 100644 index 000000000..9cf60d872 --- /dev/null +++ b/vendor/thinkcmf/cmf-app/src/admin/lang/zh-cn/user_menu.php @@ -0,0 +1,5 @@ + '用户操作管理', + 'USER_ADMINUSERACTION_SYNC' => '用户操作同步' +]; \ No newline at end of file -- Gitee From 80e2e70efc00d2f85d2e4e9ab084314259791d56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=94=E4=BA=94?= <15093565100@163.com> Date: Tue, 31 Jan 2023 13:14:35 +0800 Subject: [PATCH 15/30] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20=E7=94=A8=E6=88=B7?= =?UTF-8?q?=E6=93=8D=E4=BD=9C=E7=9A=84=20=20=E8=AF=AD=E8=A8=80=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vendor/thinkcmf/cmf-app/src/admin/lang/en-us/user_menu.php | 5 ----- vendor/thinkcmf/cmf-app/src/admin/lang/zh-cn/user_menu.php | 5 ----- vendor/thinkcmf/cmf-app/src/user/lang/en-us/admin_menu.php | 2 ++ vendor/thinkcmf/cmf-app/src/user/lang/zh-cn/admin_menu.php | 2 ++ 4 files changed, 4 insertions(+), 10 deletions(-) delete mode 100644 vendor/thinkcmf/cmf-app/src/admin/lang/en-us/user_menu.php delete mode 100644 vendor/thinkcmf/cmf-app/src/admin/lang/zh-cn/user_menu.php diff --git a/vendor/thinkcmf/cmf-app/src/admin/lang/en-us/user_menu.php b/vendor/thinkcmf/cmf-app/src/admin/lang/en-us/user_menu.php deleted file mode 100644 index afb51cc35..000000000 --- a/vendor/thinkcmf/cmf-app/src/admin/lang/en-us/user_menu.php +++ /dev/null @@ -1,5 +0,0 @@ - 'User Operation Management', - 'USER_ADMINUSERACTION_SYNC' => 'User Action Synchronization' -]; \ No newline at end of file diff --git a/vendor/thinkcmf/cmf-app/src/admin/lang/zh-cn/user_menu.php b/vendor/thinkcmf/cmf-app/src/admin/lang/zh-cn/user_menu.php deleted file mode 100644 index 9cf60d872..000000000 --- a/vendor/thinkcmf/cmf-app/src/admin/lang/zh-cn/user_menu.php +++ /dev/null @@ -1,5 +0,0 @@ - '用户操作管理', - 'USER_ADMINUSERACTION_SYNC' => '用户操作同步' -]; \ No newline at end of file diff --git a/vendor/thinkcmf/cmf-app/src/user/lang/en-us/admin_menu.php b/vendor/thinkcmf/cmf-app/src/user/lang/en-us/admin_menu.php index c91676076..275b288ca 100644 --- a/vendor/thinkcmf/cmf-app/src/user/lang/en-us/admin_menu.php +++ b/vendor/thinkcmf/cmf-app/src/user/lang/en-us/admin_menu.php @@ -18,4 +18,6 @@ return [ 'USER_OAUTHADMIN_INDEX' => 'Third Party Users', 'USER_INDEXADMIN_DEFAULT' => 'Users', 'USER_ADMINASSET_INDEX' => 'Assets', + 'USER_ADMINUSERACTION_INDEX' => 'User Operation Management', + 'USER_ADMINUSERACTION_SYNC' => 'User Action Synchronization' ]; diff --git a/vendor/thinkcmf/cmf-app/src/user/lang/zh-cn/admin_menu.php b/vendor/thinkcmf/cmf-app/src/user/lang/zh-cn/admin_menu.php index 5b0513c39..66982eecc 100644 --- a/vendor/thinkcmf/cmf-app/src/user/lang/zh-cn/admin_menu.php +++ b/vendor/thinkcmf/cmf-app/src/user/lang/zh-cn/admin_menu.php @@ -18,4 +18,6 @@ return [ 'USER_OAUTHADMIN_INDEX' => '第三方用户', 'USER_INDEXADMIN_DEFAULT' => '用户管理', 'USER_ADMINASSET_INDEX' => '资源管理', + 'USER_ADMINUSERACTION_INDEX' => '用户操作管理', + 'USER_ADMINUSERACTION_SYNC' => '用户操作同步' ]; -- Gitee From b35bdefa83d09933db045a4de409577c9fcac45d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=94=E4=BA=94?= <15093565100@163.com> Date: Tue, 31 Jan 2023 13:18:36 +0800 Subject: [PATCH 16/30] =?UTF-8?q?=E7=94=A8=E8=BF=87=E6=93=8D=E4=BD=9C=20?= =?UTF-8?q?=E5=90=8C=E6=AD=A5=E6=88=90=E5=8A=9F=E7=9A=84=20=20=E8=AF=AD?= =?UTF-8?q?=E8=A8=80=E5=8C=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../themes/admin_simpleboot3/user/admin_user_action/sync.html | 2 +- vendor/thinkcmf/cmf-app/src/user/lang/en-us.php | 1 + vendor/thinkcmf/cmf-app/src/user/lang/zh-cn.php | 3 ++- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/public/themes/admin_simpleboot3/user/admin_user_action/sync.html b/public/themes/admin_simpleboot3/user/admin_user_action/sync.html index 4becbc1ad..b3f804390 100644 --- a/public/themes/admin_simpleboot3/user/admin_user_action/sync.html +++ b/public/themes/admin_simpleboot3/user/admin_user_action/sync.html @@ -10,7 +10,7 @@
- {:lang('Success')}! + {:lang('SYNC_SUCCESS')}!
{:lang('CLOSE')} diff --git a/vendor/thinkcmf/cmf-app/src/user/lang/en-us.php b/vendor/thinkcmf/cmf-app/src/user/lang/en-us.php index eb779482c..7dbb21e2c 100644 --- a/vendor/thinkcmf/cmf-app/src/user/lang/en-us.php +++ b/vendor/thinkcmf/cmf-app/src/user/lang/en-us.php @@ -36,6 +36,7 @@ return [ 'CAPTCHA_REQUIRED' => '验证码不能为空!', 'USERNAME_OR_EMAIL' => '用户名或邮箱', 'LOGIN_SUCCESS' => 'Login success!', + 'SYNC_SUCCESS' => 'Sync success!', 'PASSWORD_NOT_RIGHT' => 'Your password is wrong!', 'CAPTCHA_NOT_RIGHT' => 'CAPTCHA is wrong!', 'USERNAME_NOT_EXIST' => '用户名不存在!', diff --git a/vendor/thinkcmf/cmf-app/src/user/lang/zh-cn.php b/vendor/thinkcmf/cmf-app/src/user/lang/zh-cn.php index 4e36966eb..d729d9ce2 100644 --- a/vendor/thinkcmf/cmf-app/src/user/lang/zh-cn.php +++ b/vendor/thinkcmf/cmf-app/src/user/lang/zh-cn.php @@ -36,6 +36,7 @@ return [ 'CAPTCHA_REQUIRED' => '验证码不能为空!', 'USERNAME_OR_EMAIL' => '用户名或邮箱', 'LOGIN_SUCCESS' => '登录成功!', + 'SYNC_SUCCESS' => '同步成功!', 'PASSWORD_NOT_RIGHT' => '密码错误!', 'CAPTCHA_NOT_RIGHT' => '验证码错误!', 'USERNAME_NOT_EXIST' => '用户名不存在!', @@ -64,6 +65,6 @@ return [ 'User ID' => '用户ID', 'UPLOAD_TYPE_SETTING_ERROR' => '上传文件类型配置错误!', 'Collection succeeded' => '收藏成功!', - 'No such user found'=>'查无此人!' + 'No such user found' => '查无此人!' ]; -- Gitee From 305a5d952477963d4bbc140c996360a708e0a610 Mon Sep 17 00:00:00 2001 From: dean Date: Thu, 9 Feb 2023 00:37:31 +0800 Subject: [PATCH 17/30] =?UTF-8?q?=E5=8D=87=E7=BA=A7=E7=AC=AC=E4=B8=89?= =?UTF-8?q?=E6=96=B9=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- composer.lock | 26 ++++++++-------- vendor/composer/installed.json | 30 +++++++++---------- vendor/composer/installed.php | 12 ++++---- vendor/services.php | 2 +- vendor/topthink/think-orm/src/DbManager.php | 10 +++++++ vendor/topthink/think-orm/src/Paginator.php | 13 ++++++++ .../think-orm/src/model/concern/TimeStamp.php | 2 +- .../think-orm/src/model/relation/MorphTo.php | 7 +++-- .../think-orm/src/model/relation/OneToOne.php | 18 +++++++++-- vendor/topthink/think-trace/composer.json | 2 +- 10 files changed, 80 insertions(+), 42 deletions(-) diff --git a/composer.lock b/composer.lock index 0eff44529..d63919ec0 100644 --- a/composer.lock +++ b/composer.lock @@ -1219,16 +1219,16 @@ }, { "name": "topthink/think-orm", - "version": "v2.0.55", + "version": "v2.0.56", "source": { "type": "git", "url": "https://github.com/top-think/think-orm.git", - "reference": "e1974a4c3b1b4c5b808fcc0863fc254e711dee13" + "reference": "75b8512736daaa056d511f42c15bed87c9f3605a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/top-think/think-orm/zipball/e1974a4c3b1b4c5b808fcc0863fc254e711dee13", - "reference": "e1974a4c3b1b4c5b808fcc0863fc254e711dee13", + "url": "https://api.github.com/repos/top-think/think-orm/zipball/75b8512736daaa056d511f42c15bed87c9f3605a", + "reference": "75b8512736daaa056d511f42c15bed87c9f3605a", "shasum": "" }, "require": { @@ -1268,9 +1268,9 @@ ], "support": { "issues": "https://github.com/top-think/think-orm/issues", - "source": "https://github.com/top-think/think-orm/tree/v2.0.55" + "source": "https://github.com/top-think/think-orm/tree/v2.0.56" }, - "time": "2022-09-27T14:18:43+00:00" + "time": "2022-12-15T02:52:53+00:00" }, { "name": "xia/migration", @@ -1324,21 +1324,21 @@ "packages-dev": [ { "name": "topthink/think-trace", - "version": "v1.5", + "version": "v1.6", "source": { "type": "git", "url": "https://github.com/top-think/think-trace.git", - "reference": "55027fd79abb744f32a3be8d9e1ccf873a3ca9b7" + "reference": "136cd5d97e8bdb780e4b5c1637c588ed7ca3e142" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/top-think/think-trace/zipball/55027fd79abb744f32a3be8d9e1ccf873a3ca9b7", - "reference": "55027fd79abb744f32a3be8d9e1ccf873a3ca9b7", + "url": "https://api.github.com/repos/top-think/think-trace/zipball/136cd5d97e8bdb780e4b5c1637c588ed7ca3e142", + "reference": "136cd5d97e8bdb780e4b5c1637c588ed7ca3e142", "shasum": "" }, "require": { "php": ">=7.1.0", - "topthink/framework": "^6.0" + "topthink/framework": "^6.0|^8.0" }, "type": "library", "extra": { @@ -1369,9 +1369,9 @@ "description": "thinkphp debug trace", "support": { "issues": "https://github.com/top-think/think-trace/issues", - "source": "https://github.com/top-think/think-trace/tree/v1.5" + "source": "https://github.com/top-think/think-trace/tree/v1.6" }, - "time": "2022-10-26T07:56:45+00:00" + "time": "2023-02-07T08:36:32+00:00" } ], "aliases": [], diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 3f5f4cd93..10dbf3a27 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -1282,17 +1282,17 @@ }, { "name": "topthink/think-orm", - "version": "v2.0.55", - "version_normalized": "2.0.55.0", + "version": "v2.0.56", + "version_normalized": "2.0.56.0", "source": { "type": "git", "url": "https://github.com/top-think/think-orm.git", - "reference": "e1974a4c3b1b4c5b808fcc0863fc254e711dee13" + "reference": "75b8512736daaa056d511f42c15bed87c9f3605a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/top-think/think-orm/zipball/e1974a4c3b1b4c5b808fcc0863fc254e711dee13", - "reference": "e1974a4c3b1b4c5b808fcc0863fc254e711dee13", + "url": "https://api.github.com/repos/top-think/think-orm/zipball/75b8512736daaa056d511f42c15bed87c9f3605a", + "reference": "75b8512736daaa056d511f42c15bed87c9f3605a", "shasum": "" }, "require": { @@ -1306,7 +1306,7 @@ "require-dev": { "phpunit/phpunit": "^7|^8|^9.5" }, - "time": "2022-09-27T14:18:43+00:00", + "time": "2022-12-15T02:52:53+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1334,30 +1334,30 @@ ], "support": { "issues": "https://github.com/top-think/think-orm/issues", - "source": "https://github.com/top-think/think-orm/tree/v2.0.55" + "source": "https://github.com/top-think/think-orm/tree/v2.0.56" }, "install-path": "../topthink/think-orm" }, { "name": "topthink/think-trace", - "version": "v1.5", - "version_normalized": "1.5.0.0", + "version": "v1.6", + "version_normalized": "1.6.0.0", "source": { "type": "git", "url": "https://github.com/top-think/think-trace.git", - "reference": "55027fd79abb744f32a3be8d9e1ccf873a3ca9b7" + "reference": "136cd5d97e8bdb780e4b5c1637c588ed7ca3e142" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/top-think/think-trace/zipball/55027fd79abb744f32a3be8d9e1ccf873a3ca9b7", - "reference": "55027fd79abb744f32a3be8d9e1ccf873a3ca9b7", + "url": "https://api.github.com/repos/top-think/think-trace/zipball/136cd5d97e8bdb780e4b5c1637c588ed7ca3e142", + "reference": "136cd5d97e8bdb780e4b5c1637c588ed7ca3e142", "shasum": "" }, "require": { "php": ">=7.1.0", - "topthink/framework": "^6.0" + "topthink/framework": "^6.0|^8.0" }, - "time": "2022-10-26T07:56:45+00:00", + "time": "2023-02-07T08:36:32+00:00", "type": "library", "extra": { "think": { @@ -1388,7 +1388,7 @@ "description": "thinkphp debug trace", "support": { "issues": "https://github.com/top-think/think-trace/issues", - "source": "https://github.com/top-think/think-trace/tree/v1.5" + "source": "https://github.com/top-think/think-trace/tree/v1.6" }, "install-path": "../topthink/think-trace" }, diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index b682cf353..8b9ef8750 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -233,21 +233,21 @@ 'dev_requirement' => false, ), 'topthink/think-orm' => array( - 'pretty_version' => 'v2.0.55', - 'version' => '2.0.55.0', + 'pretty_version' => 'v2.0.56', + 'version' => '2.0.56.0', 'type' => 'library', 'install_path' => __DIR__ . '/../topthink/think-orm', 'aliases' => array(), - 'reference' => 'e1974a4c3b1b4c5b808fcc0863fc254e711dee13', + 'reference' => '75b8512736daaa056d511f42c15bed87c9f3605a', 'dev_requirement' => false, ), 'topthink/think-trace' => array( - 'pretty_version' => 'v1.5', - 'version' => '1.5.0.0', + 'pretty_version' => 'v1.6', + 'version' => '1.6.0.0', 'type' => 'library', 'install_path' => __DIR__ . '/../topthink/think-trace', 'aliases' => array(), - 'reference' => '55027fd79abb744f32a3be8d9e1ccf873a3ca9b7', + 'reference' => '136cd5d97e8bdb780e4b5c1637c588ed7ca3e142', 'dev_requirement' => true, ), 'xia/migration' => array( diff --git a/vendor/services.php b/vendor/services.php index bace6cd13..76f204b13 100644 --- a/vendor/services.php +++ b/vendor/services.php @@ -1,5 +1,5 @@ 'app\\admin\\AppStoreService', diff --git a/vendor/topthink/think-orm/src/DbManager.php b/vendor/topthink/think-orm/src/DbManager.php index f223cd2cc..1c1314e88 100644 --- a/vendor/topthink/think-orm/src/DbManager.php +++ b/vendor/topthink/think-orm/src/DbManager.php @@ -340,6 +340,16 @@ class DbManager { return $this->listen; } + + /** + * 获取所有连接实列 + * @access public + * @return array + */ + public function getInstance(): array + { + return $this->instance; + } /** * 注册回调方法 diff --git a/vendor/topthink/think-orm/src/Paginator.php b/vendor/topthink/think-orm/src/Paginator.php index 2f755ef43..eace6ba8a 100644 --- a/vendor/topthink/think-orm/src/Paginator.php +++ b/vendor/topthink/think-orm/src/Paginator.php @@ -377,6 +377,19 @@ abstract class Paginator implements ArrayAccess, Countable, IteratorAggregate, J return $this->items; } + /** + * 设置数据集 + * + * @param Collection $items + * @return $this + */ + public function setCollection(Collection $items) + { + $this->items = $items; + + return $this; + } + public function isEmpty(): bool { return $this->items->isEmpty(); diff --git a/vendor/topthink/think-orm/src/model/concern/TimeStamp.php b/vendor/topthink/think-orm/src/model/concern/TimeStamp.php index 2492e0661..9440c3e6b 100644 --- a/vendor/topthink/think-orm/src/model/concern/TimeStamp.php +++ b/vendor/topthink/think-orm/src/model/concern/TimeStamp.php @@ -179,7 +179,7 @@ trait TimeStamp protected function formatDateTime($format, $time = 'now', bool $timestamp = false) { if (empty($time)) { - return; + return $time; } if (false === $format) { diff --git a/vendor/topthink/think-orm/src/model/relation/MorphTo.php b/vendor/topthink/think-orm/src/model/relation/MorphTo.php index 74b16c277..d24c08262 100644 --- a/vendor/topthink/think-orm/src/model/relation/MorphTo.php +++ b/vendor/topthink/think-orm/src/model/relation/MorphTo.php @@ -144,8 +144,9 @@ class MorphTo extends Relation foreach ($types as $type) { if ($type) { $query->whereExists(function (Query $query) use ($type, $where, $alias) { + $class = $this->parseModel($type); /** @var Model $model */ - $model = new ($this->parseModel($type)); + $model = new $class(); $table = $model->getTable(); $query @@ -309,11 +310,11 @@ class MorphTo extends Relation protected function eagerlyMorphToOne(string $model, string $relation, Model $result, array $subRelation = [], array $cache = []): void { // 预载入关联查询 支持嵌套预载入 - $pk = $this->parent->{$this->morphKey}; + $pk = $this->parent->{$this->morphKey}; $data = null; - if(\class_exists($model)){ + if (\class_exists($model)) { $data = (new $model)->with($subRelation) ->cache($cache[0] ?? false, $cache[1] ?? null, $cache[2] ?? null) ->find($pk); diff --git a/vendor/topthink/think-orm/src/model/relation/OneToOne.php b/vendor/topthink/think-orm/src/model/relation/OneToOne.php index ba51753d4..b3eab594a 100644 --- a/vendor/topthink/think-orm/src/model/relation/OneToOne.php +++ b/vendor/topthink/think-orm/src/model/relation/OneToOne.php @@ -91,9 +91,23 @@ abstract class OneToOne extends Relation $query->via($joinAlias); if ($this instanceof BelongsTo) { - $joinOn = $name . '.' . $this->foreignKey . '=' . $joinAlias . '.' . $this->localKey; + + $foreignKeyExp = $this->foreignKey; + + if (strpos($foreignKeyExp, '.') === false) { + $foreignKeyExp = $name . '.' . $this->foreignKey; + } + + $joinOn = $foreignKeyExp . '=' . $joinAlias . '.' . $this->localKey; } else { - $joinOn = $name . '.' . $this->localKey . '=' . $joinAlias . '.' . $this->foreignKey; + + $foreignKeyExp = $this->foreignKey; + + if (strpos($foreignKeyExp, '.') === false) { + $foreignKeyExp = $joinAlias . '.' . $this->foreignKey; + } + + $joinOn = $name . '.' . $this->localKey . '=' . $foreignKeyExp; } if ($closure) { diff --git a/vendor/topthink/think-trace/composer.json b/vendor/topthink/think-trace/composer.json index 172a2d3c6..e6cd16b16 100644 --- a/vendor/topthink/think-trace/composer.json +++ b/vendor/topthink/think-trace/composer.json @@ -10,7 +10,7 @@ ], "require": { "php": ">=7.1.0", - "topthink/framework": "^6.0" + "topthink/framework": "^6.0|^8.0" }, "autoload": { "psr-4": { -- Gitee From c7bbf6c3fca68014b92b68ca9c59350a923b9563 Mon Sep 17 00:00:00 2001 From: dean Date: Fri, 10 Feb 2023 17:48:09 +0800 Subject: [PATCH 18/30] =?UTF-8?q?=E5=8D=87=E7=BA=A7=E7=AC=AC=E4=B8=89?= =?UTF-8?q?=E6=96=B9=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- composer.lock | 12 +++--- vendor/composer/installed.json | 14 +++---- vendor/composer/installed.php | 6 +-- vendor/services.php | 2 +- vendor/topthink/think-orm/src/db/Builder.php | 37 +++++++++++------- .../topthink/think-orm/src/db/Connection.php | 2 +- .../think-orm/src/db/PDOConnection.php | 39 +++++++++++++------ vendor/topthink/think-orm/src/db/Query.php | 1 - .../think-orm/src/db/builder/Mysql.php | 18 ++++++--- .../src/db/concern/JoinAndViewQuery.php | 1 - .../think-orm/src/db/concern/ParamsBind.php | 27 +++++++++++++ .../think-orm/src/db/connector/Sqlsrv.php | 2 +- .../topthink/think-orm/src/model/Relation.php | 37 ++++++++---------- .../think-orm/src/model/concern/Attribute.php | 4 +- .../src/model/concern/Conversion.php | 2 +- .../src/model/concern/RelationShip.php | 2 +- .../src/model/relation/BelongsTo.php | 1 - .../src/model/relation/BelongsToMany.php | 13 ++++--- .../think-orm/src/model/relation/HasMany.php | 20 +++++----- .../src/model/relation/HasManyThrough.php | 15 +++---- .../think-orm/src/model/relation/HasOne.php | 1 - .../src/model/relation/HasOneThrough.php | 1 - .../src/model/relation/MorphMany.php | 14 +++---- .../think-orm/src/model/relation/MorphOne.php | 5 +-- .../src/model/relation/MorphToMany.php | 28 ++++++------- .../think-orm/src/model/relation/OneToOne.php | 9 ++--- .../topthink/think-orm/stubs/load_stubs.php | 2 +- 27 files changed, 184 insertions(+), 131 deletions(-) diff --git a/composer.lock b/composer.lock index d63919ec0..d32dfd77f 100644 --- a/composer.lock +++ b/composer.lock @@ -1219,16 +1219,16 @@ }, { "name": "topthink/think-orm", - "version": "v2.0.56", + "version": "v2.0.57", "source": { "type": "git", "url": "https://github.com/top-think/think-orm.git", - "reference": "75b8512736daaa056d511f42c15bed87c9f3605a" + "reference": "b68e3bb15322dc2d977ac62682d6df05c98bd23c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/top-think/think-orm/zipball/75b8512736daaa056d511f42c15bed87c9f3605a", - "reference": "75b8512736daaa056d511f42c15bed87c9f3605a", + "url": "https://api.github.com/repos/top-think/think-orm/zipball/b68e3bb15322dc2d977ac62682d6df05c98bd23c", + "reference": "b68e3bb15322dc2d977ac62682d6df05c98bd23c", "shasum": "" }, "require": { @@ -1268,9 +1268,9 @@ ], "support": { "issues": "https://github.com/top-think/think-orm/issues", - "source": "https://github.com/top-think/think-orm/tree/v2.0.56" + "source": "https://github.com/top-think/think-orm/tree/v2.0.57" }, - "time": "2022-12-15T02:52:53+00:00" + "time": "2023-02-03T11:35:52+00:00" }, { "name": "xia/migration", diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index 10dbf3a27..b58c3d067 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -1282,17 +1282,17 @@ }, { "name": "topthink/think-orm", - "version": "v2.0.56", - "version_normalized": "2.0.56.0", + "version": "v2.0.57", + "version_normalized": "2.0.57.0", "source": { "type": "git", "url": "https://github.com/top-think/think-orm.git", - "reference": "75b8512736daaa056d511f42c15bed87c9f3605a" + "reference": "b68e3bb15322dc2d977ac62682d6df05c98bd23c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/top-think/think-orm/zipball/75b8512736daaa056d511f42c15bed87c9f3605a", - "reference": "75b8512736daaa056d511f42c15bed87c9f3605a", + "url": "https://api.github.com/repos/top-think/think-orm/zipball/b68e3bb15322dc2d977ac62682d6df05c98bd23c", + "reference": "b68e3bb15322dc2d977ac62682d6df05c98bd23c", "shasum": "" }, "require": { @@ -1306,7 +1306,7 @@ "require-dev": { "phpunit/phpunit": "^7|^8|^9.5" }, - "time": "2022-12-15T02:52:53+00:00", + "time": "2023-02-03T11:35:52+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1334,7 +1334,7 @@ ], "support": { "issues": "https://github.com/top-think/think-orm/issues", - "source": "https://github.com/top-think/think-orm/tree/v2.0.56" + "source": "https://github.com/top-think/think-orm/tree/v2.0.57" }, "install-path": "../topthink/think-orm" }, diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 8b9ef8750..d4ecb8cc1 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -233,12 +233,12 @@ 'dev_requirement' => false, ), 'topthink/think-orm' => array( - 'pretty_version' => 'v2.0.56', - 'version' => '2.0.56.0', + 'pretty_version' => 'v2.0.57', + 'version' => '2.0.57.0', 'type' => 'library', 'install_path' => __DIR__ . '/../topthink/think-orm', 'aliases' => array(), - 'reference' => '75b8512736daaa056d511f42c15bed87c9f3605a', + 'reference' => 'b68e3bb15322dc2d977ac62682d6df05c98bd23c', 'dev_requirement' => false, ), 'topthink/think-trace' => array( diff --git a/vendor/services.php b/vendor/services.php index 76f204b13..57749783a 100644 --- a/vendor/services.php +++ b/vendor/services.php @@ -1,5 +1,5 @@ 'app\\admin\\AppStoreService', diff --git a/vendor/topthink/think-orm/src/db/Builder.php b/vendor/topthink/think-orm/src/db/Builder.php index 938ed4db3..fa85117fe 100644 --- a/vendor/topthink/think-orm/src/db/Builder.php +++ b/vendor/topthink/think-orm/src/db/Builder.php @@ -158,7 +158,8 @@ abstract class Builder if (false !== strpos($key, '->')) { [$key, $name] = explode('->', $key, 2); $item = $this->parseKey($query, $key); - $result[$item] = 'json_set(' . $item . ', \'$.' . $name . '\', ' . $this->parseDataBind($query, $key . '->' . $name, $val, $bind) . ')'; + + $result[$item . '->' . $name] = 'json_set(' . $item . ', \'$.' . $name . '\', ' . $this->parseDataBind($query, $key . '->' . $name, $val, $bind) . ')'; } elseif (false === strpos($key, '.') && !in_array($key, $fields, true)) { if ($options['strict']) { throw new Exception('fields not exists:[' . $key . ']'); @@ -176,7 +177,7 @@ abstract class Builder } } elseif (is_scalar($val)) { // 过滤非标量数据 - $result[$item] = $this->parseDataBind($query, $key, $val, $bind); + $result[$item] = !$query->isAutoBind() ? $val : $this->parseDataBind($query, $key, $val, $bind); } } @@ -761,18 +762,23 @@ abstract class Builder if (count($value) === 0) { return 'IN' == $exp ? '0 = 1' : '1 = 1'; } - $array = []; - foreach ($value as $v) { - $name = $query->bindValue($v, $bindType); - $array[] = ':' . $name; + if ($query->isAutoBind()) { + $array = []; + foreach ($value as $v) { + $name = $query->bindValue($v, $bindType); + $array[] = ':' . $name; + } + } else { + $array = $value; } if (count($array) == 1) { return $key . ('IN' == $exp ? ' = ' : ' <> ') . $array[0]; - } else { - $value = implode(',', $array); } + + $value = implode(',', $array); + } return $key . ' ' . $exp . ' (' . $value . ')'; @@ -1139,7 +1145,8 @@ abstract class Builder $this->parseComment($query, $options['comment']), $this->parseForce($query, $options['force']), ], - $this->selectSql); + $this->selectSql + ); } /** @@ -1171,7 +1178,8 @@ abstract class Builder implode(' , ', $values), $this->parseComment($query, $options['comment']), ], - $this->insertSql); + $this->insertSql + ); } /** @@ -1222,7 +1230,8 @@ abstract class Builder implode(' UNION ALL ', $values), $this->parseComment($query, $options['comment']), ], - $this->insertAllSql); + $this->insertAllSql + ); } /** @@ -1276,7 +1285,8 @@ abstract class Builder $this->parseLock($query, $options['lock']), $this->parseComment($query, $options['comment']), ], - $this->updateSql); + $this->updateSql + ); } /** @@ -1302,6 +1312,7 @@ abstract class Builder $this->parseLock($query, $options['lock']), $this->parseComment($query, $options['comment']), ], - $this->deleteSql); + $this->deleteSql + ); } } diff --git a/vendor/topthink/think-orm/src/db/Connection.php b/vendor/topthink/think-orm/src/db/Connection.php index aa86ba8e5..015cf441a 100644 --- a/vendor/topthink/think-orm/src/db/Connection.php +++ b/vendor/topthink/think-orm/src/db/Connection.php @@ -8,7 +8,7 @@ // +---------------------------------------------------------------------- // | Author: liu21st // +---------------------------------------------------------------------- -declare (strict_types = 1); +declare(strict_types=1); namespace think\db; diff --git a/vendor/topthink/think-orm/src/db/PDOConnection.php b/vendor/topthink/think-orm/src/db/PDOConnection.php index 1748d2085..bdd7b9628 100644 --- a/vendor/topthink/think-orm/src/db/PDOConnection.php +++ b/vendor/topthink/think-orm/src/db/PDOConnection.php @@ -8,7 +8,7 @@ // +---------------------------------------------------------------------- // | Author: liu21st // +---------------------------------------------------------------------- -declare (strict_types = 1); +declare(strict_types=1); namespace think\db; @@ -81,6 +81,8 @@ abstract class PDOConnection extends Connection 'break_reconnect' => false, // 断线标识字符串 'break_match_str' => [], + // 自动参数绑定 + 'auto_param_bind' => true, ]; /** @@ -1281,8 +1283,8 @@ abstract class PDOConnection extends Connection // 判断占位符 $sql = is_numeric($key) ? - substr_replace($sql, $value, strpos($sql, '?'), 1) : - substr_replace($sql, $value, strpos($sql, ':' . $key), strlen(':' . $key)); + substr_replace($sql, $value, strpos($sql, '?'), 1) : + substr_replace($sql, $value, strpos($sql, ':' . $key), strlen(':' . $key)); } return rtrim($sql); @@ -1758,6 +1760,17 @@ abstract class PDOConnection extends Connection return $this->connect($dbConfig, $r, $r == $m ? false : $dbMaster); } + /** + * 获取数据库的唯一标识 + * @access public + * @param string $suffix 标识后缀 + * @return string + */ + public function getUniqueXid(string $suffix = ''): string + { + return $this->config['hostname'] . '_' . $this->config['database'] . $suffix; + } + /** * 执行数据库Xa事务 * @access public @@ -1783,7 +1796,7 @@ abstract class PDOConnection extends Connection $dbs[$key] = $db; } - $db->startTransXa($xid); + $db->startTransXa($db->getUniqueXid('_' . $xid) ); } try { @@ -1793,17 +1806,17 @@ abstract class PDOConnection extends Connection } foreach ($dbs as $db) { - $db->prepareXa($xid); + $db->prepareXa($db->getUniqueXid('_' . $xid)); } foreach ($dbs as $db) { - $db->commitXa($xid); + $db->commitXa($db->getUniqueXid('_' . $xid) ); } return $result; } catch (\Exception | \Throwable $e) { foreach ($dbs as $db) { - $db->rollbackXa($xid); + $db->rollbackXa($db->getUniqueXid('_' . $xid) ); } throw $e; } @@ -1816,7 +1829,8 @@ abstract class PDOConnection extends Connection * @return void */ public function startTransXa(string $xid): void - {} + { + } /** * 预编译XA事务 @@ -1825,7 +1839,8 @@ abstract class PDOConnection extends Connection * @return void */ public function prepareXa(string $xid): void - {} + { + } /** * 提交XA事务 @@ -1834,7 +1849,8 @@ abstract class PDOConnection extends Connection * @return void */ public function commitXa(string $xid): void - {} + { + } /** * 回滚XA事务 @@ -1843,5 +1859,6 @@ abstract class PDOConnection extends Connection * @return void */ public function rollbackXa(string $xid): void - {} + { + } } diff --git a/vendor/topthink/think-orm/src/db/Query.php b/vendor/topthink/think-orm/src/db/Query.php index aa961239b..35e66bcb5 100644 --- a/vendor/topthink/think-orm/src/db/Query.php +++ b/vendor/topthink/think-orm/src/db/Query.php @@ -13,7 +13,6 @@ declare (strict_types = 1); namespace think\db; use PDOStatement; -use think\helper\Str; /** * PDO数据查询类 diff --git a/vendor/topthink/think-orm/src/db/builder/Mysql.php b/vendor/topthink/think-orm/src/db/builder/Mysql.php index 136b0dee0..d70fb90c4 100644 --- a/vendor/topthink/think-orm/src/db/builder/Mysql.php +++ b/vendor/topthink/think-orm/src/db/builder/Mysql.php @@ -101,7 +101,8 @@ class Mysql extends Builder $this->parseComment($query, $options['comment']), $this->parseForce($query, $options['force']), ], - $this->selectSql); + $this->selectSql + ); } /** @@ -136,7 +137,8 @@ class Mysql extends Builder $this->parseDuplicate($query, $options['duplicate']), $this->parseComment($query, $options['comment']), ], - $this->insertSql); + $this->insertSql + ); } /** @@ -190,7 +192,8 @@ class Mysql extends Builder $this->parseDuplicate($query, $options['duplicate']), $this->parseComment($query, $options['comment']), ], - $this->insertAllSql); + $this->insertAllSql + ); } /** @@ -208,9 +211,10 @@ class Mysql extends Builder if (empty($data)) { return ''; } + $set = []; foreach ($data as $key => $val) { - $set[] = $key . ' = ' . $val; + $set[] = (strpos($key, '->') ? strstr($key, '->', true) : $key) . ' = ' . $val; } return str_replace( @@ -227,7 +231,8 @@ class Mysql extends Builder $this->parseLock($query, $options['lock']), $this->parseComment($query, $options['comment']), ], - $this->updateSql); + $this->updateSql + ); } /** @@ -254,7 +259,8 @@ class Mysql extends Builder $this->parseLock($query, $options['lock']), $this->parseComment($query, $options['comment']), ], - $this->deleteSql); + $this->deleteSql + ); } /** diff --git a/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php b/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php index c33d1ed2f..28289497b 100644 --- a/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php +++ b/vendor/topthink/think-orm/src/db/concern/JoinAndViewQuery.php @@ -13,7 +13,6 @@ declare (strict_types = 1); namespace think\db\concern; use think\db\Raw; -use think\helper\Str; /** * JOIN和VIEW查询 diff --git a/vendor/topthink/think-orm/src/db/concern/ParamsBind.php b/vendor/topthink/think-orm/src/db/concern/ParamsBind.php index 296e2212d..88293fa86 100644 --- a/vendor/topthink/think-orm/src/db/concern/ParamsBind.php +++ b/vendor/topthink/think-orm/src/db/concern/ParamsBind.php @@ -64,6 +64,33 @@ trait ParamsBind return isset($this->bind[$key]); } + /** + * 设置自动参数绑定 + * @access public + * @param bool $bind 是否自动参数绑定 + * @return $this + */ + public function autoBind(bool $bind) + { + $this->options['auto_bind'] = $bind; + return $this; + } + + /** + * 检测是否开启自动参数绑定 + * @access public + * @return bool + */ + public function isAutoBind(): bool + { + $autoBind = $this->getConfig('auto_param_bind'); + if (null !== $this->getOptions('auto_bind')) { + $autoBind = $this->getOptions('auto_bind'); + } + + return (bool) $autoBind; + } + /** * 参数绑定 * @access public diff --git a/vendor/topthink/think-orm/src/db/connector/Sqlsrv.php b/vendor/topthink/think-orm/src/db/connector/Sqlsrv.php index aee3343c9..835605d2e 100644 --- a/vendor/topthink/think-orm/src/db/connector/Sqlsrv.php +++ b/vendor/topthink/think-orm/src/db/connector/Sqlsrv.php @@ -60,7 +60,7 @@ class Sqlsrv extends PDOConnection public function getFields(string $tableName): array { [$tableName] = explode(' ', $tableName); - strpos($tableName,'.') && $tableName = substr($tableName,strpos($tableName,'.') + 1); + strpos($tableName, '.') && $tableName = substr($tableName, strpos($tableName, '.') + 1); $sql = "SELECT column_name, data_type, column_default, is_nullable FROM information_schema.tables AS t JOIN information_schema.columns AS c diff --git a/vendor/topthink/think-orm/src/model/Relation.php b/vendor/topthink/think-orm/src/model/Relation.php index 3aa22be0a..7bb6d9ff6 100644 --- a/vendor/topthink/think-orm/src/model/Relation.php +++ b/vendor/topthink/think-orm/src/model/Relation.php @@ -67,12 +67,6 @@ abstract class Relation */ protected $selfRelation = false; - /** - * 关联数据数量限制 - * @var int - */ - protected $withLimit; - /** * 关联数据字段限制 * @var array @@ -200,18 +194,6 @@ abstract class Relation } } - /** - * 限制关联数据的数量 - * @access public - * @param int $limit 关联数量限制 - * @return $this - */ - public function withLimit(int $limit) - { - $this->withLimit = $limit; - return $this; - } - /** * 限制关联数据的字段 * @access public @@ -244,6 +226,18 @@ abstract class Relation return $this; } + /** + * 限制关联数据的数量 + * @access public + * @param int $limit 关联数量限制 + * @return $this + */ + public function withLimit(int $limit) + { + $this->query->limit($limit); + return $this; + } + /** * 设置关联数据不存在的时候默认值 * @access public @@ -281,14 +275,15 @@ abstract class Relation * @access protected * @return mixed */ - protected function getClosureType(Closure $closure) + protected function getClosureType(Closure $closure, $query = null) { $reflect = new ReflectionFunction($closure); $params = $reflect->getParameters(); if (!empty($params)) { - $type = $params[0]->getType(); - return is_null($type) || Relation::class == $type->getName() ? $this : $this->query; + $type = $params[0]->getType(); + $query = $query ?: $this->query; + return is_null($type) || Relation::class == $type->getName() ? $this : $query; } return $this; diff --git a/vendor/topthink/think-orm/src/model/concern/Attribute.php b/vendor/topthink/think-orm/src/model/concern/Attribute.php index b14d25a89..4359a4c38 100644 --- a/vendor/topthink/think-orm/src/model/concern/Attribute.php +++ b/vendor/topthink/think-orm/src/model/concern/Attribute.php @@ -15,7 +15,6 @@ namespace think\model\concern; use InvalidArgumentException; use think\db\Raw; use think\helper\Str; -use think\Model; use think\model\Relation; /** @@ -383,6 +382,8 @@ trait Attribute } elseif (isset($this->type[$name])) { // 类型转换 $value = $this->writeTransform($value, $this->type[$name]); + } elseif ($this->isRelationAttr($name)) { + $this->relation[$name] = $value; } elseif ((array_key_exists($name, $this->origin) || empty($this->origin)) && is_object($value) && method_exists($value, '__toString')) { // 对象类型 $value = $value->__toString(); @@ -446,6 +447,7 @@ trait Attribute break; case 'array': $value = (array) $value; + // no break case 'json': $option = !empty($param) ? (int) $param : JSON_UNESCAPED_UNICODE; $value = json_encode($value, $option); diff --git a/vendor/topthink/think-orm/src/model/concern/Conversion.php b/vendor/topthink/think-orm/src/model/concern/Conversion.php index b584ba91a..72bf49427 100644 --- a/vendor/topthink/think-orm/src/model/concern/Conversion.php +++ b/vendor/topthink/think-orm/src/model/concern/Conversion.php @@ -241,7 +241,7 @@ trait Conversion if (isset($this->visible[$key]) && is_array($this->visible[$key])) { $val->visible($this->visible[$key]); } elseif (isset($this->hidden[$key]) && is_array($this->hidden[$key])) { - $val->hidden($this->hidden[$key]); + $val->hidden($this->hidden[$key], true); } // 关联模型对象 if (!isset($this->hidden[$key]) || true !== $this->hidden[$key]) { diff --git a/vendor/topthink/think-orm/src/model/concern/RelationShip.php b/vendor/topthink/think-orm/src/model/concern/RelationShip.php index 8faadf476..8e0d498e6 100644 --- a/vendor/topthink/think-orm/src/model/concern/RelationShip.php +++ b/vendor/topthink/think-orm/src/model/concern/RelationShip.php @@ -346,7 +346,7 @@ trait RelationShip */ public function bindAttr(string $relation, array $attrs = []) { - $relation = $this->getRelation($relation); + $relation = $this->getRelation($relation, true); foreach ($attrs as $key => $attr) { $key = is_numeric($key) ? $attr : $key; diff --git a/vendor/topthink/think-orm/src/model/relation/BelongsTo.php b/vendor/topthink/think-orm/src/model/relation/BelongsTo.php index 741a2e8d4..dfac2547d 100644 --- a/vendor/topthink/think-orm/src/model/relation/BelongsTo.php +++ b/vendor/topthink/think-orm/src/model/relation/BelongsTo.php @@ -14,7 +14,6 @@ namespace think\model\relation; use Closure; use think\db\BaseQuery as Query; -use think\helper\Str; use think\Model; /** diff --git a/vendor/topthink/think-orm/src/model/relation/BelongsToMany.php b/vendor/topthink/think-orm/src/model/relation/BelongsToMany.php index 6049f0125..8c74f34d3 100644 --- a/vendor/topthink/think-orm/src/model/relation/BelongsToMany.php +++ b/vendor/topthink/think-orm/src/model/relation/BelongsToMany.php @@ -346,6 +346,11 @@ class BelongsToMany extends Relation $closure($this->getClosureType($closure)); } + $withLimit = $this->query->getOptions('limit'); + if ($withLimit) { + $this->query->removeOption('limit'); + } + // 预载入关联查询 支持嵌套预载入 $list = $this->belongsToManyQuery($this->foreignKey, $this->localKey, $where) ->with($subRelation) @@ -353,12 +358,12 @@ class BelongsToMany extends Relation ->select(); // 组装模型数据 - $data = []; + $data = []; foreach ($list as $set) { $pivot = $this->matchPivot($set); $key = $pivot[$this->localKey]; - if ($this->withLimit && isset($data[$key]) && count($data[$key]) >= $this->withLimit) { + if ($withLimit && isset($data[$key]) && count($data[$key]) >= $withLimit) { continue; } @@ -389,10 +394,6 @@ class BelongsToMany extends Relation $fields = $this->getQueryFields($tableName); - if ($this->withLimit) { - $this->query->limit($this->withLimit); - } - $this->query ->field($fields) ->tableField(true, $table, 'pivot', 'pivot__') diff --git a/vendor/topthink/think-orm/src/model/relation/HasMany.php b/vendor/topthink/think-orm/src/model/relation/HasMany.php index 77d9e4d5e..137fc5cb2 100644 --- a/vendor/topthink/think-orm/src/model/relation/HasMany.php +++ b/vendor/topthink/think-orm/src/model/relation/HasMany.php @@ -15,7 +15,6 @@ namespace think\model\relation; use Closure; use think\Collection; use think\db\BaseQuery as Query; -use think\helper\Str; use think\Model; use think\model\Relation; @@ -58,10 +57,6 @@ class HasMany extends Relation $closure($this->getClosureType($closure)); } - if ($this->withLimit) { - $this->query->limit($this->withLimit); - } - return $this->query ->where($this->foreignKey, $this->parent->{$this->localKey}) ->relation($subRelation) @@ -210,6 +205,11 @@ class HasMany extends Relation $this->query->withoutField($this->withoutField); } + $withLimit = $this->query->getOptions('limit'); + if ($withLimit) { + $this->query->removeOption('limit'); + } + $list = $this->query ->where($where) ->cache($cache[0] ?? false, $cache[1] ?? null, $cache[2] ?? null) @@ -217,12 +217,12 @@ class HasMany extends Relation ->select(); // 组装模型数据 - $data = []; - + $data = []; + foreach ($list as $set) { $key = $set->$foreignKey; - if ($this->withLimit && isset($data[$key]) && count($data[$key]) >= $this->withLimit) { + if ($withLimit && isset($data[$key]) && count($data[$key]) >= $withLimit) { continue; } @@ -241,9 +241,9 @@ class HasMany extends Relation */ public function save($data, bool $replace = true) { - $model = $this->make(); + $model = $this->make($data); - return $model->replace($replace)->save($data) ? $model : false; + return $model->replace($replace)->save() ? $model : false; } /** diff --git a/vendor/topthink/think-orm/src/model/relation/HasManyThrough.php b/vendor/topthink/think-orm/src/model/relation/HasManyThrough.php index fc620264b..4f143993a 100644 --- a/vendor/topthink/think-orm/src/model/relation/HasManyThrough.php +++ b/vendor/topthink/think-orm/src/model/relation/HasManyThrough.php @@ -79,10 +79,6 @@ class HasManyThrough extends Relation $this->baseQuery(); - if ($this->withLimit) { - $this->query->limit($this->withLimit); - } - return $this->query->relation($subRelation) ->select() ->setParent(clone $this->parent); @@ -264,19 +260,24 @@ class HasManyThrough extends Relation $throughKey = Str::snake(class_basename($this->model)) . "." . $this->throughKey; } + $withLimit = $this->query->getOptions('limit'); + if ($withLimit) { + $this->query->removeOption('limit'); + } + $list = $this->query ->where($throughKey, 'in', $keys) ->cache($cache[0] ?? false, $cache[1] ?? null, $cache[2] ?? null) ->select(); // 组装模型数据 - $data = []; - $keys = $throughList->column($this->foreignKey, $this->throughPk); + $data = []; + $keys = $throughList->column($this->foreignKey, $this->throughPk); foreach ($list as $set) { $key = $keys[$set->{$this->throughKey}]; - if ($this->withLimit && isset($data[$key]) && count($data[$key]) >= $this->withLimit) { + if ($withLimit && isset($data[$key]) && count($data[$key]) >= $withLimit) { continue; } diff --git a/vendor/topthink/think-orm/src/model/relation/HasOne.php b/vendor/topthink/think-orm/src/model/relation/HasOne.php index 5e5e50112..b941f6ecf 100644 --- a/vendor/topthink/think-orm/src/model/relation/HasOne.php +++ b/vendor/topthink/think-orm/src/model/relation/HasOne.php @@ -14,7 +14,6 @@ namespace think\model\relation; use Closure; use think\db\BaseQuery as Query; -use think\helper\Str; use think\Model; /** diff --git a/vendor/topthink/think-orm/src/model/relation/HasOneThrough.php b/vendor/topthink/think-orm/src/model/relation/HasOneThrough.php index 0278533ee..2734c13a0 100644 --- a/vendor/topthink/think-orm/src/model/relation/HasOneThrough.php +++ b/vendor/topthink/think-orm/src/model/relation/HasOneThrough.php @@ -12,7 +12,6 @@ namespace think\model\relation; use Closure; -use think\helper\Str; use think\Model; /** diff --git a/vendor/topthink/think-orm/src/model/relation/MorphMany.php b/vendor/topthink/think-orm/src/model/relation/MorphMany.php index 39209ae68..35f3377c4 100644 --- a/vendor/topthink/think-orm/src/model/relation/MorphMany.php +++ b/vendor/topthink/think-orm/src/model/relation/MorphMany.php @@ -15,7 +15,6 @@ use Closure; use think\Collection; use think\db\BaseQuery as Query; use think\db\exception\DbException as Exception; -use think\helper\Str; use think\Model; use think\model\Relation; @@ -77,10 +76,6 @@ class MorphMany extends Relation $this->baseQuery(); - if ($this->withLimit) { - $this->query->limit($this->withLimit); - } - return $this->query->relation($subRelation) ->select() ->setParent(clone $this->parent); @@ -258,6 +253,11 @@ class MorphMany extends Relation $closure($this->getClosureType($closure)); } + $withLimit = $this->query->getOptions('limit'); + if ($withLimit) { + $this->query->removeOption('limit'); + } + $list = $this->query ->where($where) ->with($subRelation) @@ -266,11 +266,11 @@ class MorphMany extends Relation $morphKey = $this->morphKey; // 组装模型数据 - $data = []; + $data = []; foreach ($list as $set) { $key = $set->$morphKey; - if ($this->withLimit && isset($data[$key]) && count($data[$key]) >= $this->withLimit) { + if ($withLimit && isset($data[$key]) && count($data[$key]) >= $withLimit) { continue; } diff --git a/vendor/topthink/think-orm/src/model/relation/MorphOne.php b/vendor/topthink/think-orm/src/model/relation/MorphOne.php index 788dd2955..8761b3b1a 100644 --- a/vendor/topthink/think-orm/src/model/relation/MorphOne.php +++ b/vendor/topthink/think-orm/src/model/relation/MorphOne.php @@ -14,7 +14,6 @@ namespace think\model\relation; use Closure; use think\db\BaseQuery as Query; use think\db\exception\DbException as Exception; -use think\helper\Str; use think\Model; use think\model\Relation; @@ -260,8 +259,8 @@ class MorphOne extends Relation */ public function save($data, bool $replace = true) { - $model = $this->make(); - return $model->replace($replace)->save($data) ? $model : false; + $model = $this->make($data); + return $model->replace($replace)->save() ? $model : false; } /** diff --git a/vendor/topthink/think-orm/src/model/relation/MorphToMany.php b/vendor/topthink/think-orm/src/model/relation/MorphToMany.php index c56648874..c9d8583d8 100644 --- a/vendor/topthink/think-orm/src/model/relation/MorphToMany.php +++ b/vendor/topthink/think-orm/src/model/relation/MorphToMany.php @@ -216,12 +216,7 @@ class MorphToMany extends BelongsToMany } $fields = $this->getQueryFields($tableName); - - if ($this->withLimit) { - $this->query->limit($this->withLimit); - } - - $query = $this->query + $query = $this->query ->field($fields) ->tableField(true, $table, 'pivot', 'pivot__'); @@ -249,6 +244,11 @@ class MorphToMany extends BelongsToMany $closure($this->getClosureType($closure)); } + $withLimit = $this->query->getOptions('limit'); + if ($withLimit) { + $this->query->removeOption('limit'); + } + // 预载入关联查询 支持嵌套预载入 $list = $this->belongsToManyQuery($this->foreignKey, $this->localKey, $where) ->with($subRelation) @@ -256,7 +256,7 @@ class MorphToMany extends BelongsToMany ->select(); // 组装模型数据 - $data = []; + $data = []; foreach ($list as $set) { $pivot = []; foreach ($set->getData() as $key => $val) { @@ -271,7 +271,7 @@ class MorphToMany extends BelongsToMany $key = $pivot[$this->localKey]; - if ($this->withLimit && isset($data[$key]) && count($data[$key]) >= $this->withLimit) { + if ($withLimit && isset($data[$key]) && count($data[$key]) >= $withLimit) { continue; } @@ -300,10 +300,10 @@ class MorphToMany extends BelongsToMany $model = new $this->model; $id = $model->insertGetId($data); } - } else if (is_numeric($data) || is_string($data)) { + } elseif (is_numeric($data) || is_string($data)) { // 根据关联表主键直接写入中间表 $id = $data; - } else if ($data instanceof Model) { + } elseif ($data instanceof Model) { // 根据关联表主键直接写入中间表 $id = $data->getKey(); } @@ -371,10 +371,10 @@ class MorphToMany extends BelongsToMany { if (is_array($data)) { $id = $data; - } else if (is_numeric($data) || is_string($data)) { + } elseif (is_numeric($data) || is_string($data)) { // 根据关联表主键直接写入中间表 $id = $data; - } else if ($data instanceof Model) { + } elseif ($data instanceof Model) { // 根据关联表主键直接写入中间表 $id = $data->getKey(); } @@ -441,7 +441,7 @@ class MorphToMany extends BelongsToMany if (!in_array($id, $current)) { $this->attach($id, $attributes); $changes['attached'][] = $id; - } else if (count($attributes) > 0 && $this->attach($id, $attributes)) { + } elseif (count($attributes) > 0 && $this->attach($id, $attributes)) { $changes['updated'][] = $id; } } @@ -481,7 +481,7 @@ class MorphToMany extends BelongsToMany { if (is_array($map)) { static::$morphMap = $merge && static::$morphMap - ? $map + static::$morphMap : $map; + ? $map + static::$morphMap : $map; } return static::$morphMap; diff --git a/vendor/topthink/think-orm/src/model/relation/OneToOne.php b/vendor/topthink/think-orm/src/model/relation/OneToOne.php index b3eab594a..62d27b707 100644 --- a/vendor/topthink/think-orm/src/model/relation/OneToOne.php +++ b/vendor/topthink/think-orm/src/model/relation/OneToOne.php @@ -100,7 +100,7 @@ abstract class OneToOne extends Relation $joinOn = $foreignKeyExp . '=' . $joinAlias . '.' . $this->localKey; } else { - + $foreignKeyExp = $this->foreignKey; if (strpos($foreignKeyExp, '.') === false) { @@ -112,7 +112,7 @@ abstract class OneToOne extends Relation if ($closure) { // 执行闭包查询 - $closure($this->getClosureType($closure)); + $closure($this->getClosureType($closure, $query)); // 使用withField指定获取关联的字段 if ($this->withField) { @@ -201,9 +201,9 @@ abstract class OneToOne extends Relation */ public function save($data, bool $replace = true) { - $model = $this->make(); + $model = $this->make($data); - return $model->replace($replace)->save($data) ? $model : false; + return $model->replace($replace)->save() ? $model : false; } /** @@ -223,7 +223,6 @@ abstract class OneToOne extends Relation return new $this->model($data); } - /** * 绑定关联表的属性到父模型属性 * @access public diff --git a/vendor/topthink/think-orm/stubs/load_stubs.php b/vendor/topthink/think-orm/stubs/load_stubs.php index 5854cda56..734507eb1 100644 --- a/vendor/topthink/think-orm/stubs/load_stubs.php +++ b/vendor/topthink/think-orm/stubs/load_stubs.php @@ -6,4 +6,4 @@ if (!\class_exists('think\Exception')) { if (!\class_exists('think\Facade')) { require __DIR__ . '/Facade.php'; -} \ No newline at end of file +} -- Gitee From bc6594a0c730ed48687796aacfffcc655300d237 Mon Sep 17 00:00:00 2001 From: dean Date: Tue, 14 Feb 2023 10:04:07 +0800 Subject: [PATCH 19/30] =?UTF-8?q?=E5=8D=87=E7=BA=A7=E7=AC=AC=E4=B8=89?= =?UTF-8?q?=E6=96=B9=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- composer.lock | 12 +++---- vendor/composer/installed.json | 14 ++++---- vendor/composer/installed.php | 6 ++-- vendor/services.php | 2 +- .../think-orm/src/db/PDOConnection.php | 32 +++++++++++-------- .../think-orm/src/model/relation/HasMany.php | 8 +++-- .../src/model/relation/MorphMany.php | 4 +++ .../think-orm/src/model/relation/MorphOne.php | 8 +++-- .../think-orm/src/model/relation/OneToOne.php | 8 +++-- 9 files changed, 57 insertions(+), 37 deletions(-) diff --git a/composer.lock b/composer.lock index d32dfd77f..a5144dfc3 100644 --- a/composer.lock +++ b/composer.lock @@ -1219,16 +1219,16 @@ }, { "name": "topthink/think-orm", - "version": "v2.0.57", + "version": "v2.0.58", "source": { "type": "git", "url": "https://github.com/top-think/think-orm.git", - "reference": "b68e3bb15322dc2d977ac62682d6df05c98bd23c" + "reference": "fae96ca60891ae82df5d8050af959711354898a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/top-think/think-orm/zipball/b68e3bb15322dc2d977ac62682d6df05c98bd23c", - "reference": "b68e3bb15322dc2d977ac62682d6df05c98bd23c", + "url": "https://api.github.com/repos/top-think/think-orm/zipball/fae96ca60891ae82df5d8050af959711354898a5", + "reference": "fae96ca60891ae82df5d8050af959711354898a5", "shasum": "" }, "require": { @@ -1268,9 +1268,9 @@ ], "support": { "issues": "https://github.com/top-think/think-orm/issues", - "source": "https://github.com/top-think/think-orm/tree/v2.0.57" + "source": "https://github.com/top-think/think-orm/tree/v2.0.58" }, - "time": "2023-02-03T11:35:52+00:00" + "time": "2023-02-11T10:07:03+00:00" }, { "name": "xia/migration", diff --git a/vendor/composer/installed.json b/vendor/composer/installed.json index b58c3d067..263fcca5b 100644 --- a/vendor/composer/installed.json +++ b/vendor/composer/installed.json @@ -1282,17 +1282,17 @@ }, { "name": "topthink/think-orm", - "version": "v2.0.57", - "version_normalized": "2.0.57.0", + "version": "v2.0.58", + "version_normalized": "2.0.58.0", "source": { "type": "git", "url": "https://github.com/top-think/think-orm.git", - "reference": "b68e3bb15322dc2d977ac62682d6df05c98bd23c" + "reference": "fae96ca60891ae82df5d8050af959711354898a5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/top-think/think-orm/zipball/b68e3bb15322dc2d977ac62682d6df05c98bd23c", - "reference": "b68e3bb15322dc2d977ac62682d6df05c98bd23c", + "url": "https://api.github.com/repos/top-think/think-orm/zipball/fae96ca60891ae82df5d8050af959711354898a5", + "reference": "fae96ca60891ae82df5d8050af959711354898a5", "shasum": "" }, "require": { @@ -1306,7 +1306,7 @@ "require-dev": { "phpunit/phpunit": "^7|^8|^9.5" }, - "time": "2023-02-03T11:35:52+00:00", + "time": "2023-02-11T10:07:03+00:00", "type": "library", "installation-source": "dist", "autoload": { @@ -1334,7 +1334,7 @@ ], "support": { "issues": "https://github.com/top-think/think-orm/issues", - "source": "https://github.com/top-think/think-orm/tree/v2.0.57" + "source": "https://github.com/top-think/think-orm/tree/v2.0.58" }, "install-path": "../topthink/think-orm" }, diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index d4ecb8cc1..6e8c6efcd 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -233,12 +233,12 @@ 'dev_requirement' => false, ), 'topthink/think-orm' => array( - 'pretty_version' => 'v2.0.57', - 'version' => '2.0.57.0', + 'pretty_version' => 'v2.0.58', + 'version' => '2.0.58.0', 'type' => 'library', 'install_path' => __DIR__ . '/../topthink/think-orm', 'aliases' => array(), - 'reference' => 'b68e3bb15322dc2d977ac62682d6df05c98bd23c', + 'reference' => 'fae96ca60891ae82df5d8050af959711354898a5', 'dev_requirement' => false, ), 'topthink/think-trace' => array( diff --git a/vendor/services.php b/vendor/services.php index 57749783a..0ed5d8035 100644 --- a/vendor/services.php +++ b/vendor/services.php @@ -1,5 +1,5 @@ 'app\\admin\\AppStoreService', diff --git a/vendor/topthink/think-orm/src/db/PDOConnection.php b/vendor/topthink/think-orm/src/db/PDOConnection.php index bdd7b9628..275504088 100644 --- a/vendor/topthink/think-orm/src/db/PDOConnection.php +++ b/vendor/topthink/think-orm/src/db/PDOConnection.php @@ -1187,13 +1187,13 @@ abstract class PDOConnection extends Connection $key = null; } - if (\is_string($column)) { - $column = \trim($column); + if (is_string($column)) { + $column = trim($column); if ('*' !== $column) { - $column = \array_map('\trim', \explode(',', $column)); + $column = array_map('trim', explode(',', $column)); } - } elseif (\is_array($column)) { - if (\in_array('*', $column)) { + } elseif (is_array($column)) { + if (in_array('*', $column)) { $column = '*'; } } else { @@ -1201,7 +1201,7 @@ abstract class PDOConnection extends Connection } $field = $column; - if ('*' !== $column && $key && !\in_array($key, $column)) { + if ('*' !== $column && $key && !in_array($key, $column)) { $field[] = $key; } @@ -1236,19 +1236,23 @@ abstract class PDOConnection extends Connection if (empty($resultSet)) { $result = []; - } elseif ('*' !== $column && \count($column) === 1) { - $column = \array_shift($column); - if (\strpos($column, ' ')) { - $column = \substr(\strrchr(\trim($column), ' '), 1); + } elseif ('*' !== $column && count($column) === 1) { + $column = array_shift($column); + if (strpos($column, ' ')) { + $column = substr(strrchr(trim($column), ' '), 1); } - if (\strpos($column, '.')) { - [$alias, $column] = \explode('.', $column); + if (strpos($column, '.')) { + [$alias, $column] = explode('.', $column); } - $result = \array_column($resultSet, $column, $key); + if (strpos($column, '->')) { + $column = $this->builder->parseKey($query, $column); + } + + $result = array_column($resultSet, $column, $key); } elseif ($key) { - $result = \array_column($resultSet, null, $key); + $result = array_column($resultSet, null, $key); } else { $result = $resultSet; } diff --git a/vendor/topthink/think-orm/src/model/relation/HasMany.php b/vendor/topthink/think-orm/src/model/relation/HasMany.php index 137fc5cb2..46249555e 100644 --- a/vendor/topthink/think-orm/src/model/relation/HasMany.php +++ b/vendor/topthink/think-orm/src/model/relation/HasMany.php @@ -241,9 +241,13 @@ class HasMany extends Relation */ public function save($data, bool $replace = true) { - $model = $this->make($data); + if ($data instanceof Model) { + $data = $data->getData(); + } + + $model = $this->make(); - return $model->replace($replace)->save() ? $model : false; + return $model->replace($replace)->save($data) ? $model : false; } /** diff --git a/vendor/topthink/think-orm/src/model/relation/MorphMany.php b/vendor/topthink/think-orm/src/model/relation/MorphMany.php index 35f3377c4..ed0dd40aa 100644 --- a/vendor/topthink/think-orm/src/model/relation/MorphMany.php +++ b/vendor/topthink/think-orm/src/model/relation/MorphMany.php @@ -289,6 +289,10 @@ class MorphMany extends Relation */ public function save($data, bool $replace = true) { + if ($data instanceof Model) { + $data = $data->getData(); + } + $model = $this->make(); return $model->replace($replace)->save($data) ? $model : false; diff --git a/vendor/topthink/think-orm/src/model/relation/MorphOne.php b/vendor/topthink/think-orm/src/model/relation/MorphOne.php index 8761b3b1a..d63966ff0 100644 --- a/vendor/topthink/think-orm/src/model/relation/MorphOne.php +++ b/vendor/topthink/think-orm/src/model/relation/MorphOne.php @@ -259,8 +259,12 @@ class MorphOne extends Relation */ public function save($data, bool $replace = true) { - $model = $this->make($data); - return $model->replace($replace)->save() ? $model : false; + if ($data instanceof Model) { + $data = $data->getData(); + } + + $model = $this->make(); + return $model->replace($replace)->save($data) ? $model : false; } /** diff --git a/vendor/topthink/think-orm/src/model/relation/OneToOne.php b/vendor/topthink/think-orm/src/model/relation/OneToOne.php index 62d27b707..d62692aae 100644 --- a/vendor/topthink/think-orm/src/model/relation/OneToOne.php +++ b/vendor/topthink/think-orm/src/model/relation/OneToOne.php @@ -201,9 +201,13 @@ abstract class OneToOne extends Relation */ public function save($data, bool $replace = true) { - $model = $this->make($data); + if ($data instanceof Model) { + $data = $data->getData(); + } + + $model = $this->make(); - return $model->replace($replace)->save() ? $model : false; + return $model->replace($replace)->save($data) ? $model : false; } /** -- Gitee From 5018863b46154947f70ad547e00fb0a5099295ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=94=E4=BA=94?= <15093565100@163.com> Date: Fri, 24 Feb 2023 03:23:36 +0000 Subject: [PATCH 20/30] #I6HGHG update public/themes/admin_simpleboot3/admin/recycle_bin/index.html. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 五五 <15093565100@163.com> --- public/themes/admin_simpleboot3/admin/recycle_bin/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/public/themes/admin_simpleboot3/admin/recycle_bin/index.html b/public/themes/admin_simpleboot3/admin/recycle_bin/index.html index d476d9420..95c7aa15d 100644 --- a/public/themes/admin_simpleboot3/admin/recycle_bin/index.html +++ b/public/themes/admin_simpleboot3/admin/recycle_bin/index.html @@ -5,7 +5,7 @@ -
+
$status = [lang('HIDDEN'), lang('DISPLAY')]; - $target = ['_blank'=>'新窗口', '_self'=>'当前窗口', '_parent'=>'父窗口', '_top'=>'主窗口']; + $target = [''=>'','_blank'=>'新窗口', '_self'=>'当前窗口', '_parent'=>'父窗口', '_top'=>'主窗口']; -- Gitee From 271f56787accd4448eea128b6e96f0445e9d840c Mon Sep 17 00:00:00 2001 From: dean Date: Sat, 25 Feb 2023 15:27:54 +0800 Subject: [PATCH 23/30] =?UTF-8?q?=E4=BC=98=E5=8C=96=E4=B8=8A=E4=BC=A0?= =?UTF-8?q?=E9=A1=B5=E9=9D=A2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin_simpleboot3/user/webuploader.html | 118 ++++++++++-------- 1 file changed, 63 insertions(+), 55 deletions(-) diff --git a/public/themes/admin_simpleboot3/user/webuploader.html b/public/themes/admin_simpleboot3/user/webuploader.html index f90d1ff3b..a72f41542 100644 --- a/public/themes/admin_simpleboot3/user/webuploader.html +++ b/public/themes/admin_simpleboot3/user/webuploader.html @@ -11,7 +11,7 @@ margin-bottom: 0; } - #uploader .statusBar{ + #uploader .statusBar { padding: 0 15px; } @@ -19,11 +19,15 @@ line-height: 1.2 !important; vertical-align: middle; } + + #info { + margin-top: 5px; + } -
+
-
+
@@ -47,6 +51,7 @@

或将文件拖到这里,单次最多可选{$max_files}个文件

+

如果开启云存储后,大文件请在云存储里上传

-
请输入网络地址 -
- - +
+
+ +
+ + +
@@ -93,24 +101,24 @@ var idPre = 'id' + new Date().getTime(); if (jQuery("#wrapper").is(":hidden")) { - var file = new Object(); - file.id = idPre + '1'; - file.filepath = jQuery("#info").val(); + var file = new Object(); + file.id = idPre + '1'; + file.filepath = jQuery("#info").val(); file.preview_url = file.filepath; - file.url = file.filepath; - file.name = "";//jQuery(".filelist li .title").eq(i).html(); + file.url = file.filepath; + file.name = "";//jQuery(".filelist li .title").eq(i).html(); files.push(file); } else { var number = jQuery(".filelist li").size(); for (var i = 0; i < number; i++) { - var file = new Object(); - var $file = jQuery(".filelist li").eq(i); - file.id = idPre + i; - file.filepath = $file.data("filepath"); + var file = new Object(); + var $file = jQuery(".filelist li").eq(i); + file.id = idPre + i; + file.filepath = $file.data("filepath"); file.preview_url = $file.data("preview_url");//httpUrl+file.filepath; - file.url = $file.data("url"); - file.name = $file.data("name"); + file.url = $file.data("url"); + file.name = $file.data("name"); if (file.url == undefined) { continue; } else { @@ -123,7 +131,7 @@ return files; } - var multi = {$multi};//是否允许同时选多个文件 + var multi = {$multi};//是否允许同时选多个文件 var maxFiles = {$max_files};//允许上传多少文件 var fileErrorMsg = {}; @@ -132,34 +140,34 @@ (function ($) { // 当domReady的时候开始初始化 $(function () { - var $wrap = $('#uploader'), + var $wrap = $('#uploader'), // 图片容器 - $queue = $('
    ').appendTo($wrap.find('.queueList')), + $queue = $('
      ').appendTo($wrap.find('.queueList')), // 状态栏,包括进度和控制按钮 - $statusBar = $wrap.find('.statusBar'), + $statusBar = $wrap.find('.statusBar'), // 文件总体选择信息。 - $info = $statusBar.find('.info'), + $info = $statusBar.find('.info'), // 上传按钮 - $upload = $wrap.find('.uploadBtn').hide(), + $upload = $wrap.find('.uploadBtn').hide(), // 没选择文件之前的内容。 - $placeHolder = $wrap.find('.placeholder'), - $progress = $statusBar.find('.progress').hide(), + $placeHolder = $wrap.find('.placeholder'), + $progress = $statusBar.find('.progress').hide(), // 添加的文件数量 - fileCount = 0, + fileCount = 0, // 添加的文件总大小 - fileSize = 0, + fileSize = 0, // 优化retina, 在retina下这个值是2 - ratio = window.devicePixelRatio || 1, + ratio = window.devicePixelRatio || 1, // 缩略图大小 - thumbnailWidth = 110 * ratio, - thumbnailHeight = 110 * ratio, + thumbnailWidth = 110 * ratio, + thumbnailHeight = 110 * ratio, // 可能有pedding, ready, uploading, confirm, done. - state = 'pedding', + state = 'pedding', // 所有文件的进度信息,key为file id - percentages = {}, + percentages = {}, // 判断浏览器是否支持图片的base64 - isSupportBase64 = (function () { - var data = new Image(); + isSupportBase64 = (function () { + var data = new Image(); var support = true; data.onload = data.onerror = function () { if (this.width != 1 || this.height != 1) { @@ -170,7 +178,7 @@ return support; })(), // 检测是否已经安装flash,检测flash的版本 - flashVersion = (function () { + flashVersion = (function () { var version; try { version = navigator.plugins['Shockwave Flash']; @@ -193,7 +201,7 @@ 'MozTransition' in s || 'msTransition' in s || 'OTransition' in s; - s = null; + s = null; return r; })(), @@ -222,7 +230,7 @@ delete window['expressinstallcallback']; }; - var swf = './expressInstall.swf'; + var swf = './expressInstall.swf'; // insert flash object var html = '' + - '

      ' + file.name + '

      ' + - '

      ' + - '

      ' + - ''), + var $li = $('
    • ' + + '

      ' + file.name + '

      ' + + '

      ' + + '

      ' + + '
    • '), - $btns = $('
      ' + + $btns = $('
      ' + '删除' + '向右旋转' + '向左旋转
      ').appendTo($li), - $prgress = $li.find('p.progress span'), - $wrap = $li.find('p.imgWrap'), - $info = $('

      '), + $prgress = $li.find('p.progress span'), + $wrap = $li.find('p.imgWrap'), + $info = $('

      '), showError = function (code) { switch (code) { @@ -389,7 +397,7 @@ }, thumbnailWidth, thumbnailHeight); percentages[file.id] = [file.size, 0]; - file.rotation = 0; + file.rotation = 0; } file.on('statuschange', function (cur, prev) { @@ -489,8 +497,8 @@ function updateTotalProgress() { var loaded = 0, - total = 0, - spans = $progress.children(), + total = 0, + spans = $progress.children(), percent; $.each(percentages, function (k, v) { @@ -604,7 +612,7 @@ } uploader.onUploadProgress = function (file, percentage) { - var $li = $('#' + file.id), + var $li = $('#' + file.id), $percent = $li.find('.progress span'); $percent.css('width', percentage * 100 + '%'); -- Gitee From 20d789249e95aa3efbdbefe7fa4bbd496c86e0c1 Mon Sep 17 00:00:00 2001 From: dean Date: Sat, 25 Feb 2023 16:25:38 +0800 Subject: [PATCH 24/30] =?UTF-8?q?=E5=8D=87=E7=BA=A7=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 16 ++- .../admin_simpleboot3/admin/hook/index.html | 4 +- vendor/services.php | 2 +- .../src/admin/controller/UserController.php | 102 ++++++++++++++++++ .../src/admin/service/EmailService.php | 75 +++++++++++++ .../service/impl/AdminMenuServiceImpl.php | 3 +- .../src/user/controller/LoginController.php | 28 +++-- .../user/controller/RegisterController.php | 34 ++++-- .../controller/VerificationCodeController.php | 31 ++++-- .../cmf/src/listener/InitHookListener.php | 3 +- .../cmf/src/listener/ModuleInitListener.php | 4 +- 11 files changed, 266 insertions(+), 36 deletions(-) create mode 100644 vendor/thinkcmf/cmf-app/src/admin/service/EmailService.php diff --git a/README.md b/README.md index 6c41316c0..775b5067c 100644 --- a/README.md +++ b/README.md @@ -121,8 +121,20 @@ https://gitee.com/thinkcmf/docker 5. `composer update` ### 更新日志 -#### 6.0.8 coding~ -* ... +#### 6.0.8 +* 更新TP到`6.0.14` +* 优化上传对话框逻辑 +* 优化钩子管理界面 +* 修复后台部分URL刷新不加载 +* 修复幻灯片页面管理报错 +* 优化后台管理员添加编辑逻辑增加安全性 +* 增加应用轻量级命令行第三方库支持 +* 优化缓存清理 +* 优化路由识别 +* 优化系统文件加载 +* 增加注册登录和验证码界面第三方验证码支持 +* 补全缺失语言包 +* 增加后台管理员个人邮件功能 #### 6.0.7 * 升级到`tp6.0.13` diff --git a/public/themes/admin_simpleboot3/admin/hook/index.html b/public/themes/admin_simpleboot3/admin/hook/index.html index 0012aa95f..96e67e91b 100644 --- a/public/themes/admin_simpleboot3/admin/hook/index.html +++ b/public/themes/admin_simpleboot3/admin/hook/index.html @@ -13,7 +13,6 @@
      - @@ -23,8 +22,7 @@ - - +
      ID {:lang('NAME')} {:lang('Type')} {:lang('Description')}
      {$vo.id}{$vo.name}:{$vo.hook}{$vo.name}:{$vo.hook} {$types[$vo.type]} {$vo.description} diff --git a/vendor/services.php b/vendor/services.php index 0ed5d8035..6c02dee17 100644 --- a/vendor/services.php +++ b/vendor/services.php @@ -1,5 +1,5 @@ 'app\\admin\\AppStoreService', diff --git a/vendor/thinkcmf/cmf-app/src/admin/controller/UserController.php b/vendor/thinkcmf/cmf-app/src/admin/controller/UserController.php index 5d7eb8c41..bf531c981 100644 --- a/vendor/thinkcmf/cmf-app/src/admin/controller/UserController.php +++ b/vendor/thinkcmf/cmf-app/src/admin/controller/UserController.php @@ -14,8 +14,10 @@ use app\admin\logic\UserLogic; use app\admin\model\RoleModel; use app\admin\model\RoleUserModel; use app\admin\model\UserModel; +use app\admin\service\EmailService; use cmf\controller\AdminBaseController; use think\db\Query; +use think\Validate; /** * Class UserController @@ -397,4 +399,104 @@ class UserController extends AdminBaseController } } } + + /** + * 我的邮箱设置 + * @adminMenu( + * 'name' => '我的邮箱设置', + * 'parent' => 'admin/Setting/default', + * 'display'=> true, + * 'hasView'=> true, + * 'order' => 10000, + * 'icon' => 'email', + * 'remark' => '我的邮箱设置', + * 'param' => '' + * ) + */ + public function emailSetting() + { + $adminId = cmf_get_current_admin_id(); + $emailSetting = cmf_get_option('admin_smtp_setting_' . $adminId); + + $this->assign($emailSetting); + + return $this->fetch(); + } + + /** + * 我的邮箱设置提交保存 + * @adminMenu( + * 'name' => '我的邮箱设置提交保存', + * 'parent' => 'emailSetting', + * 'display'=> false, + * 'hasView'=> false, + * 'order' => 10000, + * 'icon' => '', + * 'remark' => '我的邮箱设置提交保存', + * 'param' => '' + * ) + */ + public function emailSettingPost() + { + if ($this->request->isPost()) { + $post = array_map('trim', $this->request->param()); + + if (in_array('', $post) && !empty($post['smtpsecure'])) { + $this->error("不能留空!"); + } + + $adminId = cmf_get_current_admin_id(); + cmf_set_option('admin_smtp_setting_' . $adminId, $post); + + $this->success(lang('EDIT_SUCCESS')); + } + } + + /** + * 我的邮箱设置测试 + * @adminMenu( + * 'name' => '我的邮箱设置测试', + * 'parent' => 'admin/Setting/default', + * 'display'=> false, + * 'hasView'=> true, + * 'order' => 10000, + * 'icon' => 'email', + * 'remark' => '我的邮箱设置测试', + * 'param' => '' + * ) + */ + public function emailSettingTest() + { + if ($this->request->isPost()) { + + $validate = new Validate(); + $validate->rule([ + 'to' => 'require|email', + 'subject' => 'require', + 'content' => 'require', + ]); + $validate->message([ + 'to.require' => '收件箱不能为空!', + 'to.email' => '收件箱格式不正确!', + 'subject.require' => '标题不能为空!', + 'content.require' => '内容不能为空!', + ]); + + $data = $this->request->param(); + if (!$validate->check($data)) { + $this->error($validate->getError()); + } + + $result = EmailService::send($data['to'], $data['subject'], $data['content']); + if ($result && empty($result['error'])) { + $this->success('发送成功!'); + } else { + $this->error('发送失败:' . $result['message']); + } + + } else { + return $this->fetch(); + } + } + } diff --git a/vendor/thinkcmf/cmf-app/src/admin/service/EmailService.php b/vendor/thinkcmf/cmf-app/src/admin/service/EmailService.php new file mode 100644 index 000000000..3d8f32439 --- /dev/null +++ b/vendor/thinkcmf/cmf-app/src/admin/service/EmailService.php @@ -0,0 +1,75 @@ + +// +---------------------------------------------------------------------- +namespace app\admin\service; + +use app\admin\model\LinkModel; +use app\admin\model\SlideItemModel; +use app\admin\model\SlideModel; + +class EmailService +{ + public static function send($address, $subject, $message, $attachments = []) + { + $adminId = cmf_get_current_admin_id(); + $smtpSetting = cmf_get_option('admin_smtp_setting_' . $adminId); + if (empty($smtpSetting)) { + return ["error" => 1, "message" => '没有邮箱配置!']; + } + + $mail = new \PHPMailer\PHPMailer\PHPMailer(); + // 设置PHPMailer使用SMTP服务器发送Email + $mail->IsSMTP(); + $mail->IsHTML(true); + //$mail->SMTPDebug = 3; + // 设置邮件的字符编码,若不指定,则为'UTF-8' + $mail->CharSet = 'UTF-8'; + // 添加收件人地址,可以多次使用来添加多个收件人 + $mail->AddAddress($address); + // 设置邮件正文 + $mail->Body = $message . htmlspecialchars_decode($smtpSetting['signature']); + // 设置邮件头的From字段。 + $mail->From = $smtpSetting['from']; + // 设置发件人名字 + $mail->FromName = $smtpSetting['from_name']; + // 设置邮件标题 + $mail->Subject = $subject; + + if (!empty($attachments)) { + foreach ($attachments as $name => $attachment) { + $mail->addAttachment($attachment, $name); + } + } + + // 设置SMTP服务器。 + $mail->Host = $smtpSetting['host']; + //by Rainfer + // 设置SMTPSecure。 + $Secure = $smtpSetting['smtp_secure']; + $mail->SMTPSecure = empty($Secure) ? '' : $Secure; + // 设置SMTP服务器端口。 + $port = $smtpSetting['port']; + $mail->Port = empty($port) ? "25" : $port; + // 设置为"需要验证" + $mail->SMTPAuth = true; + $mail->SMTPAutoTLS = false; + $mail->Timeout = 10; + // 设置用户名和密码。 + $mail->Username = $smtpSetting['username']; + $mail->Password = $smtpSetting['password']; + // 发送邮件。 + if (!$mail->Send()) { + $mailError = $mail->ErrorInfo; + return ["error" => 1, "message" => $mailError]; + } else { + return ["error" => 0, "message" => "success"]; + } + } +} diff --git a/vendor/thinkcmf/cmf-app/src/admin/service/impl/AdminMenuServiceImpl.php b/vendor/thinkcmf/cmf-app/src/admin/service/impl/AdminMenuServiceImpl.php index 10a828b2d..a5fe4c271 100644 --- a/vendor/thinkcmf/cmf-app/src/admin/service/impl/AdminMenuServiceImpl.php +++ b/vendor/thinkcmf/cmf-app/src/admin/service/impl/AdminMenuServiceImpl.php @@ -15,9 +15,10 @@ namespace app\admin\service\impl; use app\admin\model\AdminMenuModel; use app\admin\service\AdminMenuService; -#[\AllowDynamicProperties] class AdminMenuServiceImpl implements AdminMenuService { + private $model; + public function __construct(AdminMenuModel $model) { $this->model = $model; diff --git a/vendor/thinkcmf/cmf-app/src/user/controller/LoginController.php b/vendor/thinkcmf/cmf-app/src/user/controller/LoginController.php index cf4e2ddcb..990d4d8a7 100644 --- a/vendor/thinkcmf/cmf-app/src/user/controller/LoginController.php +++ b/vendor/thinkcmf/cmf-app/src/user/controller/LoginController.php @@ -122,7 +122,7 @@ class LoginController extends HomeBaseController if ($this->request->isPost()) { $validate = new \think\Validate(); $validate->rule([ - 'captcha' => 'require', + //'captcha' => 'require', 'verification_code' => 'require', 'password' => 'require|min:6|max:32', ]); @@ -139,16 +139,28 @@ class LoginController extends HomeBaseController $this->error($validate->getError()); } - $captchaId = empty($data['_captcha_id']) ? '' : $data['_captcha_id']; - if (!cmf_captcha_check($data['captcha'], $captchaId)) { - $this->error('验证码错误'); - } + $result = hook_one("check_third_party_captcha"); - $errMsg = cmf_check_verification_code($data['username'], $data['verification_code']); - if (!empty($errMsg)) { - $this->error($errMsg); + if ($result) { + if (is_string($result)) { + $this->error($result); + } + } else { + if(empty($data['captcha'])){ + $this->error('验证码不能为空!'); + } + $captchaId = empty($data['_captcha_id']) ? '' : $data['_captcha_id']; + if (!cmf_captcha_check($data['captcha'], $captchaId)) { + $this->error('验证码错误'); + } + + $errMsg = cmf_check_verification_code($data['username'], $data['verification_code']); + if (!empty($errMsg)) { + $this->error($errMsg); + } } + $userModel = new UserModel(); if (Validate::is($data['username'], 'email')) { diff --git a/vendor/thinkcmf/cmf-app/src/user/controller/RegisterController.php b/vendor/thinkcmf/cmf-app/src/user/controller/RegisterController.php index cd560a4ba..45af24e09 100644 --- a/vendor/thinkcmf/cmf-app/src/user/controller/RegisterController.php +++ b/vendor/thinkcmf/cmf-app/src/user/controller/RegisterController.php @@ -44,7 +44,7 @@ class RegisterController extends HomeBaseController { if ($this->request->isPost()) { $rules = [ - 'captcha' => 'require', +// 'captcha' => 'require', 'code' => 'require', 'password' => 'require|min:6|max:32', @@ -54,8 +54,6 @@ class RegisterController extends HomeBaseController if ($isOpenRegistration) { unset($rules['code']); - } else { - $this->error('未开放注册功能!'); } $validate = new \think\Validate($rules); @@ -70,10 +68,32 @@ class RegisterController extends HomeBaseController if (!$validate->check($data)) { $this->error($validate->getError()); } - // 手机或短信验证码 - $errMsg = cmf_check_verification_code($data['username'], $data['code']); - if (!empty($errMsg)) { - $this->error($errMsg); + + + if (!$isOpenRegistration) { + + $result = hook_one("check_third_party_captcha"); + + if ($result) { + if (is_string($result)) { + $this->error($result); + } + } else { + if(empty($data['captcha'])){ + $this->error('验证码不能为空!'); + } + $captchaId = empty($data['_captcha_id']) ? '' : $data['_captcha_id']; + + if (!cmf_captcha_check($data['captcha'], $captchaId)) { + $this->error('验证码错误'); + } + } + + $errMsg = cmf_check_verification_code($data['username'], $data['code']); + if (!empty($errMsg)) { + $this->error($errMsg); + } + } $register = new UserModel(); diff --git a/vendor/thinkcmf/cmf-app/src/user/controller/VerificationCodeController.php b/vendor/thinkcmf/cmf-app/src/user/controller/VerificationCodeController.php index 07b8866ba..aaa33eda9 100644 --- a/vendor/thinkcmf/cmf-app/src/user/controller/VerificationCodeController.php +++ b/vendor/thinkcmf/cmf-app/src/user/controller/VerificationCodeController.php @@ -23,7 +23,7 @@ class VerificationCodeController extends HomeBaseController $validate = new \think\Validate(); $validate->rule([ 'username' => 'require', - 'captcha' => 'require', +// 'captcha' => 'require', ]); $validate->message([ 'username.require' => '请输入手机号或邮箱!', @@ -35,18 +35,29 @@ class VerificationCodeController extends HomeBaseController $this->error($validate->getError()); } - $captchaId = empty($data['captcha_id']) ? '' : $data['captcha_id']; - if (!cmf_captcha_check($data['captcha'], $captchaId, false)) { - $this->error('图片验证码错误!'); - } + $result = hook_one("check_third_party_captcha"); - $registerCaptcha = session('register_captcha'); + if ($result) { + if (is_string($result)) { + $this->error($result); + } + } else { + if (empty($data['captcha'])) { + $this->error('图片验证码不能为空!'); + } + $captchaId = empty($data['captcha_id']) ? '' : $data['captcha_id']; + if (!cmf_captcha_check($data['captcha'], $captchaId, false)) { + $this->error('图片验证码错误!'); + } + + $registerCaptcha = session('register_captcha'); - session('register_captcha', $data['captcha']); + session('register_captcha', $data['captcha']); - if ($registerCaptcha == $data['captcha']) { - cmf_captcha_check($data['captcha'], $captchaId, true); - $this->error('请输入新图片验证码!'); + if ($registerCaptcha == $data['captcha']) { + cmf_captcha_check($data['captcha'], $captchaId, true); + $this->error('请输入新图片验证码!'); + } } $accountType = ''; diff --git a/vendor/thinkcmf/cmf/src/listener/InitHookListener.php b/vendor/thinkcmf/cmf/src/listener/InitHookListener.php index 8157ed84c..01f0c10a4 100755 --- a/vendor/thinkcmf/cmf/src/listener/InitHookListener.php +++ b/vendor/thinkcmf/cmf/src/listener/InitHookListener.php @@ -17,10 +17,9 @@ use think\facade\Db; use think\facade\Response; use think\facade\Route; -#[\AllowDynamicProperties] class InitHookListener { - + private $app; // 行为扩展的执行入口必须是run public function handle($param) { diff --git a/vendor/thinkcmf/cmf/src/listener/ModuleInitListener.php b/vendor/thinkcmf/cmf/src/listener/ModuleInitListener.php index b0db72813..6308c9ea9 100644 --- a/vendor/thinkcmf/cmf/src/listener/ModuleInitListener.php +++ b/vendor/thinkcmf/cmf/src/listener/ModuleInitListener.php @@ -17,16 +17,16 @@ use think\facade\Event; use think\facade\Response; use think\facade\Route; -#[\AllowDynamicProperties] class ModuleInitListener { + private $app; // 行为扩展的执行入口必须是run public function handle($param) { /**--start InitAppHookListener--------------------------------------*/ $this->app = app(); $appName = $this->app->http->getName(); - + if (!is_dir($this->app->getAppPath() . $appName) && !is_dir(root_path() . "vendor/thinkcmf/cmf-app/src/{$appName}")) { return; } -- Gitee From 7f2a7579b241f69e5be64702bdb8827d6b51e399 Mon Sep 17 00:00:00 2001 From: dean Date: Sat, 25 Feb 2023 17:31:02 +0800 Subject: [PATCH 25/30] =?UTF-8?q?=E5=8D=87=E7=BA=A7=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vendor/thinkcmf/cmf-app/README.md | 7 +++++++ vendor/thinkcmf/cmf/README.md | 7 +++++++ version | 2 +- 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/vendor/thinkcmf/cmf-app/README.md b/vendor/thinkcmf/cmf-app/README.md index fed342b3a..7ec1b3917 100644 --- a/vendor/thinkcmf/cmf-app/README.md +++ b/vendor/thinkcmf/cmf-app/README.md @@ -1,6 +1,13 @@ # ThinkCMF核心应用 ## 更新日志 +### v6.0.15 +* 修复幻灯片xxs 漏洞 +* 增加管理员添加编辑安全性 +* 增加管理员管理个人邮箱设置 +* 补全缺失语言包 +* 增加注册登录和验证码界面第三方验证码支持 + ### v6.0.14 * 优化插件设置更新 diff --git a/vendor/thinkcmf/cmf/README.md b/vendor/thinkcmf/cmf/README.md index 6432939b3..840e3e4e0 100644 --- a/vendor/thinkcmf/cmf/README.md +++ b/vendor/thinkcmf/cmf/README.md @@ -1,6 +1,13 @@ # ThinkCMF核心包 ## 更新日志 +### v6.0.18 +* 更新TP到`6.0.14` +* 修复API上传 +* 增加应用轻量级命令行第三方库支持 +* 优化路由识别 +* 优化系统文件加载 + ### v6.0.17 * 替换`phpquery`包 diff --git a/version b/version index 089b1e69f..65eec2f1c 100644 --- a/version +++ b/version @@ -1 +1 @@ -6.0.7 +6.0.8-dev -- Gitee From b44801ff835f36194e735ee6e62c640b3f8ec50e Mon Sep 17 00:00:00 2001 From: dean Date: Tue, 28 Feb 2023 23:50:43 +0800 Subject: [PATCH 26/30] =?UTF-8?q?=E5=8D=87=E7=BA=A7=E6=97=A5=E5=BF=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 775b5067c..a7dcfa70a 100644 --- a/README.md +++ b/README.md @@ -95,6 +95,9 @@ enjoy your cmf~! https://gitee.com/thinkcmf/docker ### 升级指导 +#### 6.0.7升级到6.0.8 +1. `composer update` + #### 6.0.6升级到6.0.7 1. `composer update` @@ -123,18 +126,19 @@ https://gitee.com/thinkcmf/docker ### 更新日志 #### 6.0.8 * 更新TP到`6.0.14` +* 增加应用轻量级命令行第三方库支持 +* 增加注册登录和验证码界面第三方验证码支持 +* 增加后台管理员个人邮件功能 * 优化上传对话框逻辑 * 优化钩子管理界面 -* 修复后台部分URL刷新不加载 -* 修复幻灯片页面管理报错 * 优化后台管理员添加编辑逻辑增加安全性 -* 增加应用轻量级命令行第三方库支持 * 优化缓存清理 * 优化路由识别 * 优化系统文件加载 -* 增加注册登录和验证码界面第三方验证码支持 +* 修复后台部分URL刷新不加载 +* 修复幻灯片页面管理报错 * 补全缺失语言包 -* 增加后台管理员个人邮件功能 + #### 6.0.7 * 升级到`tp6.0.13` -- Gitee From b502db8fa81cdfb41139ed5ebcd7ee0d5195d957 Mon Sep 17 00:00:00 2001 From: dean Date: Thu, 2 Mar 2023 00:29:33 +0800 Subject: [PATCH 27/30] =?UTF-8?q?=E7=AE=A1=E7=90=86=E5=91=98=E9=82=AE?= =?UTF-8?q?=E7=AE=B1=E8=AE=BE=E7=BD=AE=E6=A8=A1=E6=9D=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../admin/user/email_setting.html | 107 ++++++++++++++++++ .../admin/user/email_setting_test.html | 33 ++++++ 2 files changed, 140 insertions(+) create mode 100755 public/themes/admin_simpleboot3/admin/user/email_setting.html create mode 100755 public/themes/admin_simpleboot3/admin/user/email_setting_test.html diff --git a/public/themes/admin_simpleboot3/admin/user/email_setting.html b/public/themes/admin_simpleboot3/admin/user/email_setting.html new file mode 100755 index 000000000..4e1fd45cd --- /dev/null +++ b/public/themes/admin_simpleboot3/admin/user/email_setting.html @@ -0,0 +1,107 @@ + + + +
      + + +
      + +
      + +
      +
      +
      + +
      + +
      +
      +
      + +
      + +
      +
      +
      + +
      + +
      +
      +
      + +
      + +
      +
      +
      + +
      + +
      +
      +
      + +
      + +
      +
      +
      + +
      + + +
      +
      +
      +
      + + 测试邮件 +
      +
      + +
      + + + + + + + + diff --git a/public/themes/admin_simpleboot3/admin/user/email_setting_test.html b/public/themes/admin_simpleboot3/admin/user/email_setting_test.html new file mode 100755 index 000000000..7b62d9ecf --- /dev/null +++ b/public/themes/admin_simpleboot3/admin/user/email_setting_test.html @@ -0,0 +1,33 @@ + + + +
      +
      +
      + +
      + +
      +
      +
      + +
      + +
      +
      +
      + +
      + +
      +
      +
      +
      + +
      +
      +
      +
      + + + -- Gitee From 308556dc0c718b173ebae42622423b17456d9d2f Mon Sep 17 00:00:00 2001 From: dean Date: Thu, 2 Mar 2023 00:30:45 +0800 Subject: [PATCH 28/30] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E7=BC=BA=E5=A4=B1?= =?UTF-8?q?=E6=A8=A1=E6=9D=BF=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/themes/admin_simpleboot3/public/base.html | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100755 public/themes/admin_simpleboot3/public/base.html diff --git a/public/themes/admin_simpleboot3/public/base.html b/public/themes/admin_simpleboot3/public/base.html new file mode 100755 index 000000000..176c08b5a --- /dev/null +++ b/public/themes/admin_simpleboot3/public/base.html @@ -0,0 +1,10 @@ + + + + + + + + + + -- Gitee From 0f07bc438a9884ead64f8419826d5ecce3c82e1d Mon Sep 17 00:00:00 2001 From: dean Date: Thu, 2 Mar 2023 00:31:59 +0800 Subject: [PATCH 29/30] =?UTF-8?q?=E5=90=8E=E5=8F=B0=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E6=8F=8F=E8=BF=B0=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/themes/admin_simpleboot3/manifest.json | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100755 public/themes/admin_simpleboot3/manifest.json diff --git a/public/themes/admin_simpleboot3/manifest.json b/public/themes/admin_simpleboot3/manifest.json new file mode 100755 index 000000000..dd9cb6aa5 --- /dev/null +++ b/public/themes/admin_simpleboot3/manifest.json @@ -0,0 +1,9 @@ +{ + "name": "admin_simpleboot3", + "version": "6.0.5", + "demo_url": "http://demo.thinkcmf.com", + "author": "ThinkCMF", + "author_url": "http://www.thinkcmf.com", + "keywords": "ThinkCMF默认后台模板", + "description": "ThinkCMF默认后台模板" +} -- Gitee From 63ab9f5f1585f328638b34597fa1a1767309ac5c Mon Sep 17 00:00:00 2001 From: dean Date: Thu, 2 Mar 2023 00:34:01 +0800 Subject: [PATCH 30/30] 6.0.8 --- README.md | 4 ++-- version | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a7dcfa70a..2a032b93b 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -ThinkCMF 6.0.8 开发版 +ThinkCMF 6.0.8 让你更自由地飞 =============== -**`6.0.8`正在紧张开发中,请不要用于正式环境!实际项目请下载最新正式版`6.0.7`** +欢迎入坑,有问题请及时提交issue! ### 主要特性 diff --git a/version b/version index 65eec2f1c..4b786f575 100644 --- a/version +++ b/version @@ -1 +1 @@ -6.0.8-dev +6.0.8 -- Gitee