• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
Aucun tag

Frequently used words (click to add to your profile)

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

blogger


Commit MetaInfo

Révision9efb23d18b6610efe09d72f5a9fb8989f06380e2 (tree)
l'heure2017-10-27 07:02:22
Auteurumorigu <umorigu@gmai...>
Commiterumorigu

Message de Log

BugTrack/2283 Fasten ls2 plugin listing on no-title or no-include

Change Summary

Modification

--- a/plugin/ls2.inc.php
+++ b/plugin/ls2.inc.php
@@ -145,15 +145,20 @@ function plugin_ls2_get_headings($page, & $params, $level, $include = FALSE)
145145
146146 $anchor = PLUGIN_LS2_ANCHOR_ORIGIN;
147147 $matches = array();
148+ $is_title = $params['title'];
149+ $is_include = $params['include'];
150+ if (!$is_title && !$is_include) {
151+ return;
152+ }
148153 foreach (get_source($page) as $line) {
149- if ($params['title'] && preg_match('/^(\*{1,3})/', $line, $matches)) {
154+ if ($is_title && preg_match('/^(\*{1,3})/', $line, $matches)) {
150155 $id = make_heading($line);
151156 $level = strlen($matches[1]);
152157 $id = PLUGIN_LS2_ANCHOR_PREFIX . $anchor++;
153158 plugin_ls2_list_push($params, $level + strlen($level));
154159 array_push($params['result'],
155160 '<li><a href="' . $href . $id . '">' . $line . '</a>');
156- } else if ($params['include'] &&
161+ } else if ($is_include &&
157162 preg_match('/^#include\((.+)\)/', $line, $matches) &&
158163 is_page($matches[1]))
159164 {