• 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

Commit MetaInfo

Révisionc3d7f1c01d1dfd0482e72d7f579e73a2fd97c85b (tree)
l'heure2020-02-08 20:06:10
Auteurumorigu <umorigu@gmai...>
Commiterumorigu

Message de Log

BugTrack/2496 Remove tailing "?" in unexisting page link

Enable to click page name on un existing page.
Compatibility: Set $_symbol_noexists = '?' to use previous behavior.

Change Summary

Modification

--- a/en.lng.php
+++ b/en.lng.php
@@ -2,7 +2,7 @@
22 // PukiWiki - Yet another WikiWikiWeb clone.
33 // en.lng.php
44 // Copyright
5-// 2002-2018 PukiWiki Development Team
5+// 2002-2020 PukiWiki Development Team
66 // 2001-2002 Originally written by yu-ji
77 // License: GPL v2 or (at your option) any later version
88 //
@@ -65,7 +65,7 @@ $_msg_edit_unloadbefore_message = 'Data you have entered will not be saved.';
6565 ///////////////////////////////////////
6666 // Symbols
6767 $_symbol_anchor = '&dagger;';
68-$_symbol_noexists = '?';
68+$_symbol_noexists = '';
6969
7070 ///////////////////////////////////////
7171 // Form buttons
--- a/ja.lng.php
+++ b/ja.lng.php
@@ -2,7 +2,7 @@
22 // PukiWiki - Yet another WikiWikiWeb clone.
33 // ja.lng.php
44 // Copyright
5-// 2002-2018 PukiWiki Development Team
5+// 2002-2020 PukiWiki Development Team
66 // 2001-2002 Originally written by yu-ji
77 // License: GPL v2 or (at your option) any later version
88 //
@@ -67,7 +67,7 @@ $_msg_edit_unloadbefore_message = '入力したデータは保存されません
6767 ///////////////////////////////////////
6868 // Symbols
6969 $_symbol_anchor = '&dagger;';
70-$_symbol_noexists = '?';
70+$_symbol_noexists = '';
7171
7272 ///////////////////////////////////////
7373 // Form buttons
--- a/lib/html.php
+++ b/lib/html.php
@@ -559,13 +559,18 @@ function strip_htmltag($str, $all = TRUE)
559559 global $_symbol_noexists;
560560 static $noexists_pattern;
561561
562- if (! isset($noexists_pattern))
563- $noexists_pattern = '#<span class="noexists">([^<]*)<a[^>]+>' .
564- preg_quote($_symbol_noexists, '#') . '</a></span>#';
565-
566- // Strip Dagnling-Link decoration (Tags and "$_symbol_noexists")
567- $str = preg_replace($noexists_pattern, '$1', $str);
568-
562+ if (! isset($noexists_pattern)) {
563+ if ($_symbol_noexists != '') {
564+ $noexists_pattern = '#<span class="noexists">([^<]*)<a[^>]+>' .
565+ preg_quote($_symbol_noexists, '#') . '</a></span>#';
566+ } else {
567+ $noexists_pattern = '';
568+ }
569+ }
570+ if ($noexists_pattern != '') {
571+ // Strip Dagnling-Link decoration (Tags and "$_symbol_noexists")
572+ $str = preg_replace($noexists_pattern, '$1', $str);
573+ }
569574 if ($all) {
570575 // All other HTML tags
571576 return preg_replace('#<[^>]+>#', '', $str);
--- a/lib/make_link.php
+++ b/lib/make_link.php
@@ -2,7 +2,7 @@
22 // PukiWiki - Yet another WikiWikiWeb clone.
33 // make_link.php
44 // Copyright
5-// 2003-2019 PukiWiki Development Team
5+// 2003-2020 PukiWiki Development Team
66 // 2001-2002 Originally written by yu-ji
77 // License: GPL v2 or (at your option) any later version
88 //
@@ -811,15 +811,18 @@ function make_pagelink($page, $alias = '', $anchor = '', $refer = '', $isautolin
811811 }
812812 // Dangling link
813813 if (PKWK_READONLY) return $s_alias; // No dacorations
814-
815- $retval = $s_alias . '<a href="' .
816- $script . '?cmd=edit&amp;page=' . $r_page . $r_refer . '">' .
817- $_symbol_noexists . '</a>';
818-
819- if ($link_compact) {
814+ $symbol_html = '';
815+ if ($_symbol_noexists !== '') {
816+ $symbol_html = '<span style="user-select:none;">' .
817+ htmlsc($_symbol_noexists) . '</span>';
818+ }
819+ $href = $script . '?cmd=edit&amp;page=' . $r_page . $r_refer;
820+ if ($link_compact && $_symbol_noexists != '') {
821+ $retval = '<a href="' . $href . '">' . $_symbol_noexists . '</a>';
820822 return $retval;
821823 } else {
822- return '<span class="noexists">' . $retval . '</span>';
824+ $retval = '<a href="' . $href . '">' . $s_alias . '</a>';
825+ return '<span class="noexists">' . $retval . $symbol_html . '</span>';
823826 }
824827 }
825828 }
--- a/plugin/yetlist.inc.php
+++ b/plugin/yetlist.inc.php
@@ -1,7 +1,7 @@
11 <?php
22 // PukiWiki - Yet another WikiWikiWeb clone
33 // yetlist.inc.php
4-// Copyright 2001-2017 PukiWiki Development Team
4+// Copyright 2001-2020 PukiWiki Development Team
55 // License: GPL v2 or (at your option) any later version
66 //
77 // Yet list plugin - Show a list of dangling links (not yet created)
@@ -54,10 +54,15 @@ function plugin_yetlist_action()
5454 $href = $s_page;
5555 } else {
5656 // Dangling link
57- $href = '<span class="noexists">' . $s_page . '<a href="' .
57+ $symbol_html = '';
58+ if ($_symbol_noexists !== '') {
59+ $symbol_html = '<span style="user-select:none;">' .
60+ htmlsc($_symbol_noexists) . '</span>';
61+ }
62+ $href = '<span class="noexists"><a href="' .
5863 $script . '?cmd=edit&amp;page=' . rawurlencode($page) .
59- '&amp;refer=' . $r_refer . '">' . $_symbol_noexists .
60- '</a></span>';
64+ '&amp;refer=' . $r_refer . '">' . $s_page .
65+ '</a>' . $symbol_html . '</span>';
6166 }
6267 $retval['body'] .= '<li>' . $href . ' <em>(' . $link_ref . ')</em></li>' . "\n";
6368 }