mirror of
https://github.com/typecho/typecho.git
synced 2025-04-21 18:21:53 +02:00
add constant to disable theme file writing
This commit is contained in:
parent
77088e226f
commit
18acb3cb27
@ -84,7 +84,8 @@ class Widget_Themes_Edit extends Widget_Abstract_Options implements Widget_Inter
|
||||
{
|
||||
$path = __TYPECHO_ROOT_DIR__ . __TYPECHO_THEME_DIR__ . '/' . trim($theme, './') . '/' . trim($file, './');
|
||||
|
||||
if (file_exists($path) && is_writeable($path) && !Typecho_Common::isAppEngine()) {
|
||||
if (file_exists($path) && is_writeable($path) && !Typecho_Common::isAppEngine()
|
||||
&& (!defined('__TYPECHO_THEME_WRITEABLE__') || __TYPECHO_THEME_WRITEABLE__)) {
|
||||
$handle = fopen($path, 'wb');
|
||||
if ($handle && fwrite($handle, $this->request->content)) {
|
||||
fclose($handle);
|
||||
|
@ -107,7 +107,8 @@ class Widget_Themes_Files extends Typecho_Widget
|
||||
public function currentIsWriteable()
|
||||
{
|
||||
return is_writeable(__TYPECHO_ROOT_DIR__ . __TYPECHO_THEME_DIR__ . '/' .
|
||||
$this->_currentTheme . '/' . $this->_currentFile) && !Typecho_Common::isAppEngine();
|
||||
$this->_currentTheme . '/' . $this->_currentFile) && !Typecho_Common::isAppEngine()
|
||||
&& (!defined('__TYPECHO_THEME_WRITEABLE__') || __TYPECHO_THEME_WRITEABLE__);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user