Category::Plugin

showrss のタイムスタンプの処理が冗長

メッセージ

plugin_showrss_get_timestamp の処理において、タイムスタンプの処理が冗長になっていますので、strtotime() に任せるようにしました。

--- showrss.inc.php.ORG 2005-06-04 21:43:58.485997780 +0900
+++ showrss.inc.php     2005-06-04 21:45:16.359433684 +0900
@@ -298,12 +298,11 @@
                $time = strtotime($str);
                return ($time == -1) ? UTIME : $time - LOCALZONE;
        }
-       $str  = $matches[1];
-       $time = strtotime($matches[1] . ' ' . $matches[2]);
+       $str  = $matches[1] . ' ' . $matches[2];
        if (! empty($matches[3])) {
-               $diff = ($matches[5] * 60 + $matches[6]) * 60;
-               $time += ($matches[4] == '-' ? $diff : -$diff);
+               $str .= ' ' . $matches[4].$matches[5].$matches[6];
        }
+       $time = strtotime($str);
        return $time;
 }
 ?>

ちょっとデバッグしていたんですが、従来のこの処理って、うまく機能していないような感じです。確認してみて下さい。とりあえず、冗長としておきますが。




トップ   編集 凍結 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2010-08-16 (月) 21:43:51
Site admin: PukiWiki Development Team

PukiWiki 1.5.4+ © 2001-2022 PukiWiki Development Team. Powered by PHP 8.2.12. HTML convert time: 0.225 sec.

SourceForge