Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
wds12580
ShopXO
提交
784c9b93
ShopXO
项目概览
wds12580
/
ShopXO
与 Fork 源项目一致
Fork自
纵之格 / ShopXO
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
ShopXO
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
784c9b93
编写于
4月 09, 2019
作者:
D
devil_gong
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
兼容iis服务器document root
上级
94a9b2ba
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
38 addition
and
3 deletion
+38
-3
application/admin/controller/Ueditor.php
application/admin/controller/Ueditor.php
+3
-2
application/common.php
application/common.php
+34
-0
extend/base/Uploader.php
extend/base/Uploader.php
+1
-1
未找到文件。
application/admin/controller/Ueditor.php
浏览文件 @
784c9b93
...
...
@@ -275,7 +275,7 @@ class Ueditor extends Common
$end
=
$start
+
$size
;
/* 获取文件列表 */
$path
=
$_SERVER
[
'DOCUMENT_ROOT'
]
.
(
substr
(
$path
,
0
,
1
)
==
"/"
?
""
:
"/"
)
.
$path
;
$path
=
GetDocumentRoot
()
.
(
substr
(
$path
,
0
,
1
)
==
"/"
?
""
:
"/"
)
.
$path
;
$files
=
$this
->
GetFilesList
(
$path
,
$allow_files
);
// 倒序
...
...
@@ -359,6 +359,7 @@ class Ueditor extends Common
if
(
!
is_dir
(
$path
))
return
null
;
if
(
substr
(
$path
,
strlen
(
$path
)
-
1
)
!=
'/'
)
$path
.
=
'/'
;
$handle
=
opendir
(
$path
);
$document_root
=
GetDocumentRoot
();
while
(
false
!==
(
$file
=
readdir
(
$handle
)))
{
if
(
$file
!=
'.'
&&
$file
!=
'..'
)
...
...
@@ -371,7 +372,7 @@ class Ueditor extends Common
if
(
preg_match
(
"/\.("
.
$allow_files
.
")$/i"
,
$file
))
{
$files
[]
=
array
(
'url'
=>
substr
(
$path2
,
strlen
(
$
_SERVER
[
'DOCUMENT_ROOT'
]
)),
'url'
=>
substr
(
$path2
,
strlen
(
$
document_root
)),
'mtime'
=>
filemtime
(
$path2
)
);
}
...
...
application/common.php
浏览文件 @
784c9b93
...
...
@@ -11,6 +11,40 @@
// 应用公共文件
/**
* 获取当前系统所在根路径
* @author Devil
* @blog http://gong.gg/
* @version 1.0.0
* @date 2019-04-09
* @desc description
*/
function
GetDocumentRoot
()
{
// 当前所在的文档根目录
if
(
!
empty
(
$_SERVER
[
'DOCUMENT_ROOT'
]))
{
return
$_SERVER
[
'DOCUMENT_ROOT'
];
}
// 处理iis服务器DOCUMENT_ROOT路径为空
if
(
!
empty
(
$_SERVER
[
'PHP_SELF'
]))
{
// 当前执行程序的绝对路径及文件名
if
(
!
empty
(
$_SERVER
[
'SCRIPT_FILENAME'
]))
{
return
str_replace
(
'\\'
,
'/'
,
substr
(
$_SERVER
[
'SCRIPT_FILENAME'
],
0
,
0
-
strlen
(
$_SERVER
[
'PHP_SELF'
])));
}
// 当前所在绝对路径
if
(
!
empty
(
$_SERVER
[
'PATH_TRANSLATED'
]))
{
return
str_replace
(
'\\'
,
'/'
,
substr
(
str_replace
(
'\\\\'
,
'\\'
,
$_SERVER
[
'PATH_TRANSLATED'
]),
0
,
0
-
strlen
(
$_SERVER
[
'PHP_SELF'
])));
}
}
return
''
;
}
/**
* 生成随机字符串
* @author Devil
...
...
extend/base/Uploader.php
浏览文件 @
784c9b93
...
...
@@ -453,7 +453,7 @@ class Uploader
private
function
getFilePath
()
{
$fullname
=
$this
->
fullName
;
$rootPath
=
$_SERVER
[
'DOCUMENT_ROOT'
]
;
$rootPath
=
GetDocumentRoot
()
;
if
(
substr
(
$fullname
,
0
,
1
)
!=
'/'
)
{
$fullname
=
'/'
.
$fullname
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录