西元2005年07月03日

WordPress 的小日曆 bug

剛剛我發現我這裡的 calendar 已經跳到 6 月, 像這樣 :
WP Calendar error

於是去看了 , 也都有這個問題.

看過程式之後, 果然是 gmt_offset 所產生的問題.

因為在 wp-includes/functions.php 中的 current_time 這個 function 提供了兩種格式: mysql 跟 timestamp .
而 mysql 的格式用了 gmdate , 所以加上 gmt_offset 之後是沒問題的.
timestamp 卻因為使用了 time , 所以再加上 gmt_offset 之後會出現異常.
因為我發現只有 calendar 出問題, 所以我只改了 wp-includes/template-functions-general.php 這個檔案, 沒有修改 current_time 這個 function .

如果您的站台的 calendar 也有相同問題的話, 請修改 wp-includes/template-functions-general.php , 把原先這兩行註解掉:

$thisyear = gmdate('Y', current_time('timestamp') + get_settings('gmt_offset') * 3600);
$thismonth = gmdate('m', current_time('timestamp') + get_settings('gmt_offset') * 3600);

加進這兩行 :
$thisyear = gmdate('Y', current_time('timestamp'));
$thismonth = gmdate('m', current_time('timestamp'));

也就是變成這樣 :
// $thisyear = gmdate('Y', current_time('timestamp') + get_settings('gmt_offset') * 3600);
// $thismonth = gmdate('m', current_time('timestamp') + get_settings('gmt_offset') * 3600);
$thisyear = gmdate('Y', current_time('timestamp'));
$thismonth = gmdate('m', current_time('timestamp'));

如果您有 shell login 權限的話, 可以到您的 WordPress 主目錄, 然後抓取 這個檔案 後用這個指令做修正 :
patch < template-functions-general.diff.txt

艾葳的 8-way Opteron 系統

國外已經有人進行效能測試了, 文章 在這 .

128GB 的 RAM 不說, 光是看到 這張圖 , 就夠迷人了... orz

PhpBB is a pain!?

前陣子在 Weblog Tools Collection 出現 這篇 .

如果是從以前就有在看我這個 Blog 的人, 應該也都看過 phpBB 的版本更新訊息.

在各種論壇系統裡面, phpBB 的效能算是很好的一套, 而且在全世界站台中, 使用的比率又很高. 於是, phpBB 便成了許多攻擊者的頭號目標 ( 樹大招風!? ) .

當然, 還是老話.
世界上沒有絕對安全的系統, 只有絕對勤勞的系統管理/維護人員.
( 不過可能已經有不少人因為這個因素而跳槽使用別的系統了. XD )

PhpBB 2.0.16 released !

2.0.16 有安全性修正 , 而且在最常被存取的 viewtopic.php :

$message = str_replace('"', '"', substr(@preg_replace('#(>(((?>([^>< ]+|(?R)))*)<))#se', "@preg_replace('#b(" . str_replace('\', '\\', $highlight_match) . ")b#i', '<span style="color:#" . $theme['fontcolor3'] . ""><b>\\1</b>', '\0')", '>' . $message . '< '), 1, -1));
改為
$message = str_replace('"', '"', substr(@preg_replace('#(>(((?>([^>< ]+|(?R)))*)<))#se', "@preg_replace('#b(" . str_replace('\', '\\', addslashes($highlight_match)) . ")b#i', '<span style="color:#" . $theme['fontcolor3'] . ""><b>\\1</b>', '\0')", '>' . $message . '< '), 1, -1));

更新範圍列表如下 :

  • Fixed critical issue with highlighting – Discovered and fix provided by Ron van Daal

  • Url descriptions able to be wrapped over more than one line again

  • Fixed bug with eAccelerator in admin_ug_auth.php

  • Check new_forum_id for existence in modcp.php – alessnet

  • Prevent uploading avatars with no dimensions – Xpert

  • Fixed bug in usercp_register.php, forcing avatar file removal without updating avatar informations within the database – HenkPoley

  • Fixed bug in admin re-authentication redirect for servers not having index.php as one of their default files set

官方公告 在此 .
竹貓星球 也發出了 這篇公告 .

Newzilla.org 消失了.. O_O

因為之前在自己的 wiki 上面有整理 Newzilla 的文章, 所以剛剛想再去翻翻有沒有新文件出版.

赫然發現 Newzilla 一直連不上. O_O

不過, 我們這種小晚輩也沒資格說話, 現在只能祈禱它趕快恢復營業了. XD