diff --git a/install.php b/install.php index 362cee78..a5fd72eb 100644 --- a/install.php +++ b/install.php @@ -759,7 +759,7 @@ function install_step_1_perform() $realUploadDir = \Typecho\Common::url($uploadDir, __TYPECHO_ROOT_DIR__); $writeable = true; if (is_dir($realUploadDir)) { - if (!is_writeable($realUploadDir) || !is_readable($realUploadDir)) { + if (!is_writable($realUploadDir) || !is_readable($realUploadDir)) { if (!@chmod($realUploadDir, 0755)) { $writeable = false; } diff --git a/var/Utils/Upgrade.php b/var/Utils/Upgrade.php index 2a1cdb12..78737eaf 100644 --- a/var/Utils/Upgrade.php +++ b/var/Utils/Upgrade.php @@ -103,7 +103,7 @@ class Upgrade */ public static function v0_4r9_1_14($db, $options) { - if (is_writeable(__TYPECHO_ROOT_DIR__ . '/config.inc.php')) { + if (is_writable(__TYPECHO_ROOT_DIR__ . '/config.inc.php')) { $handle = fopen(__TYPECHO_ROOT_DIR__ . '/config.inc.php', 'ab'); fwrite($handle, ' /** 初始化时区 */ @@ -351,7 +351,7 @@ Typecho_Date::setTimezoneOffset($options->timezone); //创建上传目录 $uploadDir = Common::url(Upload::UPLOAD_DIR, __TYPECHO_ROOT_DIR__); if (is_dir($uploadDir)) { - if (!is_writeable($uploadDir)) { + if (!is_writable($uploadDir)) { if (!@chmod($uploadDir, 0755)) { throw new \Typecho\Widget\Exception(_t('上传目录无法写入, 请手动将安装目录下的 %s 目录的权限设置为可写然后继续升级', Upload::UPLOAD_DIR)); } @@ -530,7 +530,7 @@ Typecho_Date::setTimezoneOffset($options->timezone); ->rows(['name' => 'gzip', 'user' => 0, 'value' => 0])); - if (is_writeable(__TYPECHO_ROOT_DIR__ . '/config.inc.php')) { + if (is_writable(__TYPECHO_ROOT_DIR__ . '/config.inc.php')) { $contents = file_get_contents(__TYPECHO_ROOT_DIR__ . '/config.inc.php'); $contents = preg_replace("/Common::init([^;]+);/is", "Common::init(array( 'autoLoad' => true, diff --git a/var/Widget/Options/Permalink.php b/var/Widget/Options/Permalink.php index a859950a..a266fedb 100644 --- a/var/Widget/Options/Permalink.php +++ b/var/Widget/Options/Permalink.php @@ -67,7 +67,7 @@ class Permalink extends Options implements ActionInterface $hasWrote = false; if (!file_exists(__TYPECHO_ROOT_DIR__ . '/.htaccess') && strpos(php_sapi_name(), 'apache') !== false) { - if (is_writeable(__TYPECHO_ROOT_DIR__)) { + if (is_writable(__TYPECHO_ROOT_DIR__)) { $parsed = parse_url($this->options->siteUrl); $basePath = empty($parsed['path']) ? '/' : $parsed['path']; $basePath = rtrim($basePath, '/') . '/'; @@ -215,7 +215,7 @@ RewriteRule . {$basePath}index.php [L] if ( strpos(php_sapi_name(), 'apache') !== false && !file_exists(__TYPECHO_ROOT_DIR__ . '/.htaccess') - && !is_writeable(__TYPECHO_ROOT_DIR__) + && !is_writable(__TYPECHO_ROOT_DIR__) ) { $errorStr .= '
' . _t('我们检测到你使用了apache服务器, 但是程序无法在根目录创建.htaccess文件, 这可能是产生这个错误的原因.') . _t('请调整你的目录权限, 或者手动创建一个.htaccess文件.') . ''; diff --git a/var/Widget/Themes/Edit.php b/var/Widget/Themes/Edit.php index 5b1cb1a4..588801c9 100644 --- a/var/Widget/Themes/Edit.php +++ b/var/Widget/Themes/Edit.php @@ -103,7 +103,7 @@ class Edit extends Options implements ActionInterface $path = $this->options->themeFile($theme, $file); if ( - file_exists($path) && is_writeable($path) + file_exists($path) && is_writable($path) && (!defined('__TYPECHO_THEME_WRITEABLE__') || __TYPECHO_THEME_WRITEABLE__) ) { $handle = fopen($path, 'wb'); diff --git a/var/Widget/Themes/Files.php b/var/Widget/Themes/Files.php index a44ba928..5eb2e7b5 100644 --- a/var/Widget/Themes/Files.php +++ b/var/Widget/Themes/Files.php @@ -120,7 +120,7 @@ class Files extends Base */ public function currentIsWriteable(): bool { - return is_writeable(Options::alloc() + return is_writable(Options::alloc() ->themeFile($this->currentTheme, $this->currentFile)) && self::isWriteable(); }