升级库/添加附件/404/数据库安装修复
This commit is contained in:
parent
8f8b00359d
commit
e8ffd4f003
@ -4,5 +4,6 @@ namespace app;
|
||||
// 应用请求对象类
|
||||
class Request extends \think\Request
|
||||
{
|
||||
|
||||
//过滤空格
|
||||
protected $filter = ['trim'];
|
||||
}
|
||||
|
@ -6,7 +6,7 @@ use think\Validate;
|
||||
class User extends Validate
|
||||
{
|
||||
protected $rule = [
|
||||
'name|用户名' => 'require|min:2|max:18|unique:user',
|
||||
'name|用户名' => 'require|min:2|max:18|chsDash|unique:user',
|
||||
'email|邮箱' => 'require|email|unique:user',
|
||||
'password|密码' => 'require|min:6|max:20',
|
||||
'repassword|确认密码'=>'require|confirm:password',
|
||||
|
@ -57,6 +57,9 @@ class Article extends BaseController
|
||||
$cateId = Db::name('cate')->where('ename',$ename)->value('id');
|
||||
if($cateId){
|
||||
$where = ['cate_id' => $cateId];
|
||||
} else {
|
||||
// 抛出 HTTP 异常
|
||||
throw new \think\exception\HttpException(404, '异常消息');
|
||||
}
|
||||
|
||||
$artList = Cache::get('arts'.$ename.$type.$page);
|
||||
@ -148,7 +151,7 @@ class Article extends BaseController
|
||||
$article = Cache::get('article_'.$id);
|
||||
if(!$article){
|
||||
//查询文章
|
||||
$article = ArticleModel::field('id,title,content,status,cate_id,user_id,is_top,is_hot,is_reply,pv,jie,tags,title_color,create_time')->where('status',1)->with([
|
||||
$article = ArticleModel::field('id,title,content,status,cate_id,user_id,is_top,is_hot,is_reply,pv,jie,upzip,tags,title_color,create_time')->where('status',1)->with([
|
||||
'cate' => function($query){
|
||||
$query->where('delete_time',0)->field('id,catename');
|
||||
},
|
||||
@ -158,9 +161,14 @@ class Article extends BaseController
|
||||
])->find($id);
|
||||
Cache::tag('tagArtDetail')->set('article_'.$id,$article,3600);
|
||||
}
|
||||
if(!$article){
|
||||
// 抛出 HTTP 异常
|
||||
throw new \think\exception\HttpException(404, '异常消息');
|
||||
}
|
||||
$comments = $article->comments()->where('status',1)->order(['cai'=>'asc','create_time'=>'asc'])->paginate(10);
|
||||
$article->inc('pv')->update();
|
||||
$pv = Db::name('article')->field('pv')->where('id',$id)->value('pv');
|
||||
$download = download($article->upzip,'file');
|
||||
|
||||
/*
|
||||
$nt = time();
|
||||
@ -184,7 +192,7 @@ class Article extends BaseController
|
||||
//通用右栏
|
||||
$ad_comm = Db::name('slider')->where('slid_status',1)->where('delete_time',0)->where('slid_type',2)->whereTime('slid_over','>=',time())->select();
|
||||
|
||||
View::assign(['article'=>$article,'pv'=>$pv,'comments'=>$comments,'artHot'=>$artHot,'ad_art'=>$ad_article,'ad_comm'=>$ad_comm]);
|
||||
View::assign(['article'=>$article,'pv'=>$pv,'comments'=>$comments,'artHot'=>$artHot,'ad_art'=>$ad_article,'ad_comm'=>$ad_comm,$download]);
|
||||
return View::fetch();
|
||||
}
|
||||
|
||||
@ -249,6 +257,36 @@ class Article extends BaseController
|
||||
return View::fetch();
|
||||
}
|
||||
|
||||
//上传附件
|
||||
public function upzip()
|
||||
{
|
||||
$file = request()->file('file');
|
||||
try {
|
||||
validate(['file'=>'fileSize:1024000|fileExt:jpg,zip'])
|
||||
->check(['file'=>$file]);
|
||||
$savename = \think\facade\Filesystem::disk('public')->putFile('article_zip',$file);
|
||||
} catch (ValidateException $e) {
|
||||
return json(['status'=>-1,'msg'=>$e->getMessage()]);
|
||||
}
|
||||
$upload = Config::get('filesystem.disks.public.url');
|
||||
|
||||
if($savename){
|
||||
$name_path =str_replace('\\',"/",$upload.'/'.$savename);
|
||||
$res = ['status'=>0,'msg'=>'上传成功','url'=> $name_path];
|
||||
}else{
|
||||
$res = ['status'=>-1,'msg'=>'上传错误'];
|
||||
}
|
||||
return json($res);
|
||||
}
|
||||
|
||||
//附件下载
|
||||
public function download($id)
|
||||
{
|
||||
$zipdir = Db::name('article')->where('id',$id)->value('upzip');
|
||||
$zip = substr($zipdir,1);
|
||||
return download($zip,'my');
|
||||
}
|
||||
|
||||
//添加tag
|
||||
public function tags()
|
||||
{
|
||||
|
@ -2,12 +2,12 @@
|
||||
namespace app\index\controller;
|
||||
|
||||
use think\facade\View;
|
||||
use app\common\controller\BaseController;
|
||||
|
||||
class Error
|
||||
class Error extends BaseController
|
||||
{
|
||||
public function __call($method, $args)
|
||||
{
|
||||
//return 'error request!';
|
||||
return View::fetch('404');
|
||||
return View::fetch('error/404');
|
||||
}
|
||||
}
|
@ -199,7 +199,11 @@ class User extends BaseController
|
||||
public function logout()
|
||||
{
|
||||
Session::clear();
|
||||
return json(array('code' => 200, 'msg' => '退出成功'));
|
||||
if(Session::has('user_id')){
|
||||
return json(['code' => -1, 'msg' => '退出失败']);
|
||||
} else {
|
||||
return json(['code' => 200, 'msg' => '退出成功', 'url' => '/']);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
@ -56,7 +56,7 @@ DROP TABLE IF EXISTS `tao_auth_group`;
|
||||
CREATE TABLE `tao_auth_group` (
|
||||
`id` mediumint(8) unsigned NOT NULL AUTO_INCREMENT COMMENT '角色ID',
|
||||
`title` varchar(100) NOT NULL DEFAULT '' COMMENT '角色名称',
|
||||
`rules` varchar(500) NOT NULL DEFAULT '', COMMENT '拥有权限',
|
||||
`rules` varchar(500) NOT NULL DEFAULT '' COMMENT '拥有权限',
|
||||
`limits` varchar(255) NOT NULL DEFAULT '' COMMENT '权限范围',
|
||||
`descr` varchar(255) NOT NULL DEFAULT '' COMMENT '权限描述',
|
||||
`status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '角色状态1可用0禁止',
|
||||
@ -344,7 +344,7 @@ CREATE TABLE `tao_user` (
|
||||
`city` varchar(50) NOT NULL DEFAULT '' COMMENT '归属地',
|
||||
`sex` enum('0','1') NOT NULL DEFAULT '0' COMMENT '性别0男1女',
|
||||
`sign` varchar(255) NOT NULL DEFAULT '' COMMENT '签名',
|
||||
`user_img` varbinary(70) NOT NULL DEFAULT '' COMMENT '头像',
|
||||
`user_img` varchar(70) NOT NULL DEFAULT '' COMMENT '头像',
|
||||
`auth` enum('1','0') NOT NULL DEFAULT '0' COMMENT '管理员权限0普通1超级',
|
||||
`point` int(11) NOT NULL DEFAULT '0' COMMENT '积分',
|
||||
`area_id` int(11) DEFAULT NULL COMMENT '用户所属区域ID',
|
||||
@ -361,7 +361,7 @@ CREATE TABLE `tao_user` (
|
||||
PRIMARY KEY (`id`)
|
||||
) ENGINE=MyISAM AUTO_INCREMENT=2 DEFAULT CHARSET=utf8;
|
||||
|
||||
INSERT INTO `tao_user` VALUES ('1', 'admin', '95d6f8d0d0c3b45e5dbe4057da1b149e', '2147483647', 'admin@qq.com', '管理员', '北京市', '1', '这是我的第一个TP5系统,2019北京。OK! OK!ok@', 0x2F73746F726167652F686561645F7069632F32303139313231372F39343036636334623866336538323731613238616339646239353339333766352E6A7067, '1', '14', '1', '1', '0', '127.0.0.1', '0', '0', '0', '0', '1579053025', '1578469091', '0');
|
||||
INSERT INTO `tao_user` VALUES ('1', 'admin', '95d6f8d0d0c3b45e5dbe4057da1b149e', '2147483647', 'admin@qq.com', '管理员', '北京市', '1', '这是我的第一个TP5系统,2019北京。OK! OK!ok@', '/static/res/images/avatar/00.jpg', '1', '14', '1', '1', '0', '127.0.0.1', '0', '0', '0', '0', '1579053025', '1578469091', '0');
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `tao_user_area`;
|
||||
|
107
composer.lock
generated
107
composer.lock
generated
@ -151,16 +151,16 @@
|
||||
},
|
||||
{
|
||||
"name": "opis/closure",
|
||||
"version": "3.5.1",
|
||||
"version": "3.5.5",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/opis/closure.git",
|
||||
"reference": "93ebc5712cdad8d5f489b500c59d122df2e53969"
|
||||
"reference": "dec9fc5ecfca93f45cd6121f8e6f14457dff372c"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/opis/closure/zipball/93ebc5712cdad8d5f489b500c59d122df2e53969",
|
||||
"reference": "93ebc5712cdad8d5f489b500c59d122df2e53969",
|
||||
"url": "https://api.github.com/repos/opis/closure/zipball/dec9fc5ecfca93f45cd6121f8e6f14457dff372c",
|
||||
"reference": "dec9fc5ecfca93f45cd6121f8e6f14457dff372c",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
@ -214,20 +214,20 @@
|
||||
"serialization",
|
||||
"serialize"
|
||||
],
|
||||
"time": "2019-11-29T22:36:02+00:00"
|
||||
"time": "2020-06-17T14:59:55+00:00"
|
||||
},
|
||||
{
|
||||
"name": "phpmailer/phpmailer",
|
||||
"version": "v6.1.5",
|
||||
"version": "v6.1.6",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/PHPMailer/PHPMailer.git",
|
||||
"reference": "a8bf068f64a580302026e484ee29511f661b2ad3"
|
||||
"reference": "c2796cb1cb99d7717290b48c4e6f32cb6c60b7b3"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/a8bf068f64a580302026e484ee29511f661b2ad3",
|
||||
"reference": "a8bf068f64a580302026e484ee29511f661b2ad3",
|
||||
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/c2796cb1cb99d7717290b48c4e6f32cb6c60b7b3",
|
||||
"reference": "c2796cb1cb99d7717290b48c4e6f32cb6c60b7b3",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
@ -282,7 +282,7 @@
|
||||
}
|
||||
],
|
||||
"description": "PHPMailer is a full-featured email creation and transfer class for PHP",
|
||||
"time": "2020-03-14T14:23:48+00:00"
|
||||
"time": "2020-05-27T12:24:03+00:00"
|
||||
},
|
||||
{
|
||||
"name": "psr/cache",
|
||||
@ -1095,17 +1095,17 @@
|
||||
"time": "2020-05-12T16:47:27+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/var-dumper",
|
||||
"version": "v4.4.8",
|
||||
"name": "symfony/polyfill-php80",
|
||||
"version": "v1.17.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/var-dumper.git",
|
||||
"reference": "c587e04ce5d1aa62d534a038f574d9a709e814cf"
|
||||
"url": "https://github.com/symfony/polyfill-php80.git",
|
||||
"reference": "5e30b2799bc1ad68f7feb62b60a73743589438dd"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/c587e04ce5d1aa62d534a038f574d9a709e814cf",
|
||||
"reference": "c587e04ce5d1aa62d534a038f574d9a709e814cf",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/5e30b2799bc1ad68f7feb62b60a73743589438dd",
|
||||
"reference": "5e30b2799bc1ad68f7feb62b60a73743589438dd",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
@ -1115,9 +1115,78 @@
|
||||
]
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.1.3",
|
||||
"php": ">=7.0.8"
|
||||
},
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.17-dev"
|
||||
}
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Symfony\\Polyfill\\Php80\\": ""
|
||||
},
|
||||
"files": [
|
||||
"bootstrap.php"
|
||||
],
|
||||
"classmap": [
|
||||
"Resources/stubs"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Ion Bazan",
|
||||
"email": "ion.bazan@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Nicolas Grekas",
|
||||
"email": "p@tchwork.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions",
|
||||
"homepage": "https://symfony.com",
|
||||
"keywords": [
|
||||
"compatibility",
|
||||
"polyfill",
|
||||
"portable",
|
||||
"shim"
|
||||
],
|
||||
"time": "2020-05-12T16:47:27+00:00"
|
||||
},
|
||||
{
|
||||
"name": "symfony/var-dumper",
|
||||
"version": "v4.4.10",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/var-dumper.git",
|
||||
"reference": "56b3aa5eab0ac6720dcd559fd1d590ce301594ac"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/56b3aa5eab0ac6720dcd559fd1d590ce301594ac",
|
||||
"reference": "56b3aa5eab0ac6720dcd559fd1d590ce301594ac",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
|
||||
"preferred": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.1.3",
|
||||
"symfony/polyfill-mbstring": "~1.0",
|
||||
"symfony/polyfill-php72": "~1.5"
|
||||
"symfony/polyfill-php72": "~1.5",
|
||||
"symfony/polyfill-php80": "^1.15"
|
||||
},
|
||||
"conflict": {
|
||||
"phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0",
|
||||
@ -1174,7 +1243,7 @@
|
||||
"debug",
|
||||
"dump"
|
||||
],
|
||||
"time": "2020-04-12T16:14:02+00:00"
|
||||
"time": "2020-05-30T20:06:45+00:00"
|
||||
},
|
||||
{
|
||||
"name": "topthink/think-trace",
|
||||
|
@ -31,4 +31,8 @@ return [
|
||||
'error_message' => '页面错误!请稍后再试~',
|
||||
// 显示错误信息
|
||||
'show_error_msg' => false,
|
||||
/异常页面模板
|
||||
'http_exception_template' => [
|
||||
404 => '../view/404.html'
|
||||
]
|
||||
];
|
||||
|
2
vendor/composer/autoload_classmap.php
vendored
2
vendor/composer/autoload_classmap.php
vendored
@ -6,4 +6,6 @@ $vendorDir = dirname(dirname(__FILE__));
|
||||
$baseDir = dirname($vendorDir);
|
||||
|
||||
return array(
|
||||
'Stringable' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/Stringable.php',
|
||||
'ValueError' => $vendorDir . '/symfony/polyfill-php80/Resources/stubs/ValueError.php',
|
||||
);
|
||||
|
1
vendor/composer/autoload_files.php
vendored
1
vendor/composer/autoload_files.php
vendored
@ -10,6 +10,7 @@ return array(
|
||||
'538ca81a9a966a6716601ecf48f4eaef' => $vendorDir . '/opis/closure/functions.php',
|
||||
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => $vendorDir . '/symfony/polyfill-mbstring/bootstrap.php',
|
||||
'25072dd6e2470089de65ae7bf11d3109' => $vendorDir . '/symfony/polyfill-php72/bootstrap.php',
|
||||
'a4a119a56e50fbb293281d9a48007e0e' => $vendorDir . '/symfony/polyfill-php80/bootstrap.php',
|
||||
'667aeda72477189d0494fecd327c3641' => $vendorDir . '/symfony/var-dumper/Resources/functions/dump.php',
|
||||
'1cfd2761b63b0a29ed23657ea394cb2d' => $vendorDir . '/topthink/think-captcha/src/helper.php',
|
||||
'39594db8502267d6df2fe2dca5f3914d' => $vendorDir . '/zzstudio/think-addons/src/helper.php',
|
||||
|
1
vendor/composer/autoload_psr4.php
vendored
1
vendor/composer/autoload_psr4.php
vendored
@ -13,6 +13,7 @@ return array(
|
||||
'think\\' => array($vendorDir . '/topthink/framework/src/think', $vendorDir . '/topthink/think-helper/src', $vendorDir . '/topthink/think-orm/src', $vendorDir . '/topthink/think-template/src', $vendorDir . '/zzstudio/think-addons/src'),
|
||||
'taoser\\think\\' => array($vendorDir . '/taoser/think-auth/src'),
|
||||
'app\\' => array($baseDir . '/app'),
|
||||
'Symfony\\Polyfill\\Php80\\' => array($vendorDir . '/symfony/polyfill-php80'),
|
||||
'Symfony\\Polyfill\\Php72\\' => array($vendorDir . '/symfony/polyfill-php72'),
|
||||
'Symfony\\Polyfill\\Mbstring\\' => array($vendorDir . '/symfony/polyfill-mbstring'),
|
||||
'Symfony\\Component\\VarDumper\\' => array($vendorDir . '/symfony/var-dumper'),
|
||||
|
12
vendor/composer/autoload_static.php
vendored
12
vendor/composer/autoload_static.php
vendored
@ -11,6 +11,7 @@ class ComposerStaticInit1b32198725235c8d6500c87262ef30c2
|
||||
'538ca81a9a966a6716601ecf48f4eaef' => __DIR__ . '/..' . '/opis/closure/functions.php',
|
||||
'0e6d7bf4a5811bfa5cf40c5ccd6fae6a' => __DIR__ . '/..' . '/symfony/polyfill-mbstring/bootstrap.php',
|
||||
'25072dd6e2470089de65ae7bf11d3109' => __DIR__ . '/..' . '/symfony/polyfill-php72/bootstrap.php',
|
||||
'a4a119a56e50fbb293281d9a48007e0e' => __DIR__ . '/..' . '/symfony/polyfill-php80/bootstrap.php',
|
||||
'667aeda72477189d0494fecd327c3641' => __DIR__ . '/..' . '/symfony/var-dumper/Resources/functions/dump.php',
|
||||
'1cfd2761b63b0a29ed23657ea394cb2d' => __DIR__ . '/..' . '/topthink/think-captcha/src/helper.php',
|
||||
'39594db8502267d6df2fe2dca5f3914d' => __DIR__ . '/..' . '/zzstudio/think-addons/src/helper.php',
|
||||
@ -32,6 +33,7 @@ class ComposerStaticInit1b32198725235c8d6500c87262ef30c2
|
||||
),
|
||||
'S' =>
|
||||
array (
|
||||
'Symfony\\Polyfill\\Php80\\' => 23,
|
||||
'Symfony\\Polyfill\\Php72\\' => 23,
|
||||
'Symfony\\Polyfill\\Mbstring\\' => 26,
|
||||
'Symfony\\Component\\VarDumper\\' => 28,
|
||||
@ -88,6 +90,10 @@ class ComposerStaticInit1b32198725235c8d6500c87262ef30c2
|
||||
array (
|
||||
0 => __DIR__ . '/../..' . '/app',
|
||||
),
|
||||
'Symfony\\Polyfill\\Php80\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/polyfill-php80',
|
||||
),
|
||||
'Symfony\\Polyfill\\Php72\\' =>
|
||||
array (
|
||||
0 => __DIR__ . '/..' . '/symfony/polyfill-php72',
|
||||
@ -138,12 +144,18 @@ class ComposerStaticInit1b32198725235c8d6500c87262ef30c2
|
||||
0 => __DIR__ . '/../..' . '/extend',
|
||||
);
|
||||
|
||||
public static $classMap = array (
|
||||
'Stringable' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/Stringable.php',
|
||||
'ValueError' => __DIR__ . '/..' . '/symfony/polyfill-php80/Resources/stubs/ValueError.php',
|
||||
);
|
||||
|
||||
public static function getInitializer(ClassLoader $loader)
|
||||
{
|
||||
return \Closure::bind(function () use ($loader) {
|
||||
$loader->prefixLengthsPsr4 = ComposerStaticInit1b32198725235c8d6500c87262ef30c2::$prefixLengthsPsr4;
|
||||
$loader->prefixDirsPsr4 = ComposerStaticInit1b32198725235c8d6500c87262ef30c2::$prefixDirsPsr4;
|
||||
$loader->fallbackDirsPsr0 = ComposerStaticInit1b32198725235c8d6500c87262ef30c2::$fallbackDirsPsr0;
|
||||
$loader->classMap = ComposerStaticInit1b32198725235c8d6500c87262ef30c2::$classMap;
|
||||
|
||||
}, null, ClassLoader::class);
|
||||
}
|
||||
|
115
vendor/composer/installed.json
vendored
115
vendor/composer/installed.json
vendored
@ -148,17 +148,17 @@
|
||||
},
|
||||
{
|
||||
"name": "opis/closure",
|
||||
"version": "3.5.1",
|
||||
"version_normalized": "3.5.1.0",
|
||||
"version": "3.5.5",
|
||||
"version_normalized": "3.5.5.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/opis/closure.git",
|
||||
"reference": "93ebc5712cdad8d5f489b500c59d122df2e53969"
|
||||
"reference": "dec9fc5ecfca93f45cd6121f8e6f14457dff372c"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/opis/closure/zipball/93ebc5712cdad8d5f489b500c59d122df2e53969",
|
||||
"reference": "93ebc5712cdad8d5f489b500c59d122df2e53969",
|
||||
"url": "https://api.github.com/repos/opis/closure/zipball/dec9fc5ecfca93f45cd6121f8e6f14457dff372c",
|
||||
"reference": "dec9fc5ecfca93f45cd6121f8e6f14457dff372c",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
@ -174,7 +174,7 @@
|
||||
"jeremeamia/superclosure": "^2.0",
|
||||
"phpunit/phpunit": "^4.0 || ^5.0 || ^6.0 || ^7.0"
|
||||
},
|
||||
"time": "2019-11-29T22:36:02+00:00",
|
||||
"time": "2020-06-17T14:59:55+00:00",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
@ -217,17 +217,17 @@
|
||||
},
|
||||
{
|
||||
"name": "phpmailer/phpmailer",
|
||||
"version": "v6.1.5",
|
||||
"version_normalized": "6.1.5.0",
|
||||
"version": "v6.1.6",
|
||||
"version_normalized": "6.1.6.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/PHPMailer/PHPMailer.git",
|
||||
"reference": "a8bf068f64a580302026e484ee29511f661b2ad3"
|
||||
"reference": "c2796cb1cb99d7717290b48c4e6f32cb6c60b7b3"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/a8bf068f64a580302026e484ee29511f661b2ad3",
|
||||
"reference": "a8bf068f64a580302026e484ee29511f661b2ad3",
|
||||
"url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/c2796cb1cb99d7717290b48c4e6f32cb6c60b7b3",
|
||||
"reference": "c2796cb1cb99d7717290b48c4e6f32cb6c60b7b3",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
@ -254,7 +254,7 @@
|
||||
"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)"
|
||||
},
|
||||
"time": "2020-03-14T14:23:48+00:00",
|
||||
"time": "2020-05-27T12:24:03+00:00",
|
||||
"type": "library",
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
@ -638,18 +638,18 @@
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "symfony/var-dumper",
|
||||
"version": "v4.4.8",
|
||||
"version_normalized": "4.4.8.0",
|
||||
"name": "symfony/polyfill-php80",
|
||||
"version": "v1.17.0",
|
||||
"version_normalized": "1.17.0.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/var-dumper.git",
|
||||
"reference": "c587e04ce5d1aa62d534a038f574d9a709e814cf"
|
||||
"url": "https://github.com/symfony/polyfill-php80.git",
|
||||
"reference": "5e30b2799bc1ad68f7feb62b60a73743589438dd"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/c587e04ce5d1aa62d534a038f574d9a709e814cf",
|
||||
"reference": "c587e04ce5d1aa62d534a038f574d9a709e814cf",
|
||||
"url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/5e30b2799bc1ad68f7feb62b60a73743589438dd",
|
||||
"reference": "5e30b2799bc1ad68f7feb62b60a73743589438dd",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
@ -659,9 +659,80 @@
|
||||
]
|
||||
},
|
||||
"require": {
|
||||
"php": "^7.1.3",
|
||||
"php": ">=7.0.8"
|
||||
},
|
||||
"time": "2020-05-12T16:47:27+00:00",
|
||||
"type": "library",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.17-dev"
|
||||
}
|
||||
},
|
||||
"installation-source": "dist",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Symfony\\Polyfill\\Php80\\": ""
|
||||
},
|
||||
"files": [
|
||||
"bootstrap.php"
|
||||
],
|
||||
"classmap": [
|
||||
"Resources/stubs"
|
||||
]
|
||||
},
|
||||
"notification-url": "https://packagist.org/downloads/",
|
||||
"license": [
|
||||
"MIT"
|
||||
],
|
||||
"authors": [
|
||||
{
|
||||
"name": "Ion Bazan",
|
||||
"email": "ion.bazan@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Nicolas Grekas",
|
||||
"email": "p@tchwork.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions",
|
||||
"homepage": "https://symfony.com",
|
||||
"keywords": [
|
||||
"compatibility",
|
||||
"polyfill",
|
||||
"portable",
|
||||
"shim"
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "symfony/var-dumper",
|
||||
"version": "v4.4.10",
|
||||
"version_normalized": "4.4.10.0",
|
||||
"source": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/symfony/var-dumper.git",
|
||||
"reference": "56b3aa5eab0ac6720dcd559fd1d590ce301594ac"
|
||||
},
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://api.github.com/repos/symfony/var-dumper/zipball/56b3aa5eab0ac6720dcd559fd1d590ce301594ac",
|
||||
"reference": "56b3aa5eab0ac6720dcd559fd1d590ce301594ac",
|
||||
"shasum": "",
|
||||
"mirrors": [
|
||||
{
|
||||
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
|
||||
"preferred": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.1.3",
|
||||
"symfony/polyfill-mbstring": "~1.0",
|
||||
"symfony/polyfill-php72": "~1.5"
|
||||
"symfony/polyfill-php72": "~1.5",
|
||||
"symfony/polyfill-php80": "^1.15"
|
||||
},
|
||||
"conflict": {
|
||||
"phpunit/phpunit": "<4.8.35|<5.4.3,>=5.0",
|
||||
@ -678,7 +749,7 @@
|
||||
"ext-intl": "To show region name in time zone dump",
|
||||
"symfony/console": "To use the ServerDumpCommand and/or the bin/var-dump-server script"
|
||||
},
|
||||
"time": "2020-04-12T16:14:02+00:00",
|
||||
"time": "2020-05-30T20:06:45+00:00",
|
||||
"bin": [
|
||||
"Resources/bin/var-dump-server"
|
||||
],
|
||||
|
43
vendor/opis/closure/.github/workflows/tests.yml
vendored
Normal file
43
vendor/opis/closure/.github/workflows/tests.yml
vendored
Normal file
@ -0,0 +1,43 @@
|
||||
name: "Tests"
|
||||
on:
|
||||
push:
|
||||
paths-ignore:
|
||||
- '**.md'
|
||||
pull_request:
|
||||
paths-ignore:
|
||||
- '**.md'
|
||||
jobs:
|
||||
tests:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: true
|
||||
matrix:
|
||||
php: [5.4, 5.5, 5.6, 7.0, 7.1, 7.2, 7.3, 7.4]
|
||||
stability: [prefer-stable]
|
||||
|
||||
name: PHP ${{ matrix.php }}
|
||||
|
||||
steps:
|
||||
- name: Checkout code
|
||||
uses: actions/checkout@v2
|
||||
|
||||
- name: Cache dependencies
|
||||
uses: actions/cache@v1
|
||||
with:
|
||||
path: ~/.composer/cache/files
|
||||
key: dependencies-php-${{ matrix.php }}-composer-${{ hashFiles('composer.json') }}
|
||||
|
||||
- name: Setup PHP
|
||||
uses: shivammathur/setup-php@v2
|
||||
with:
|
||||
php-version: ${{ matrix.php }}
|
||||
coverage: none
|
||||
|
||||
- name: Update composer
|
||||
run: composer self-update
|
||||
|
||||
- name: Install dependencies
|
||||
run: composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-progress
|
||||
|
||||
- name: Execute tests
|
||||
run: vendor/bin/phpunit --verbose
|
19
vendor/opis/closure/CHANGELOG.md
vendored
19
vendor/opis/closure/CHANGELOG.md
vendored
@ -1,6 +1,25 @@
|
||||
CHANGELOG
|
||||
---------
|
||||
|
||||
### v3.5.5, 2020.06.17
|
||||
|
||||
- Fixed a false-positive when using `Opis\Closure\ReflectionClosure::isScopeRequired` method
|
||||
|
||||
### v3.5.4, 2020.06.07
|
||||
|
||||
- Fixed a false-positive when using `Opis\Closure\ReflectionClosure::isScopeRequired` method
|
||||
- Fixed a bug related to `T_STRING_VARNAME`
|
||||
|
||||
### v3.5.3, 2020.05.25
|
||||
|
||||
- Improved parser
|
||||
- The class scope optimisation is no longer used. We always bind now to the closure's original class scope.
|
||||
When the class scope was `null`, the optimisation failed to work as expected and kept the wrong `SerializableClosure` scope.
|
||||
|
||||
### v3.5.2, 2020.05.21
|
||||
|
||||
- Removed extra semicolon in short closures, since is not part of the closure's body.
|
||||
|
||||
### v3.5.1, 2019.11.30
|
||||
|
||||
- Bugfix. See #47
|
||||
|
22
vendor/opis/closure/README.md
vendored
22
vendor/opis/closure/README.md
vendored
@ -1,6 +1,6 @@
|
||||
Opis Closure
|
||||
====================
|
||||
[](https://travis-ci.org/opis/closure)
|
||||
[](https://github.com/opis/closure/actions)
|
||||
[](https://packagist.org/packages/opis/closure)
|
||||
[](https://packagist.org/packages/opis/closure)
|
||||
[](https://packagist.org/packages/opis/closure)
|
||||
@ -35,15 +35,15 @@ proper serialization
|
||||
- Automatically detects when the scope and/or the bound object of a closure needs to be serialized
|
||||
in order for the closure to work after deserialization
|
||||
|
||||
### Documentation
|
||||
## Documentation
|
||||
|
||||
The full documentation for this library can be found [here][documentation].
|
||||
|
||||
### License
|
||||
## License
|
||||
|
||||
**Opis Closure** is licensed under the [MIT License (MIT)][license].
|
||||
|
||||
### Requirements
|
||||
## Requirements
|
||||
|
||||
* PHP ^5.4 || ^7.0
|
||||
|
||||
@ -78,21 +78,15 @@ of **Opis Closure**. Otherwise, assuming you are not using one of the removed/re
|
||||
|
||||
### Arbitrary object serialization
|
||||
|
||||
This feature was primarily introduced in order to support serializing an object bound
|
||||
to a closure and available via `$this`. The implementation is far from being perfect
|
||||
and it's really hard to make it work flawless. I will try to improve this, but I can
|
||||
not guarantee anything. So my advice regarding the `Opis\Closure\serialize|unserialize`
|
||||
functions is to use them with caution.
|
||||
We've added this feature in order to be able to support the serialization of a closure's bound object.
|
||||
The implementation is far from being perfect, and it's really hard to make it work flawless.
|
||||
We will try to improve this, but we can't guarantee anything.
|
||||
So our advice regarding the `Opis\Closure\serialize|unserialize` functions is to use them with caution.
|
||||
|
||||
### SuperClosure support
|
||||
|
||||
**Opis Closure** is shipped with an analyzer(`Opis\Closure\Analyzer`) which
|
||||
aims to provide *Opis Closure*'s parsing precision and speed to [SuperClosure].
|
||||
|
||||
[documentation]: https://www.opis.io/closure "Opis Closure"
|
||||
[license]: http://opensource.org/licenses/MIT "MIT License"
|
||||
[Packagist]: https://packagist.org/packages/opis/closure "Packagist"
|
||||
[Composer]: https://getcomposer.org "Composer"
|
||||
[SuperClosure]: https://github.com/jeremeamia/super_closure "SuperClosure"
|
||||
[SemVer]: http://semver.org/ "Semantic versioning"
|
||||
[CHANGELOG]: https://github.com/opis/closure/blob/master/CHANGELOG.md "Changelog"
|
9
vendor/opis/closure/functions.php
vendored
9
vendor/opis/closure/functions.php
vendored
@ -26,12 +26,17 @@ function serialize($data)
|
||||
* Unserialize
|
||||
*
|
||||
* @param $data
|
||||
* @param $options
|
||||
* @return mixed
|
||||
*/
|
||||
function unserialize($data)
|
||||
function unserialize($data, array $options = null)
|
||||
{
|
||||
SerializableClosure::enterContext();
|
||||
$data = \unserialize($data);
|
||||
if ($options === null || PHP_MAJOR_VERSION < 7) {
|
||||
$data = \unserialize($data);
|
||||
} else {
|
||||
$data = \unserialize($data, $options);
|
||||
}
|
||||
SerializableClosure::unwrapClosures($data);
|
||||
SerializableClosure::exitContext();
|
||||
return $data;
|
||||
|
3
vendor/opis/closure/src/Analyzer.php
vendored
3
vendor/opis/closure/src/Analyzer.php
vendored
@ -10,6 +10,9 @@ namespace Opis\Closure;
|
||||
use Closure;
|
||||
use SuperClosure\Analyzer\ClosureAnalyzer;
|
||||
|
||||
/**
|
||||
* @deprecated We'll remove this class
|
||||
*/
|
||||
class Analyzer extends ClosureAnalyzer
|
||||
{
|
||||
/**
|
||||
|
80
vendor/opis/closure/src/ReflectionClosure.php
vendored
80
vendor/opis/closure/src/ReflectionClosure.php
vendored
@ -107,6 +107,8 @@ class ReflectionClosure extends ReflectionFunction
|
||||
$fn = PHP_MINOR_VERSION === 4;
|
||||
}
|
||||
|
||||
$class_keywords = ['self', 'static', 'parent'];
|
||||
|
||||
$ns = $this->getNamespaceName();
|
||||
$nsf = $ns == '' ? '' : ($ns[0] == '\\' ? $ns : '\\' . $ns);
|
||||
|
||||
@ -122,9 +124,9 @@ class ReflectionClosure extends ReflectionFunction
|
||||
|
||||
$tokens = $this->getTokens();
|
||||
$state = $lastState = 'start';
|
||||
$inside_anonymous = false;
|
||||
$inside_structure = false;
|
||||
$isShortClosure = false;
|
||||
$anonymous_mark = 0;
|
||||
$inside_structure_mark = 0;
|
||||
$open = 0;
|
||||
$code = '';
|
||||
$id_start = $id_start_ci = $id_name = $context = '';
|
||||
@ -207,11 +209,6 @@ class ReflectionClosure extends ReflectionFunction
|
||||
$state = 'closure';
|
||||
}
|
||||
break;
|
||||
case '=':
|
||||
$code .= $token;
|
||||
$lastState = 'closure_args';
|
||||
$state = 'ignore_next';
|
||||
break;
|
||||
case ':':
|
||||
$code .= ':';
|
||||
$state = 'return';
|
||||
@ -281,7 +278,6 @@ class ReflectionClosure extends ReflectionFunction
|
||||
switch ($token[0]){
|
||||
case T_CURLY_OPEN:
|
||||
case T_DOLLAR_OPEN_CURLY_BRACES:
|
||||
case T_STRING_VARNAME:
|
||||
case '{':
|
||||
$code .= '{';
|
||||
$open++;
|
||||
@ -290,8 +286,8 @@ class ReflectionClosure extends ReflectionFunction
|
||||
$code .= '}';
|
||||
if(--$open === 0 && !$isShortClosure){
|
||||
break 3;
|
||||
} elseif ($inside_anonymous) {
|
||||
$inside_anonymous = !($open === $anonymous_mark);
|
||||
} elseif ($inside_structure) {
|
||||
$inside_structure = !($open === $inside_structure_mark);
|
||||
}
|
||||
break;
|
||||
case '(':
|
||||
@ -331,13 +327,13 @@ class ReflectionClosure extends ReflectionFunction
|
||||
$code .= $_namespace;
|
||||
break;
|
||||
case T_CLASS_C:
|
||||
$code .= $_class;
|
||||
$code .= $inside_structure ? $token[1] : $_class;
|
||||
break;
|
||||
case T_FUNC_C:
|
||||
$code .= $_function;
|
||||
$code .= $inside_structure ? $token[1] : $_function;
|
||||
break;
|
||||
case T_METHOD_C:
|
||||
$code .= $_method;
|
||||
$code .= $inside_structure ? $token[1] : $_method;
|
||||
break;
|
||||
case T_COMMENT:
|
||||
if (substr($token[1], 0, 8) === '#trackme') {
|
||||
@ -353,15 +349,12 @@ class ReflectionClosure extends ReflectionFunction
|
||||
}
|
||||
break;
|
||||
case T_VARIABLE:
|
||||
if($token[1] == '$this' && !$inside_anonymous){
|
||||
if($token[1] == '$this' && !$inside_structure){
|
||||
$isUsingThisObject = true;
|
||||
}
|
||||
$code .= $token[1];
|
||||
break;
|
||||
case T_STATIC:
|
||||
$isUsingScope = true;
|
||||
$code .= $token[1];
|
||||
break;
|
||||
case T_NS_SEPARATOR:
|
||||
case T_STRING:
|
||||
$id_start = $token[1];
|
||||
@ -384,6 +377,7 @@ class ReflectionClosure extends ReflectionFunction
|
||||
$lastState = 'closure';
|
||||
break;
|
||||
case T_INSTANCEOF:
|
||||
case T_INSTEADOF:
|
||||
$code .= $token[1];
|
||||
$context = 'instanceof';
|
||||
$state = 'id_start';
|
||||
@ -398,6 +392,10 @@ class ReflectionClosure extends ReflectionFunction
|
||||
case T_FUNCTION:
|
||||
$code .= $token[1];
|
||||
$state = 'closure_args';
|
||||
if (!$inside_structure) {
|
||||
$inside_structure = true;
|
||||
$inside_structure_mark = $open;
|
||||
}
|
||||
break;
|
||||
case T_TRAIT_C:
|
||||
if ($_trait === null) {
|
||||
@ -501,7 +499,11 @@ class ReflectionClosure extends ReflectionFunction
|
||||
$open++;
|
||||
}
|
||||
if($context === 'new' || false !== strpos($id_name, '\\')){
|
||||
if($id_start !== '\\'){
|
||||
if($id_start_ci === 'self' || $id_start_ci === 'static') {
|
||||
if (!$inside_structure) {
|
||||
$isUsingScope = true;
|
||||
}
|
||||
} elseif ($id_start !== '\\' && !in_array($id_start_ci, $class_keywords)) {
|
||||
if ($classes === null) {
|
||||
$classes = $this->getClasses();
|
||||
}
|
||||
@ -528,8 +530,14 @@ class ReflectionClosure extends ReflectionFunction
|
||||
case T_VARIABLE:
|
||||
case T_DOUBLE_COLON:
|
||||
if($id_start !== '\\') {
|
||||
if($id_start_ci === 'self' || $id_start_ci === 'static' || $id_start_ci === 'parent'){
|
||||
$isUsingScope = true;
|
||||
if($id_start_ci === 'self' || $id_start_ci === 'parent'){
|
||||
if (!$inside_structure) {
|
||||
$isUsingScope = true;
|
||||
}
|
||||
} elseif ($id_start_ci === 'static') {
|
||||
if (!$inside_structure) {
|
||||
$isUsingScope = $token[0] === T_DOUBLE_COLON;
|
||||
}
|
||||
} elseif (!($php7 && in_array($id_start_ci, $php7_types))){
|
||||
if ($classes === null) {
|
||||
$classes = $this->getClasses();
|
||||
@ -542,19 +550,28 @@ class ReflectionClosure extends ReflectionFunction
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$code .= $id_start . $id_name . $token[1];
|
||||
$state = $token[0] === T_DOUBLE_COLON ? 'ignore_next' : $lastState;
|
||||
break;
|
||||
default:
|
||||
if($id_start !== '\\'){
|
||||
if($context === 'use' ||
|
||||
if($id_start !== '\\' && !defined($id_start)){
|
||||
if($constants === null){
|
||||
$constants = $this->getConstants();
|
||||
}
|
||||
if(isset($constants[$id_start])){
|
||||
$id_start = $constants[$id_start];
|
||||
} elseif($context === 'use' ||
|
||||
$context === 'instanceof' ||
|
||||
$context === 'args' ||
|
||||
$context === 'return_type' ||
|
||||
$context === 'extends'
|
||||
$context === 'extends' ||
|
||||
$context === 'root'
|
||||
){
|
||||
if($id_start_ci === 'self' || $id_start_ci === 'static' || $id_start_ci === 'parent'){
|
||||
$isUsingScope = true;
|
||||
if (!$inside_structure && !$id_start_ci === 'static') {
|
||||
$isUsingScope = true;
|
||||
}
|
||||
} elseif (!($php7 && in_array($id_start_ci, $php7_types))){
|
||||
if($classes === null){
|
||||
$classes = $this->getClasses();
|
||||
@ -566,13 +583,6 @@ class ReflectionClosure extends ReflectionFunction
|
||||
$id_start = $nsf . '\\' . $id_start;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if($constants === null){
|
||||
$constants = $this->getConstants();
|
||||
}
|
||||
if(isset($constants[$id_start])){
|
||||
$id_start = $constants[$id_start];
|
||||
}
|
||||
}
|
||||
}
|
||||
$code .= $id_start . $id_name;
|
||||
@ -593,9 +603,9 @@ class ReflectionClosure extends ReflectionFunction
|
||||
break;
|
||||
case '{':
|
||||
$state = 'closure';
|
||||
if (!$inside_anonymous) {
|
||||
$inside_anonymous = true;
|
||||
$anonymous_mark = $open;
|
||||
if (!$inside_structure) {
|
||||
$inside_structure = true;
|
||||
$inside_structure_mark = $open;
|
||||
}
|
||||
$i--;
|
||||
break;
|
||||
@ -607,7 +617,6 @@ class ReflectionClosure extends ReflectionFunction
|
||||
}
|
||||
|
||||
if ($isShortClosure) {
|
||||
$code .= ';';
|
||||
$this->useVariables = $this->getStaticVariables();
|
||||
} else {
|
||||
$this->useVariables = empty($use) ? $use : array_intersect_key($this->getStaticVariables(), array_flip($use));
|
||||
@ -980,7 +989,6 @@ class ReflectionClosure extends ReflectionFunction
|
||||
case '{':
|
||||
case T_CURLY_OPEN:
|
||||
case T_DOLLAR_OPEN_CURLY_BRACES:
|
||||
case T_STRING_VARNAME:
|
||||
$open++;
|
||||
break;
|
||||
case '}':
|
||||
|
@ -132,7 +132,7 @@ class SerializableClosure implements Serializable
|
||||
if($scope = $reflector->getClosureScopeClass()){
|
||||
$scope = $scope->name;
|
||||
}
|
||||
} elseif($reflector->isScopeRequired()) {
|
||||
} else {
|
||||
if($scope = $reflector->getClosureScopeClass()){
|
||||
$scope = $scope->name;
|
||||
}
|
||||
@ -260,9 +260,7 @@ class SerializableClosure implements Serializable
|
||||
$this->code['this'] = null;
|
||||
}
|
||||
|
||||
if ($this->code['scope'] !== null || $this->code['this'] !== null) {
|
||||
$this->closure = $this->closure->bindTo($this->code['this'], $this->code['scope']);
|
||||
}
|
||||
$this->closure = $this->closure->bindTo($this->code['this'], $this->code['scope']);
|
||||
|
||||
if(!empty($this->code['objects'])){
|
||||
foreach ($this->code['objects'] as $item){
|
||||
|
2
vendor/phpmailer/phpmailer/SECURITY.md
vendored
2
vendor/phpmailer/phpmailer/SECURITY.md
vendored
@ -2,6 +2,8 @@
|
||||
|
||||
Please disclose any vulnerabilities found responsibly - report any security problems found to the maintainers privately.
|
||||
|
||||
PHPMailer versions 6.1.5 and earlier contain an output escaping bug that occurs in `Content-Type` and `Content-Disposition` when filenames passed into `addAttachment` and other methods that accept attachment names contain double quote characters, in contravention of RFC822 3.4.1. No specific vulnerability has been found relating to this, but it could allow file attachments to bypass attachment filters that are based on matching filename extensions. Recorded as [CVE-2020-13625](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2020-13625). Reported by Elar Lang of Clarified Security.
|
||||
|
||||
PHPMailer versions prior to 6.0.6 and 5.2.27 are vulnerable to an object injection attack by passing `phar://` paths into `addAttachment()` and other functions that may receive unfiltered local paths, possibly leading to RCE. Recorded as [CVE-2018-19296](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2018-19296). See [this article](https://knasmueller.net/5-answers-about-php-phar-exploitation) for more info on this type of vulnerability. Mitigated by blocking the use of paths containing URL-protocol style prefixes such as `phar://`. Reported by Sehun Oh of cyberone.kr.
|
||||
|
||||
PHPMailer versions prior to 5.2.24 (released July 26th 2017) have an XSS vulnerability in one of the code examples, [CVE-2017-11503](https://web.nvd.nist.gov/view/vuln/detail?vulnId=CVE-2017-11503). The `code_generator.phps` example did not filter user input prior to output. This file is distributed with a `.phps` extension, so it it not normally executable unless it is explicitly renamed, and the file is not included when PHPMailer is loaded through composer, so it is safe by default. There was also an undisclosed potential XSS vulnerability in the default exception handler (unused by default). Patches for both issues kindly provided by Patrick Monnerat of the Fedora Project.
|
||||
|
2
vendor/phpmailer/phpmailer/VERSION
vendored
2
vendor/phpmailer/phpmailer/VERSION
vendored
@ -1 +1 @@
|
||||
6.1.5
|
||||
6.1.6
|
6
vendor/phpmailer/phpmailer/composer.json
vendored
6
vendor/phpmailer/phpmailer/composer.json
vendored
@ -19,6 +19,12 @@
|
||||
"name": "Brent R. Matzelle"
|
||||
}
|
||||
],
|
||||
"funding": [
|
||||
{
|
||||
"url": "https://github.com/synchro",
|
||||
"type": "github"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=5.5.0",
|
||||
"ext-ctype": "*",
|
||||
|
48
vendor/phpmailer/phpmailer/src/PHPMailer.php
vendored
48
vendor/phpmailer/phpmailer/src/PHPMailer.php
vendored
@ -745,7 +745,7 @@ class PHPMailer
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const VERSION = '6.1.5';
|
||||
const VERSION = '6.1.6';
|
||||
|
||||
/**
|
||||
* Error severity: message only, continue processing.
|
||||
@ -2086,6 +2086,7 @@ class PHPMailer
|
||||
'se' => 'sv',
|
||||
'rs' => 'sr',
|
||||
'tg' => 'tl',
|
||||
'am' => 'hy',
|
||||
];
|
||||
|
||||
if (isset($renamed_langcodes[$langcode])) {
|
||||
@ -2606,7 +2607,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 = 'This is a multi-part message in MIME format.' . static::$LE . static::$LE;
|
||||
switch ($this->message_type) {
|
||||
case 'inline':
|
||||
$body .= $mimepre;
|
||||
@ -3063,9 +3064,9 @@ class PHPMailer
|
||||
//Only include a filename property if we have one
|
||||
if (!empty($name)) {
|
||||
$mime[] = sprintf(
|
||||
'Content-Type: %s; name="%s"%s',
|
||||
'Content-Type: %s; name=%s%s',
|
||||
$type,
|
||||
$this->encodeHeader($this->secureHeader($name)),
|
||||
static::quotedString($this->encodeHeader($this->secureHeader($name))),
|
||||
static::$LE
|
||||
);
|
||||
} else {
|
||||
@ -3085,24 +3086,14 @@ class PHPMailer
|
||||
$mime[] = 'Content-ID: <' . $this->encodeHeader($this->secureHeader($cid)) . '>' . static::$LE;
|
||||
}
|
||||
|
||||
// If a filename contains any of these chars, it should be quoted,
|
||||
// but not otherwise: RFC2183 & RFC2045 5.1
|
||||
// Fixes a warning in IETF's msglint MIME checker
|
||||
// Allow for bypassing the Content-Disposition header totally
|
||||
// Allow for bypassing the Content-Disposition header
|
||||
if (!empty($disposition)) {
|
||||
$encoded_name = $this->encodeHeader($this->secureHeader($name));
|
||||
if (preg_match('/[ ()<>@,;:"\/\[\]?=]/', $encoded_name)) {
|
||||
$mime[] = sprintf(
|
||||
'Content-Disposition: %s; filename="%s"%s',
|
||||
$disposition,
|
||||
$encoded_name,
|
||||
static::$LE . static::$LE
|
||||
);
|
||||
} elseif (!empty($encoded_name)) {
|
||||
if (!empty($encoded_name)) {
|
||||
$mime[] = sprintf(
|
||||
'Content-Disposition: %s; filename=%s%s',
|
||||
$disposition,
|
||||
$encoded_name,
|
||||
static::quotedString($encoded_name),
|
||||
static::$LE . static::$LE
|
||||
);
|
||||
} else {
|
||||
@ -3162,6 +3153,7 @@ class PHPMailer
|
||||
if ($this->exceptions) {
|
||||
throw $exc;
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
}
|
||||
@ -4726,6 +4718,28 @@ class PHPMailer
|
||||
return (bool) preg_match('/^(.{' . (self::MAX_LINE_LENGTH + strlen(static::$LE)) . ',})/m', $str);
|
||||
}
|
||||
|
||||
/**
|
||||
* If a string contains any "special" characters, double-quote the name,
|
||||
* and escape any double quotes with a backslash.
|
||||
*
|
||||
* @param string $str
|
||||
*
|
||||
* @return string
|
||||
*
|
||||
* @see RFC822 3.4.1
|
||||
*/
|
||||
public static function quotedString($str)
|
||||
{
|
||||
if (preg_match('/[ ()<>@,;:"\/\[\]?=]/', $str)) {
|
||||
//If the string contains any of these chars, it must be double-quoted
|
||||
//and any double quotes must be escaped with a backslash
|
||||
return '"' . str_replace('"', '\\"', $str) . '"';
|
||||
}
|
||||
|
||||
//Return the string untouched, it doesn't need quoting
|
||||
return $str;
|
||||
}
|
||||
|
||||
/**
|
||||
* Allows for public read access to 'to' property.
|
||||
* Before the send() call, queued addresses (i.e. with IDN) are not yet included.
|
||||
|
2
vendor/phpmailer/phpmailer/src/POP3.php
vendored
2
vendor/phpmailer/phpmailer/src/POP3.php
vendored
@ -45,7 +45,7 @@ class POP3
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const VERSION = '6.1.5';
|
||||
const VERSION = '6.1.6';
|
||||
|
||||
/**
|
||||
* Default POP3 port number.
|
||||
|
6
vendor/phpmailer/phpmailer/src/SMTP.php
vendored
6
vendor/phpmailer/phpmailer/src/SMTP.php
vendored
@ -34,7 +34,7 @@ class SMTP
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
const VERSION = '6.1.5';
|
||||
const VERSION = '6.1.6';
|
||||
|
||||
/**
|
||||
* SMTP line break constant.
|
||||
@ -1168,7 +1168,7 @@ class SMTP
|
||||
//Must pass vars in here as params are by reference
|
||||
if (!stream_select($selR, $selW, $selW, $this->Timelimit)) {
|
||||
$this->edebug(
|
||||
'SMTP -> get_lines(): timed-out (' . $this->Timeout . ' sec)',
|
||||
'SMTP -> get_lines(): select timed-out in (' . $this->Timelimit . ' sec)',
|
||||
self::DEBUG_LOWLEVEL
|
||||
);
|
||||
break;
|
||||
@ -1187,7 +1187,7 @@ class SMTP
|
||||
$info = stream_get_meta_data($this->smtp_conn);
|
||||
if ($info['timed_out']) {
|
||||
$this->edebug(
|
||||
'SMTP -> get_lines(): timed-out (' . $this->Timeout . ' sec)',
|
||||
'SMTP -> get_lines(): stream timed-out (' . $this->Timeout . ' sec)',
|
||||
self::DEBUG_LOWLEVEL
|
||||
);
|
||||
break;
|
||||
|
19
vendor/symfony/polyfill-php80/LICENSE
vendored
Normal file
19
vendor/symfony/polyfill-php80/LICENSE
vendored
Normal file
@ -0,0 +1,19 @@
|
||||
Copyright (c) 2020 Fabien Potencier
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is furnished
|
||||
to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
105
vendor/symfony/polyfill-php80/Php80.php
vendored
Normal file
105
vendor/symfony/polyfill-php80/Php80.php
vendored
Normal file
@ -0,0 +1,105 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Symfony\Polyfill\Php80;
|
||||
|
||||
/**
|
||||
* @author Ion Bazan <ion.bazan@gmail.com>
|
||||
* @author Nico Oelgart <nicoswd@gmail.com>
|
||||
* @author Nicolas Grekas <p@tchwork.com>
|
||||
*
|
||||
* @internal
|
||||
*/
|
||||
final class Php80
|
||||
{
|
||||
public static function fdiv(float $dividend, float $divisor): float
|
||||
{
|
||||
return @($dividend / $divisor);
|
||||
}
|
||||
|
||||
public static function get_debug_type($value): string
|
||||
{
|
||||
switch (true) {
|
||||
case null === $value: return 'null';
|
||||
case \is_bool($value): return 'bool';
|
||||
case \is_string($value): return 'string';
|
||||
case \is_array($value): return 'array';
|
||||
case \is_int($value): return 'int';
|
||||
case \is_float($value): return 'float';
|
||||
case \is_object($value): break;
|
||||
case $value instanceof \__PHP_Incomplete_Class: return '__PHP_Incomplete_Class';
|
||||
default:
|
||||
if (null === $type = @get_resource_type($value)) {
|
||||
return 'unknown';
|
||||
}
|
||||
|
||||
if ('Unknown' === $type) {
|
||||
$type = 'closed';
|
||||
}
|
||||
|
||||
return "resource ($type)";
|
||||
}
|
||||
|
||||
$class = \get_class($value);
|
||||
|
||||
if (false === strpos($class, '@')) {
|
||||
return $class;
|
||||
}
|
||||
|
||||
return (get_parent_class($class) ?: key(class_implements($class)) ?: 'class').'@anonymous';
|
||||
}
|
||||
|
||||
public static function get_resource_id($res): int
|
||||
{
|
||||
if (!\is_resource($res) && null === @get_resource_type($res)) {
|
||||
throw new \TypeError(sprintf('Argument 1 passed to get_resource_id() must be of the type resource, %s given', get_debug_type($res)));
|
||||
}
|
||||
|
||||
return (int) $res;
|
||||
}
|
||||
|
||||
public static function preg_last_error_msg(): string
|
||||
{
|
||||
switch (preg_last_error()) {
|
||||
case PREG_INTERNAL_ERROR:
|
||||
return 'Internal error';
|
||||
case PREG_BAD_UTF8_ERROR:
|
||||
return 'Malformed UTF-8 characters, possibly incorrectly encoded';
|
||||
case PREG_BAD_UTF8_OFFSET_ERROR:
|
||||
return 'The offset did not correspond to the beginning of a valid UTF-8 code point';
|
||||
case PREG_BACKTRACK_LIMIT_ERROR:
|
||||
return 'Backtrack limit exhausted';
|
||||
case PREG_RECURSION_LIMIT_ERROR:
|
||||
return 'Recursion limit exhausted';
|
||||
case PREG_JIT_STACKLIMIT_ERROR:
|
||||
return 'JIT stack limit exhausted';
|
||||
case PREG_NO_ERROR:
|
||||
return 'No error';
|
||||
default:
|
||||
return 'Unknown error';
|
||||
}
|
||||
}
|
||||
|
||||
public static function str_contains(string $haystack, string $needle): bool
|
||||
{
|
||||
return '' === $needle || false !== strpos($haystack, $needle);
|
||||
}
|
||||
|
||||
public static function str_starts_with(string $haystack, string $needle): bool
|
||||
{
|
||||
return 0 === \strncmp($haystack, $needle, \strlen($needle));
|
||||
}
|
||||
|
||||
public static function str_ends_with(string $haystack, string $needle): bool
|
||||
{
|
||||
return '' === $needle || ('' !== $haystack && 0 === \substr_compare($haystack, $needle, -\strlen($needle)));
|
||||
}
|
||||
}
|
23
vendor/symfony/polyfill-php80/README.md
vendored
Normal file
23
vendor/symfony/polyfill-php80/README.md
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
Symfony Polyfill / Php80
|
||||
========================
|
||||
|
||||
This component provides features added to PHP 8.0 core:
|
||||
|
||||
- `Stringable` interface
|
||||
- [`fdiv`](https://php.net/fdiv)
|
||||
- `ValueError` class
|
||||
- `FILTER_VALIDATE_BOOL` constant
|
||||
- [`get_debug_type`](https://php.net/get_debug_type)
|
||||
- [`preg_last_error_msg`](https://php.net/preg_last_error_msg)
|
||||
- [`str_contains`](https://php.net/str_contains)
|
||||
- [`str_starts_with`](https://php.net/str_starts_with)
|
||||
- [`str_ends_with`](https://php.net/str_ends_with)
|
||||
- [`get_resource_id`](https://php.net/get_resource_id)
|
||||
|
||||
More information can be found in the
|
||||
[main Polyfill README](https://github.com/symfony/polyfill/blob/master/README.md).
|
||||
|
||||
License
|
||||
=======
|
||||
|
||||
This library is released under the [MIT license](LICENSE).
|
9
vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php
vendored
Normal file
9
vendor/symfony/polyfill-php80/Resources/stubs/Stringable.php
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
interface Stringable
|
||||
{
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function __toString();
|
||||
}
|
5
vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php
vendored
Normal file
5
vendor/symfony/polyfill-php80/Resources/stubs/ValueError.php
vendored
Normal file
@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
class ValueError extends Error
|
||||
{
|
||||
}
|
42
vendor/symfony/polyfill-php80/bootstrap.php
vendored
Normal file
42
vendor/symfony/polyfill-php80/bootstrap.php
vendored
Normal file
@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
use Symfony\Polyfill\Php80 as p;
|
||||
|
||||
if (PHP_VERSION_ID >= 80000) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!defined('FILTER_VALIDATE_BOOL') && defined('FILTER_VALIDATE_BOOLEAN')) {
|
||||
define('FILTER_VALIDATE_BOOL', FILTER_VALIDATE_BOOLEAN);
|
||||
}
|
||||
|
||||
if (!function_exists('fdiv')) {
|
||||
function fdiv(float $dividend, float $divisor): float { return p\Php80::fdiv($dividend, $divisor); }
|
||||
}
|
||||
if (!function_exists('preg_last_error_msg')) {
|
||||
function preg_last_error_msg(): string { return p\Php80::preg_last_error_msg(); }
|
||||
}
|
||||
if (!function_exists('str_contains')) {
|
||||
function str_contains(string $haystack, string $needle): bool { return p\Php80::str_contains($haystack, $needle); }
|
||||
}
|
||||
if (!function_exists('str_starts_with')) {
|
||||
function str_starts_with(string $haystack, string $needle): bool { return p\Php80::str_starts_with($haystack, $needle); }
|
||||
}
|
||||
if (!function_exists('str_ends_with')) {
|
||||
function str_ends_with(string $haystack, string $needle): bool { return p\Php80::str_ends_with($haystack, $needle); }
|
||||
}
|
||||
if (!function_exists('get_debug_type')) {
|
||||
function get_debug_type($value): string { return p\Php80::get_debug_type($value); }
|
||||
}
|
||||
if (!function_exists('get_resource_id')) {
|
||||
function get_resource_id($res): int { return p\Php80::get_resource_id($res); }
|
||||
}
|
36
vendor/symfony/polyfill-php80/composer.json
vendored
Normal file
36
vendor/symfony/polyfill-php80/composer.json
vendored
Normal file
@ -0,0 +1,36 @@
|
||||
{
|
||||
"name": "symfony/polyfill-php80",
|
||||
"type": "library",
|
||||
"description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions",
|
||||
"keywords": ["polyfill", "shim", "compatibility", "portable"],
|
||||
"homepage": "https://symfony.com",
|
||||
"license": "MIT",
|
||||
"authors": [
|
||||
{
|
||||
"name": "Ion Bazan",
|
||||
"email": "ion.bazan@gmail.com"
|
||||
},
|
||||
{
|
||||
"name": "Nicolas Grekas",
|
||||
"email": "p@tchwork.com"
|
||||
},
|
||||
{
|
||||
"name": "Symfony Community",
|
||||
"homepage": "https://symfony.com/contributors"
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": ">=7.0.8"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": { "Symfony\\Polyfill\\Php80\\": "" },
|
||||
"files": [ "bootstrap.php" ],
|
||||
"classmap": [ "Resources/stubs" ]
|
||||
},
|
||||
"minimum-stability": "dev",
|
||||
"extra": {
|
||||
"branch-alias": {
|
||||
"dev-master": "1.17-dev"
|
||||
}
|
||||
}
|
||||
}
|
10
vendor/symfony/var-dumper/Caster/Caster.php
vendored
10
vendor/symfony/var-dumper/Caster/Caster.php
vendored
@ -45,7 +45,7 @@ class Caster
|
||||
*
|
||||
* @return array The array-cast of the object, with prefixed dynamic properties
|
||||
*/
|
||||
public static function castObject($obj, string $class, bool $hasDebugInfo = false): array
|
||||
public static function castObject($obj, string $class, bool $hasDebugInfo = false, string $debugClass = null): array
|
||||
{
|
||||
if ($hasDebugInfo) {
|
||||
try {
|
||||
@ -64,6 +64,7 @@ class Caster
|
||||
|
||||
if ($a) {
|
||||
static $publicProperties = [];
|
||||
$debugClass = $debugClass ?? get_debug_type($obj);
|
||||
|
||||
$i = 0;
|
||||
$prefixedKeys = [];
|
||||
@ -77,8 +78,8 @@ class Caster
|
||||
if (!isset($publicProperties[$class][$k])) {
|
||||
$prefixedKeys[$i] = self::PREFIX_DYNAMIC.$k;
|
||||
}
|
||||
} elseif (isset($k[16]) && "\0" === $k[16] && 0 === strpos($k, "\0class@anonymous\0")) {
|
||||
$prefixedKeys[$i] = "\0".get_parent_class($class).'@anonymous'.strrchr($k, "\0");
|
||||
} elseif ($debugClass !== $class && 1 === strpos($k, $class)) {
|
||||
$prefixedKeys[$i] = "\0".$debugClass.strrchr($k, "\0");
|
||||
}
|
||||
++$i;
|
||||
}
|
||||
@ -94,6 +95,9 @@ class Caster
|
||||
if ($hasDebugInfo && \is_array($debugInfo)) {
|
||||
foreach ($debugInfo as $k => $v) {
|
||||
if (!isset($k[0]) || "\0" !== $k[0]) {
|
||||
if (\array_key_exists(self::PREFIX_DYNAMIC.$k, $a)) {
|
||||
continue;
|
||||
}
|
||||
$k = self::PREFIX_VIRTUAL.$k;
|
||||
}
|
||||
|
||||
|
@ -55,9 +55,9 @@ class ClassStub extends ConstStub
|
||||
}
|
||||
}
|
||||
|
||||
if (false !== strpos($identifier, "class@anonymous\0")) {
|
||||
$this->value = $identifier = preg_replace_callback('/class@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', function ($m) {
|
||||
return class_exists($m[0], false) ? get_parent_class($m[0]).'@anonymous' : $m[0];
|
||||
if (false !== strpos($identifier, "@anonymous\0")) {
|
||||
$this->value = $identifier = preg_replace_callback('/[a-zA-Z_\x7f-\xff][\\\\a-zA-Z0-9_\x7f-\xff]*+@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', function ($m) {
|
||||
return class_exists($m[0], false) ? (get_parent_class($m[0]) ?: key(class_implements($m[0])) ?: 'class').'@anonymous' : $m[0];
|
||||
}, $identifier);
|
||||
}
|
||||
|
||||
|
@ -73,8 +73,7 @@ class ExceptionCaster
|
||||
|
||||
if (isset($a[$xPrefix.'previous'], $a[$trace]) && $a[$xPrefix.'previous'] instanceof \Exception) {
|
||||
$b = (array) $a[$xPrefix.'previous'];
|
||||
$class = \get_class($a[$xPrefix.'previous']);
|
||||
$class = 'c' === $class[0] && 0 === strpos($class, "class@anonymous\0") ? get_parent_class($class).'@anonymous' : $class;
|
||||
$class = get_debug_type($a[$xPrefix.'previous']);
|
||||
self::traceUnshift($b[$xPrefix.'trace'], $class, $b[$prefix.'file'], $b[$prefix.'line']);
|
||||
$a[$trace] = new TraceStub($b[$xPrefix.'trace'], false, 0, -\count($a[$trace]->value));
|
||||
}
|
||||
@ -282,9 +281,9 @@ class ExceptionCaster
|
||||
}
|
||||
unset($a[$xPrefix.'string'], $a[Caster::PREFIX_DYNAMIC.'xdebug_message'], $a[Caster::PREFIX_DYNAMIC.'__destructorException']);
|
||||
|
||||
if (isset($a[Caster::PREFIX_PROTECTED.'message']) && false !== strpos($a[Caster::PREFIX_PROTECTED.'message'], "class@anonymous\0")) {
|
||||
$a[Caster::PREFIX_PROTECTED.'message'] = preg_replace_callback('/class@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', function ($m) {
|
||||
return class_exists($m[0], false) ? get_parent_class($m[0]).'@anonymous' : $m[0];
|
||||
if (isset($a[Caster::PREFIX_PROTECTED.'message']) && false !== strpos($a[Caster::PREFIX_PROTECTED.'message'], "@anonymous\0")) {
|
||||
$a[Caster::PREFIX_PROTECTED.'message'] = preg_replace_callback('/[a-zA-Z_\x7f-\xff][\\\\a-zA-Z0-9_\x7f-\xff]*+@anonymous\x00.*?\.php(?:0x?|:[0-9]++\$)[0-9a-fA-F]++/', function ($m) {
|
||||
return class_exists($m[0], false) ? (get_parent_class($m[0]) ?: key(class_implements($m[0])) ?: 'class').'@anonymous' : $m[0];
|
||||
}, $a[Caster::PREFIX_PROTECTED.'message']);
|
||||
}
|
||||
|
||||
|
@ -376,6 +376,10 @@ class ReflectionCaster
|
||||
private static function addMap(array &$a, \Reflector $c, array $map, string $prefix = Caster::PREFIX_VIRTUAL)
|
||||
{
|
||||
foreach ($map as $k => $m) {
|
||||
if (\PHP_VERSION_ID >= 80000 && 'isDisabled' === $k) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (method_exists($c, $m) && false !== ($m = $c->$m()) && null !== $m) {
|
||||
$a[$prefix.$k] = $m instanceof \Reflector ? $m->name : $m;
|
||||
}
|
||||
|
19
vendor/symfony/var-dumper/Caster/SplCaster.php
vendored
19
vendor/symfony/var-dumper/Caster/SplCaster.php
vendored
@ -91,6 +91,8 @@ class SplCaster
|
||||
];
|
||||
|
||||
$prefix = Caster::PREFIX_VIRTUAL;
|
||||
unset($a["\0SplFileInfo\0fileName"]);
|
||||
unset($a["\0SplFileInfo\0pathName"]);
|
||||
|
||||
if (false === $c->getPathname()) {
|
||||
$a[$prefix.'⚠'] = 'The parent constructor was not called: the object is in an invalid state';
|
||||
@ -160,19 +162,11 @@ class SplCaster
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castFixedArray(\SplFixedArray $c, array $a, Stub $stub, $isNested)
|
||||
{
|
||||
$a += [
|
||||
Caster::PREFIX_VIRTUAL.'storage' => $c->toArray(),
|
||||
];
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function castObjectStorage(\SplObjectStorage $c, array $a, Stub $stub, $isNested)
|
||||
{
|
||||
$storage = [];
|
||||
unset($a[Caster::PREFIX_DYNAMIC."\0gcdata"]); // Don't hit https://bugs.php.net/65967
|
||||
unset($a["\0SplObjectStorage\0storage"]);
|
||||
|
||||
$clone = clone $c;
|
||||
foreach ($clone as $obj) {
|
||||
@ -206,14 +200,16 @@ class SplCaster
|
||||
private static function castSplArray($c, array $a, Stub $stub, bool $isNested): array
|
||||
{
|
||||
$prefix = Caster::PREFIX_VIRTUAL;
|
||||
$class = $stub->class;
|
||||
$flags = $c->getFlags();
|
||||
|
||||
if (!($flags & \ArrayObject::STD_PROP_LIST)) {
|
||||
$c->setFlags(\ArrayObject::STD_PROP_LIST);
|
||||
$a = Caster::castObject($c, $class);
|
||||
$a = Caster::castObject($c, \get_class($c), method_exists($c, '__debugInfo'), $stub->class);
|
||||
$c->setFlags($flags);
|
||||
}
|
||||
if (\PHP_VERSION_ID < 70400) {
|
||||
$a[$prefix.'storage'] = $c->getArrayCopy();
|
||||
}
|
||||
$a += [
|
||||
$prefix.'flag::STD_PROP_LIST' => (bool) ($flags & \ArrayObject::STD_PROP_LIST),
|
||||
$prefix.'flag::ARRAY_AS_PROPS' => (bool) ($flags & \ArrayObject::ARRAY_AS_PROPS),
|
||||
@ -221,7 +217,6 @@ class SplCaster
|
||||
if ($c instanceof \ArrayObject) {
|
||||
$a[$prefix.'iteratorClass'] = new ClassStub($c->getIteratorClass());
|
||||
}
|
||||
$a[$prefix.'storage'] = $c->getArrayCopy();
|
||||
|
||||
return $a;
|
||||
}
|
||||
|
@ -114,7 +114,6 @@ abstract class AbstractCloner implements ClonerInterface
|
||||
'SplDoublyLinkedList' => ['Symfony\Component\VarDumper\Caster\SplCaster', 'castDoublyLinkedList'],
|
||||
'SplFileInfo' => ['Symfony\Component\VarDumper\Caster\SplCaster', 'castFileInfo'],
|
||||
'SplFileObject' => ['Symfony\Component\VarDumper\Caster\SplCaster', 'castFileObject'],
|
||||
'SplFixedArray' => ['Symfony\Component\VarDumper\Caster\SplCaster', 'castFixedArray'],
|
||||
'SplHeap' => ['Symfony\Component\VarDumper\Caster\SplCaster', 'castHeap'],
|
||||
'SplObjectStorage' => ['Symfony\Component\VarDumper\Caster\SplCaster', 'castObjectStorage'],
|
||||
'SplPriorityQueue' => ['Symfony\Component\VarDumper\Caster\SplCaster', 'castHeap'],
|
||||
@ -291,8 +290,8 @@ abstract class AbstractCloner implements ClonerInterface
|
||||
$obj = $stub->value;
|
||||
$class = $stub->class;
|
||||
|
||||
if (isset($class[15]) && "\0" === $class[15] && 0 === strpos($class, "class@anonymous\x00")) {
|
||||
$stub->class = get_parent_class($class).'@anonymous';
|
||||
if (\PHP_VERSION_ID < 80000 ? "\0" === ($class[15] ?? null) : false !== strpos($class, "@anonymous\0")) {
|
||||
$stub->class = get_debug_type($obj);
|
||||
}
|
||||
if (isset($this->classInfo[$class])) {
|
||||
list($i, $parents, $hasDebugInfo, $fileInfo) = $this->classInfo[$class];
|
||||
@ -321,7 +320,7 @@ abstract class AbstractCloner implements ClonerInterface
|
||||
}
|
||||
|
||||
$stub->attr += $fileInfo;
|
||||
$a = Caster::castObject($obj, $class, $hasDebugInfo);
|
||||
$a = Caster::castObject($obj, $class, $hasDebugInfo, $stub->class);
|
||||
|
||||
try {
|
||||
while ($i--) {
|
||||
|
@ -41,7 +41,7 @@ class DumpServer
|
||||
public function start(): void
|
||||
{
|
||||
if (!$this->socket = stream_socket_server($this->host, $errno, $errstr)) {
|
||||
throw new \RuntimeException(sprintf('Server start failed on "%s": '.$errstr.' '.$errno, $this->host));
|
||||
throw new \RuntimeException(sprintf('Server start failed on "%s": ', $this->host).$errstr.' '.$errno);
|
||||
}
|
||||
}
|
||||
|
||||
|
5
vendor/symfony/var-dumper/composer.json
vendored
5
vendor/symfony/var-dumper/composer.json
vendored
@ -16,9 +16,10 @@
|
||||
}
|
||||
],
|
||||
"require": {
|
||||
"php": "^7.1.3",
|
||||
"php": ">=7.1.3",
|
||||
"symfony/polyfill-mbstring": "~1.0",
|
||||
"symfony/polyfill-php72": "~1.5"
|
||||
"symfony/polyfill-php72": "~1.5",
|
||||
"symfony/polyfill-php80": "^1.15"
|
||||
},
|
||||
"require-dev": {
|
||||
"ext-iconv": "*",
|
||||
|
@ -1,35 +1,27 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>404 - TaoLer社区</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<meta name="keywords" content="fly,layui,前端社区">
|
||||
<meta name="description" content="Fly社区是模块化前端UI框架Layui的官网社区,致力于为web开发提供强劲动力">
|
||||
<link rel="stylesheet" href="/static/layui/css/layui.css">
|
||||
<link rel="stylesheet" href="/static/res/css/global.css" charset="utf-8">
|
||||
</head>
|
||||
<body>
|
||||
<include file="./taoler/index/public/header.html" />
|
||||
<include file="./taoler/index/public/column" />
|
||||
{extend name="public/base" /}
|
||||
|
||||
{block name="title"}404 - {$sysInfo.webname}{/block}
|
||||
{block name="keywords"}{$sysInfo.keywords}{/block}
|
||||
{block name="description"}{$sysInfo.descript}{/block}
|
||||
{block name="column"}{include file="public/column" /}{/block}
|
||||
{block name="content"}
|
||||
<div class="layui-container fly-marginTop">
|
||||
<div class="fly-panel">
|
||||
<div class="fly-none">
|
||||
<h2><i class="iconfont icon-404"></i></h2>
|
||||
<p>页面或者数据被<a href="/" target="_blank"> 纸飞机 </a>运到火星了,啥都看不到了…</p>
|
||||
<p>页面或者数据被<a href="http://www.aieok.com"> 纸飞机 </a>运到火星了,啥都看不到了…</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
|
||||
<include file="./footer" />
|
||||
<script src="/static/layui/jquery.min.js" charset="utf-8"></script>
|
||||
<script src="/static/layui/layui.js" charset="utf-8"></script>
|
||||
|
||||
{block name="script"}
|
||||
<script>
|
||||
layui.cache.page = 'user';
|
||||
layui.cache.user = {
|
||||
username: '{$user.name??'游客'}'
|
||||
,uid: {$user.id ? 168*$user.id : -1}
|
||||
,avatar: '{if condition="$user['user_img'] neq ''"}/uploads/{$user['user_img']}{else /}/static/res/images/avatar/00.jpg{/if}'
|
||||
,uid: {$user.id ? $user.id : -1}
|
||||
,avatar: '{if condition="$user['user_img'] neq ''"}{$user['user_img']}{else /}/static/res/images/avatar/00.jpg{/if}'
|
||||
,experience: 83
|
||||
,sex: '{if condition="$user['sex'] eq 0"}男{else/}女{/if}'
|
||||
};
|
||||
@ -40,10 +32,7 @@
|
||||
fly: 'index'
|
||||
}).use('fly');
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
{/block}
|
||||
|
||||
|
||||
|
||||
|
@ -1 +0,0 @@
|
||||
如果不使用模板,可以删除该目录
|
@ -75,9 +75,9 @@
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">上传附件</label>
|
||||
<div class="layui-input-inline" style="width: 190px;">
|
||||
<input type="text" class="layui-input" name="upzip" value="" placeholder="下一版本再开发这个" title="上传附件"/>
|
||||
<input type="text" class="layui-input" name="upzip" value="" placeholder="zip,jpg格式" title="上传附件"/>
|
||||
</div>
|
||||
<div class="layui-form-mid layui-word-aux">是否回复可下载或者密码下载</div>
|
||||
<button type="button" class="layui-btn" id="zip-button"><i class="layui-icon"></i>上传文件</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -155,10 +155,11 @@ layui.config({
|
||||
,base: '/static/res/mods/'
|
||||
}).extend({
|
||||
fly: 'index'
|
||||
}).use(['fly','form','colorpicker'], function(){
|
||||
}).use(['fly','form','colorpicker','upload'], function(){
|
||||
var $ = layui.$
|
||||
,form = layui.form
|
||||
,colorpicker = layui.colorpicker;
|
||||
,colorpicker = layui.colorpicker
|
||||
,upload = layui.upload;
|
||||
|
||||
//预定义颜色项
|
||||
colorpicker.render({
|
||||
@ -166,7 +167,6 @@ layui.config({
|
||||
,color: '#393d49'
|
||||
,predefine: true // 开启预定义颜色
|
||||
,done: function(color){
|
||||
console.log(color);
|
||||
//譬如你可以在回调中把得到的 color 赋值给表单
|
||||
$('#L_title_color').val(color);
|
||||
//改变标题颜色
|
||||
@ -174,6 +174,22 @@ layui.config({
|
||||
}
|
||||
});
|
||||
|
||||
//指定允许上传的文件类型
|
||||
upload.render({
|
||||
elem: '#zip-button'
|
||||
,url: '{:url('article/upzip')}' //改成您自己的上传接口
|
||||
,accept: 'file' //普通文件
|
||||
,done: function(res){
|
||||
if(res.status == 0){
|
||||
$('input[name="upzip"]').val(res.url);
|
||||
layer.msg('上传成功');
|
||||
} else {
|
||||
layer.msg(res.msg);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
//发布文章
|
||||
form.on('submit(article-add)', function(data){
|
||||
var field = data.field;
|
||||
|
@ -71,6 +71,12 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="detail-body photos">{$article.content|raw}</div>
|
||||
{notempty name="$article.upzip"}
|
||||
<div class="layui-inline">
|
||||
<label ">附件:</label>
|
||||
<button type="button" class="layui-btn" id="zip-download"><i class="layui-icon layui-icon-download-circle"></i>下载文件</button>
|
||||
</div>
|
||||
{/notempty}
|
||||
</div>
|
||||
|
||||
<div class="fly-panel detail-box" id="flyReply">
|
||||
@ -306,6 +312,19 @@ layui.config({
|
||||
return false;
|
||||
});
|
||||
|
||||
//下载
|
||||
$('#zip-download').click(function (){
|
||||
var id = "{$article.id}";
|
||||
$.ajax({
|
||||
type:"post",
|
||||
url:"{:url('article/download')}",
|
||||
data:{id:id},
|
||||
success:function (data) {
|
||||
location.href = "{:url('article/download',['id'=>$article.id])}";
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
//如果你是采用模版自带的编辑器,你需要开启以下语句来解析。
|
||||
$('.detail-body').each(function(){
|
||||
var othis = $(this), html = othis.html();
|
||||
|
@ -31,7 +31,7 @@
|
||||
<label for="L_title" class="layui-form-label">标题</label>
|
||||
<div class="layui-input-block">
|
||||
<input type="text" id="L_title" name="title" required lay-verify="required" autocomplete="off" class="layui-input" value="{$article.title}">
|
||||
<input type="hidden" id="L_title_color" name="title_color" autocomplete="off" class="layui-input" value="{$article.title_color}">
|
||||
<input type="hidden" id="L_title_color" name="title_color" autocomplete="off" class="layui-input" value="{$article.title_color}">
|
||||
<input type="hidden" name="user_id" value="{$article.user_id}">
|
||||
</div>
|
||||
</div>
|
||||
@ -93,9 +93,9 @@
|
||||
<div class="layui-inline">
|
||||
<label class="layui-form-label">上传附件</label>
|
||||
<div class="layui-input-inline" style="width: 190px;">
|
||||
<input type="text" class="layui-input" name="upzip" value="" placeholder="下一版本再开发这个" title="上传附件"/>
|
||||
<input type="text" class="layui-input" name="upzip" value="{$article.upzip}" placeholder="zip,jpg格式" title="上传附件"/>
|
||||
</div>
|
||||
<div class="layui-form-mid layui-word-aux">是否回复可下载或者密码下载</div>
|
||||
<button type="button" class="layui-btn" id="zip-button"><i class="layui-icon"></i>上传文件</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -151,10 +151,11 @@ layui.config({
|
||||
,base: '/static/res/mods/'
|
||||
}).extend({
|
||||
fly: 'index'
|
||||
}).use(['fly','colorpicker','form'], function(){
|
||||
}).use(['fly','colorpicker','form','upload'], function(){
|
||||
var $ = layui.$
|
||||
,colorpicker = layui.colorpicker
|
||||
,form = layui.form;
|
||||
,form = layui.form
|
||||
,upload = layui.upload;
|
||||
|
||||
//预定义颜色项
|
||||
colorpicker.render({
|
||||
@ -170,6 +171,23 @@ layui.config({
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//指定允许上传的文件类型
|
||||
upload.render({
|
||||
elem: '#zip-button'
|
||||
,url: '{:url('article/upzip')}' //改成您自己的上传接口
|
||||
,accept: 'file' //普通文件
|
||||
,done: function(res){
|
||||
if(res.status == 0){
|
||||
$('input[name="upzip"]').val(res.url);
|
||||
layer.msg('上传成功');
|
||||
} else {
|
||||
layer.msg(res.msg);
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
//编辑文章
|
||||
form.on('submit(article-edit)', function(data){
|
||||
var field = data.field;
|
||||
|
@ -1,35 +1,27 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>404 - TaoLer社区</title>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<meta name="keywords" content="fly,layui,前端社区">
|
||||
<meta name="description" content="Fly社区是模块化前端UI框架Layui的官网社区,致力于为web开发提供强劲动力">
|
||||
<link rel="stylesheet" href="/static/res/layui/css/layui.css">
|
||||
<link rel="stylesheet" href="/static/res/css/global.css" charset="utf-8">
|
||||
</head>
|
||||
<body>
|
||||
<include file="./index/public/header.html" />
|
||||
<include file="./index/public/column" />
|
||||
{extend name="public/base" /}
|
||||
|
||||
{block name="title"}404 - {$sysInfo.webname}{/block}
|
||||
{block name="keywords"}{$sysInfo.keywords}{/block}
|
||||
{block name="description"}{$sysInfo.descript}{/block}
|
||||
{block name="column"}{include file="public/column" /}{/block}
|
||||
{block name="content"}
|
||||
<div class="layui-container fly-marginTop">
|
||||
<div class="fly-panel">
|
||||
<div class="fly-none">
|
||||
<h2><i class="iconfont icon-404"></i></h2>
|
||||
<p>页面或者数据被<a href="http://fly.layui.com/u/336" target="_blank"> 纸飞机 </a>运到火星了,啥都看不到了…</p>
|
||||
<p>页面或者数据被<a href="http://www.aieok.com"> 纸飞机 </a>运到火星了,啥都看不到了…</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
|
||||
<include file="./footer" />
|
||||
<script src="/static/res/mods/jquery.min.js" charset="utf-8"></script>
|
||||
<script src="/static/res/layui/layui.js" charset="utf-8"></script>
|
||||
|
||||
{block name="script"}
|
||||
<script>
|
||||
layui.cache.page = 'user';
|
||||
layui.cache.user = {
|
||||
username: '{$user.name??'游客'}'
|
||||
,uid: {$user.id ? 168*$user.id : -1}
|
||||
,avatar: '{if condition="$user['user_img'] neq ''"}/uploads/{$user['user_img']}{else /}/static/res/images/avatar/00.jpg{/if}'
|
||||
,uid: {$user.id ? $user.id : -1}
|
||||
,avatar: '{if condition="$user['user_img'] neq ''"}{$user['user_img']}{else /}/static/res/images/avatar/00.jpg{/if}'
|
||||
,experience: 83
|
||||
,sex: '{if condition="$user['sex'] eq 0"}男{else/}女{/if}'
|
||||
};
|
||||
@ -40,10 +32,7 @@
|
||||
fly: 'index'
|
||||
}).use('fly');
|
||||
</script>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
|
||||
{/block}
|
||||
|
||||
|
||||
|
||||
|
@ -237,7 +237,6 @@
|
||||
}).extend({
|
||||
fly: 'index'
|
||||
}).use('fly');
|
||||
var replyUrl = "{:url('index/reply')}",
|
||||
searchUrl = "{:url('index/search')}";
|
||||
var replyUrl = "{:url('index/reply')}";
|
||||
</script>
|
||||
{/block}
|
@ -7,5 +7,6 @@ var messageNums = "{:url('index/Message/nums')}",
|
||||
login = "{:url('Login/index')}",
|
||||
articleAdd = "{:url('Article/add')}",
|
||||
websearch = "{:url('index/index/search')}",
|
||||
textImgUpload = "{:url('index/article/textImgUpload')}";
|
||||
textImgUpload = "{:url('index/article/textImgUpload')}",
|
||||
searchUrl = "{:url('index/search')}";
|
||||
</script>
|
||||
|
Loading…
x
Reference in New Issue
Block a user