diff --git a/install.php b/install.php index 27d8a721..14f1b2ad 100644 --- a/install.php +++ b/install.php @@ -307,6 +307,7 @@ list($prefixVersion, $suffixVersion) = explode('/', $currentVersion); $installDb->query($installDb->insert('table.options')->rows(array('name' => 'actionTable', 'user' => 0, 'value' => 'a:0:{}'))); $installDb->query($installDb->insert('table.options')->rows(array('name' => 'panelTable', 'user' => 0, 'value' => 'a:0:{}'))); $installDb->query($installDb->insert('table.options')->rows(array('name' => 'attachmentTypes', 'user' => 0, 'value' => '@image@'))); + $installDb->query($installDb->insert('table.options')->rows(array('name' => 'secret', 'user' => 0, 'value' => Typecho_Common::randString(32, true)))); /** 初始分类 */ $installDb->query($installDb->insert('table.metas')->rows(array('name' => _t('默认分类'), 'slug' => 'default', 'type' => 'category', 'description' => _t('只是一个默认分类'), diff --git a/var/Typecho/Common.php b/var/Typecho/Common.php index 8fad579a..3f2da629 100644 --- a/var/Typecho/Common.php +++ b/var/Typecho/Common.php @@ -22,7 +22,7 @@ define('__TYPECHO_MB_SUPPORTED__', function_exists('mb_get_info')); class Typecho_Common { /** 程序版本 */ - const VERSION = '0.9/14.2.24'; + const VERSION = '0.9/14.3.14'; /** * 锁定的代码块 diff --git a/var/Upgrade.php b/var/Upgrade.php index a09dc4e2..aea5d788 100644 --- a/var/Upgrade.php +++ b/var/Upgrade.php @@ -1161,5 +1161,19 @@ Typecho_Date::setTimezoneOffset($options->timezone); break; } } -} + + /** + * v0_9r14_3_14 + * + * @param mixed $db + * @param mixed $options + * @access public + * @return void + */ + public function v0_9r14_3_14($db, $options) + { + $db->query($db->insert('table.options') + ->rows(array('name' => 'secret', 'user' => 0, 'value' => Typecho_Common::randString(32, true)))); + } +} diff --git a/var/Widget/Abstract/Contents.php b/var/Widget/Abstract/Contents.php index 9f0517f2..5c4bc757 100644 --- a/var/Widget/Abstract/Contents.php +++ b/var/Widget/Abstract/Contents.php @@ -717,7 +717,7 @@ class Widget_Abstract_Contents extends Widget_Abstract /** 处理密码保护流程 */ if (!empty($value['password']) && - $value['password'] != $this->request->protectPassword && + $value['password'] != Typecho_Cookie::get('protectPassword') && $value['authorId'] != $this->user->uid && !$this->user->pass('editor', true)) { $value['hidden'] = true; @@ -732,7 +732,8 @@ class Widget_Abstract_Contents extends Widget_Abstract /** 如果访问权限被禁止 */ if ($value['hidden']) { - $value['text'] = '