Revision | 4e4b9a146d392170da0f67256197215d7a23de00 (tree) |
---|---|
Time | 2017-11-01 05:28:36 |
Author | umorigu <umorigu@gmai...> |
Commiter | umorigu |
BugTrack/2283 ls2 plugin: Improve include loop handling
PHP4 cannot use referenced parameters with default value.
@@ -112,16 +112,20 @@ function plugin_ls2_show_lists($prefix, & $params) | ||
112 | 112 | } else { |
113 | 113 | $params['result'] = $params['saved'] = array(); |
114 | 114 | foreach ($pages as $page) |
115 | - plugin_ls2_get_headings($page, $params, 1); | |
115 | + $read_pages = array(); // read pages per page | |
116 | + plugin_ls2_get_headings($page, $params, 1, false, $read_pages); | |
116 | 117 | return join("\n", $params['result']) . join("\n", $params['saved']); |
117 | 118 | } |
118 | 119 | } |
119 | 120 | |
120 | 121 | function plugin_ls2_get_headings($page, & $params, $level, $include = FALSE, |
121 | - &$read_pages = array()) | |
122 | + &$read_pages) | |
122 | 123 | { |
123 | 124 | static $_ls2_anchor = 0; |
124 | 125 | |
126 | + if (is_null($read_pages)) { | |
127 | + $read_pages = array(); | |
128 | + } | |
125 | 129 | // ページが未表示のとき |
126 | 130 | $is_done = isset($read_pages[$page]); |
127 | 131 | if (! $is_done) $params["page_$page"] = ++$_ls2_anchor; |