韌館-LearnHouse

網誌內褲被看光光了

網誌露陷了!!

所有的秘密文章曝光!!

一大漏洞,趕快Update....

引用:今天裝了 Secret Post 這個 Plugin ,也稍微測試了一下,閱讀文章的時候,確實需要有密碼,才能一窺全文 (內文+延伸內文). 不然的話,只能看到前面的部分 (內文那一段)。

啟用方式:
1.個人網誌設定 >系統安全 > 秘密文章設定 >啟動外掛
2.發表文章時 在密碼欄位輸入密碼 並且於右下方勾選enable passwoed protected

不過,在 rss 和 summary 的部分還是會被顯示出來,所以還是要做修正。

參考資料: http://panda.plog.mlc.edu.tw/post/1/16

解決方式:
1.解決summary顯示問題.
修改 templates/summary/post.template 檔案
分別
檔案的開頭新增2行:
{assign var=isSecretField value=$post->getFieldObject("password_protected")}
{if empty($isSecretField) || $isSecretField->getValue() != 1}

中間維持原本內容不變.

檔案的最後新增1行:
{/if}

2.解決 rss 顯示問題.
a.修改 templates/rss/rss090.template 檔案
找到以下內容:
<description>{$post->getText()|escape}</description>
修改為:
<description>
{assign var=isSecretField value=$post->getFieldObject("password_protected")}
{if empty($isSecretField) || $isSecretField->getValue() != 1}
{$post->getText()|escape}
{/if}
</description>

b.修改 templates/rss/rss10.template 檔案
找到以下內容:
<dc:description>{$post->getText()|escape}</dc:description>
修改為:
<dc:description>
{assign var=isSecretField value=$post->getFieldObject("password_protected")}
{if empty($isSecretField) || $isSecretField->getValue() != 1}
{$post->getText()|escape}
{/if}
<dc:description>

c.修改 templates/rss/rss20.template 檔案
修改內容同 a 步驟 rss090.template

d.修改 templates/rss/atom.template 檔案
刪除:
<summary type="text/plain">{$post->getText()|strip_tags|truncate:200:" ..."}</s
ummary>

修改
<content type="text/html" mode="escaped" xml:lang="{$locale->getLanguageId()|lower}" xml:base="{$url->blogLink()}">
{$post->getText()|escape}
</content>

變成:
<content type="text/html" mode="escaped" xml:lang="{$locale->getLanguageId()|lower}" xml:base="{$url->blogLink()}">
{assign var=isSecretField value=$post->getFieldObject("password_protected")}
{if empty($isSecretField) || $isSecretField->getValue() != 1}
{$post->getText()|escape}
{/if}</content>

關於d步驟 同樣的也沒有atom協定client工具,所以只以瀏覽器無法看到文章當作基準 : (

補充說明:除了 templates/rss/ 中的 atom rss090 rss10 rss20 要修改之外.
templates/summary/rss/中的 atom rss090 rss10 rss20 xml 也需要改喔.

引用網址

這次按照教學修改,RSS1.0的版本似乎會使得文章全部取得不到,不過還有其他版本的RSS與ATOM,因此看不到總比被人看光光的好XD,因此就不管了

這次的修改中讓我發現新的名詞,就是ATOM,聽說是為了修改RSS2.0的一些缺點而開發出來了。

2007年1 月 posted by admin in 網誌歷程 and have Comments (2)

2 Responses to “網誌內褲被看光光了”

  1. yuchin表示:

    哈哈 就是因為看不懂才用秘密文章
    自己慢慢看就好!!

Place your comment

Please fill your data and comment below.
名稱:
信箱:
網站:
您的評論: