<?php
// PukiWiki - Yet another WikiWikiWeb clone
-// $Id: calendar_viewer.inc.php,v 1.37 2011/01/25 15:01:01 henoheno Exp $
-// Copyright (C) 2002-2005, 2007 PukiWiki Developers Team
+// calendar_viewer.inc.php
+// Copyright 2002-2017 PukiWiki Development Team
// License: GPL v2 or (at your option) any later version
//
// Calendar viewer plugin - List pages that calendar/calnedar2 plugin created
if (PLUGIN_CALENDAR_VIEWER_DATE_FORMAT !== FALSE) {
$time = strtotime(basename($page)); // $date_sep must be assumed '-' or ''!
- if ($time == -1) {
+ if ($time === FALSE || $time === -1) {
$s_page = htmlsc($page); // Failed. Why?
} else {
$week = $weeklabels[date('w', $time)];
return FALSE;
}
}
-
// PukiWiki - Yet another WikiWikiWeb clone
// showrss.inc.php
// Copyright:
-// 2002-2016 PukiWiki Development Team
+// 2002-2017 PukiWiki Development Team
// 2002 PANDA <panda@arino.jp>
// (Original)hiro_do3ob@yahoo.co.jp
// License: GPL, same as PukiWiki
} else if (isset($item['PUBDATE'])) {
$time = plugin_showrss_get_timestamp($item['PUBDATE']);
-
- } else if (isset($item['DESCRIPTION']) &&
- ($description = trim($item['DESCRIPTION'])) != '' &&
- ($time = strtotime($description)) != -1) {
- $time -= LOCALZONE;
-
} else {
- $time = time() - LOCALZONE;
+ $time_from_desc = FALSE;
+ if (isset($item['DESCRIPTION']) &&
+ (($description = trim($item['DESCRIPTION'])) != '')) {
+ $time_from_desc = strtotime($description);
+ }
+ if ($time_from_desc !== FALSE && $time_from_desc !== -1) {
+ $time = $time_from_desc - LOCALZONE;
+ } else {
+ $time = time() - LOCALZONE;
+ }
}
$item['_TIMESTAMP'] = $time;
$date = get_date('Y-m-d', $item['_TIMESTAMP']);
$matches = array();
if (preg_match('/(\d{4}-\d{2}-\d{2})T(\d{2}:\d{2}:\d{2})(([+-])(\d{2}):(\d{2}))?/', $str, $matches)) {
$time = strtotime($matches[1] . ' ' . $matches[2]);
- if ($time == -1) {
+ if ($time === FALSE || $time === -1) {
$time = UTIME;
} else if ($matches[3]) {
$diff = ($matches[5] * 60 + $matches[6]) * 60;
return $time;
} else {
$time = strtotime($str);
- return ($time == -1) ? UTIME : $time - LOCALZONE;
+ return ($time === FALSE || $time === -1) ? UTIME : $time - LOCALZONE;
}
}