Commit MetaInfo

修订版bc17aa42e5b628523968fc08a3441f73e4c0a9d1 (tree)
时间2017-11-01 05:28:36
作者umorigu <umorigu@gmai...>
Commiterumorigu

Log Message

BugTrack/2283 ls2 plugin: Improve include loop handling

PHP4 cannot use referenced parameters with default value.

更改概述

差异

--- a/plugin/ls2.inc.php
+++ b/plugin/ls2.inc.php
@@ -112,16 +112,20 @@ function plugin_ls2_show_lists($prefix, & $params)
112112 } else {
113113 $params['result'] = $params['saved'] = array();
114114 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);
116117 return join("\n", $params['result']) . join("\n", $params['saved']);
117118 }
118119 }
119120
120121 function plugin_ls2_get_headings($page, & $params, $level, $include = FALSE,
121- &$read_pages = array())
122+ &$read_pages)
122123 {
123124 static $_ls2_anchor = 0;
124125
126+ if (is_null($read_pages)) {
127+ $read_pages = array();
128+ }
125129 // ページが未表示のとき
126130 $is_done = isset($read_pages[$page]);
127131 if (! $is_done) $params["page_$page"] = ++$_ls2_anchor;
Show on old repository browser