切换导航条
此项目
正在载入...
登录
何书鹏
/
recruit
·
提交
转到一个项目
GitLab
转到仪表盘
项目
活动
文件
提交
管道
0
构建
0
图表
里程碑
问题
0
合并请求
0
成员
标记
维基
派生
网络
创建新的问题
下载为
邮件补丁
差异文件
浏览文件
作者
Karson
6 years ago
提交
92a95455645173f9d7eaa2875411dab551f85d54
1 个父辈
a85db232
修复插件卸载和禁用可能导致的BUG
隐藏空白字符变更
内嵌
并排对比
正在显示
2 个修改的文件
包含
19 行增加
和
0 行删除
application/admin/controller/Addon.php
application/admin/lang/zh-cn/addon.php
application/admin/controller/Addon.php
查看文件 @
92a9545
...
...
@@ -49,6 +49,9 @@ class Addon extends Backend
if
(
!
$name
)
{
$this
->
error
(
__
(
'Parameter %s can not be empty'
,
$ids
?
'id'
:
'name'
));
}
if
(
!
preg_match
(
"/^[a-zA-Z0-9]+$/"
,
$name
))
{
$this
->
error
(
__
(
'Addon name incorrect'
));
}
if
(
!
is_dir
(
ADDON_PATH
.
$name
))
{
$this
->
error
(
__
(
'Directory not found'
));
}
...
...
@@ -105,6 +108,9 @@ class Addon extends Backend
if
(
!
$name
)
{
$this
->
error
(
__
(
'Parameter %s can not be empty'
,
'name'
));
}
if
(
!
preg_match
(
"/^[a-zA-Z0-9]+$/"
,
$name
))
{
$this
->
error
(
__
(
'Addon name incorrect'
));
}
try
{
$uid
=
$this
->
request
->
post
(
"uid"
);
$token
=
$this
->
request
->
post
(
"token"
);
...
...
@@ -138,6 +144,9 @@ class Addon extends Backend
if
(
!
$name
)
{
$this
->
error
(
__
(
'Parameter %s can not be empty'
,
'name'
));
}
if
(
!
preg_match
(
"/^[a-zA-Z0-9]+$/"
,
$name
))
{
$this
->
error
(
__
(
'Addon name incorrect'
));
}
try
{
Service
::
uninstall
(
$name
,
$force
);
$this
->
success
(
__
(
'Uninstall successful'
));
...
...
@@ -159,6 +168,9 @@ class Addon extends Backend
if
(
!
$name
)
{
$this
->
error
(
__
(
'Parameter %s can not be empty'
,
'name'
));
}
if
(
!
preg_match
(
"/^[a-zA-Z0-9]+$/"
,
$name
))
{
$this
->
error
(
__
(
'Addon name incorrect'
));
}
try
{
$action
=
$action
==
'enable'
?
$action
:
'disable'
;
//调用启用、禁用的方法
...
...
@@ -203,6 +215,9 @@ class Addon extends Backend
if
(
!
$name
)
{
throw
new
Exception
(
__
(
'Addon info file data incorrect'
));
}
if
(
!
preg_match
(
"/^[a-zA-Z0-9]+$/"
,
$name
))
{
throw
new
Exception
(
__
(
'Addon name incorrect'
));
}
$newAddonDir
=
ADDON_PATH
.
$name
.
DS
;
if
(
is_dir
(
$newAddonDir
))
{
...
...
@@ -256,6 +271,9 @@ class Addon extends Backend
if
(
!
$name
)
{
$this
->
error
(
__
(
'Parameter %s can not be empty'
,
'name'
));
}
if
(
!
preg_match
(
"/^[a-zA-Z0-9]+$/"
,
$name
))
{
$this
->
error
(
__
(
'Addon name incorrect'
));
}
try
{
$uid
=
$this
->
request
->
post
(
"uid"
);
$token
=
$this
->
request
->
post
(
"token"
);
...
...
application/admin/lang/zh-cn/addon.php
查看文件 @
92a9545
...
...
@@ -84,6 +84,7 @@ return [
'Install successful'
=>
'安装成功'
,
'Uninstall successful'
=>
'卸载成功'
,
'Operate successful'
=>
'操作成功'
,
'Addon name incorrect'
=>
'插件名称不正确'
,
'Addon info file was not found'
=>
'插件配置文件未找到'
,
'Addon info file data incorrect'
=>
'插件配置信息不正确'
,
'Addon already exists'
=>
'上传的插件已经存在'
,
...
...
请
注册
或
登录
后发表评论