diff --git a/var/Widget/Archive.php b/var/Widget/Archive.php index 58e683ce..8fe5d1da 100644 --- a/var/Widget/Archive.php +++ b/var/Widget/Archive.php @@ -234,10 +234,7 @@ class Widget_Archive extends Widget_Abstract_Contents } /** 初始化皮肤路径 */ - $this->_themeDir = - rtrim($this->options->themeFile( - is_dir($this->options->themeFile($this->options->theme)) ? - $this->options->theme : 'default'), '/') . '/'; + $this->_themeDir = rtrim($this->options->themeFile($this->options->theme), '/') . '/'; /** 处理feed模式 **/ if ('feed' == $this->parameter->type) { diff --git a/var/Widget/Options.php b/var/Widget/Options.php index 18bd86fb..e673cf28 100644 --- a/var/Widget/Options.php +++ b/var/Widget/Options.php @@ -366,6 +366,9 @@ class Widget_Options extends Typecho_Widget $this->siteUrl = Typecho_Common::url(NULL, $this->siteUrl); $this->plugins = unserialize($this->plugins); + /** 动态判断皮肤目录 */ + $this->theme = is_dir($this->themeFile($this->theme)) ? $this->theme : 'default'; + /** 动态获取根目录 */ $this->rootUrl = $this->request->getRequestRoot(); if (defined('__TYPECHO_ADMIN__')) {