• R/O
  • HTTP
  • SSH
  • HTTPS

提交

标签
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Commit MetaInfo

修订版3cea92fae68499d07c7d045a2bb9825f854f4b3a (tree)
时间2017-10-21 15:07:48
作者umorigu <umorigu@gmai...>
Commiterumorigu

Log Message

BugTrack/2444 showrss plugin support RSS/Atom

更改概述

差异

--- a/plugin/showrss.inc.php
+++ b/plugin/showrss.inc.php
@@ -281,26 +281,33 @@ class ShowRSS_XML
281281 // Tag start
282282 function start_element($parser, $name, $attrs)
283283 {
284- if ($this->is_item) {
285- $this->tag = $name;
286- } else if ($name == 'ITEM') {
287- $this->is_item = TRUE;
284+ if ($this->is_item !== FALSE) {
285+ $this->tag = $name;
286+ if ($this->is_item === 'ENTRY' && $name === 'LINK' && isset($attrs['HREF'])) {
287+ if (! isset($this->item[$name])) $this->item[$name] = '';
288+ $this->item[$name] .= $attrs['HREF'];
289+ }
290+ } else if ($name === 'ITEM') {
291+ $this->is_item = 'ITEM';
292+ } else if ($name === 'ENTRY') {
293+ $this->is_item = 'ENTRY';
288294 }
289295 }
290296
291297 // Tag end
292298 function end_element($parser, $name)
293299 {
294- if (! $this->is_item || $name != 'ITEM') return;
300+ if ($this->is_item === FALSE || $name !== $this->is_item) return;
295301
296302 $item = array_map(array(& $this, 'escape'), $this->item);
297303 $this->item = array();
298304
299305 if (isset($item['DC:DATE'])) {
300306 $time = plugin_showrss_get_timestamp($item['DC:DATE'], $this->modified_date);
301-
302307 } else if (isset($item['PUBDATE'])) {
303308 $time = plugin_showrss_get_timestamp($item['PUBDATE'], $this->modified_date);
309+ } else if (isset($item['UPDATED'])) {
310+ $time = plugin_showrss_get_timestamp($item['UPDATED'], $this->time);
304311 } else {
305312 $time_from_desc = FALSE;
306313 if (isset($item['DESCRIPTION']) &&
@@ -322,7 +329,7 @@ class ShowRSS_XML
322329
323330 function character_data($parser, $data)
324331 {
325- if (! $this->is_item) return;
332+ if ($this->is_item === FALSE) return;
326333 if (! isset($this->item[$this->tag])) $this->item[$this->tag] = '';
327334 $this->item[$this->tag] .= $data;
328335 }