mirror of
https://github.com/typecho/typecho.git
synced 2025-04-21 02:01:52 +02:00
fix #1178, change directory permission from 0777 to 0755
This commit is contained in:
parent
4e5b88821d
commit
64b8e68688
2
.github/workflows/Typecho-dev-Ci.yml
vendored
2
.github/workflows/Typecho-dev-Ci.yml
vendored
@ -41,7 +41,7 @@ jobs:
|
||||
mkdir build
|
||||
cp -r LICENSE.txt index.php install.php admin install usr var build/
|
||||
mkdir build/usr/uploads/
|
||||
chmod 777 build/usr/uploads/
|
||||
chmod 755 build/usr/uploads/
|
||||
rm -rf build/admin/src
|
||||
cd build && zip -q -r typecho.zip * && mv typecho.zip ../ && cd -
|
||||
- name: Upload a Build Artifact
|
||||
|
2
.github/workflows/Typecho-release-Ci.yml
vendored
2
.github/workflows/Typecho-release-Ci.yml
vendored
@ -14,7 +14,7 @@ jobs:
|
||||
mkdir build
|
||||
cp -r LICENSE.txt index.php install.php admin install usr var build/
|
||||
mkdir build/usr/uploads/
|
||||
chmod 777 build/usr/uploads/
|
||||
chmod 755 build/usr/uploads/
|
||||
rm -rf build/admin/src
|
||||
cd build && zip -q -r typecho.zip * && mv typecho.zip ../ && cd -
|
||||
- name: Create Release
|
||||
|
@ -752,13 +752,13 @@ function install_step_1_perform()
|
||||
$realUploadDir = \Typecho\Common::url($uploadDir, __TYPECHO_ROOT_DIR__);
|
||||
$writeable = true;
|
||||
if (is_dir($realUploadDir)) {
|
||||
if (!is_writeable($realUploadDir)) {
|
||||
if (!@chmod($realUploadDir, 0644)) {
|
||||
if (!is_writeable($realUploadDir) || !is_readable($realUploadDir)) {
|
||||
if (!@chmod($realUploadDir, 0755)) {
|
||||
$writeable = false;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!@mkdir($realUploadDir, 0644)) {
|
||||
if (!@mkdir($realUploadDir, 0755)) {
|
||||
$writeable = false;
|
||||
}
|
||||
}
|
||||
|
@ -352,12 +352,12 @@ Typecho_Date::setTimezoneOffset($options->timezone);
|
||||
$uploadDir = Common::url(Upload::UPLOAD_DIR, __TYPECHO_ROOT_DIR__);
|
||||
if (is_dir($uploadDir)) {
|
||||
if (!is_writeable($uploadDir)) {
|
||||
if (!@chmod($uploadDir, 0644)) {
|
||||
if (!@chmod($uploadDir, 0755)) {
|
||||
throw new \Typecho\Widget\Exception(_t('上传目录无法写入, 请手动将安装目录下的 %s 目录的权限设置为可写然后继续升级', Upload::UPLOAD_DIR));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!@mkdir($uploadDir, 0644)) {
|
||||
if (!@mkdir($uploadDir, 0755)) {
|
||||
throw new \Typecho\Widget\Exception(_t('上传目录无法创建, 请手动创建安装目录下的 %s 目录, 并将它的权限设置为可写然后继续升级', Upload::UPLOAD_DIR));
|
||||
}
|
||||
}
|
||||
|
@ -273,14 +273,10 @@ class Upload extends Contents implements ActionInterface
|
||||
return true;
|
||||
}
|
||||
|
||||
if (!@mkdir($last)) {
|
||||
if (!@mkdir($last, 0755)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$stat = @stat($last);
|
||||
$perms = $stat['mode'] & 0007777;
|
||||
@chmod($last, $perms);
|
||||
|
||||
return self::makeUploadDir($path);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user