Revision: 1385
Author: magike.net
Date: Mon Mar 15 22:51:24 2010
Log: 增加remember直接返回参数
http://code.google.com/p/typecho/source/detail?r=1385
Modified:
/trunk/var/Widget/Archive.php
=======================================
--- /trunk/var/Widget/Archive.php Sun Mar 7 06:52:54 2010
+++ /trunk/var/Widget/Archive.php Mon Mar 15 22:51:24 2010
@@ -1522,17 +1522,22 @@
*
* @access public
* @param string $cookieName 已经记忆的cookie名称
- * @param string $clear 及时清理cookie
+ * @param string $return 是否返回
* @return string
*/
- public function remember($cookieName, $clear = false)
- {
+ public function remember($cookieName, $return = false)
+ {
+ $cookieName = strtolower($cookieName);
+ if (!in_array($cookieName, array('author', 'mail', 'url'))) {
+ return;
+ }
+
$value = Typecho_Cookie::get('__typecho_remember_' . $cookieName);
- if ($clear) {
- Typecho_Cookie::delete('__typecho_remember_' . $cookieName);
- }
-
- echo htmlspecialchars($value);
+ if ($return) {
+ return $value;
+ } else {
+ echo htmlspecialchars($value);
+ }
}
/**
_______________________________________________
announce mailing list
[email protected]
http://lists.typecho.org/mailman/listinfo/announce