Révision | c3d7f1c01d1dfd0482e72d7f579e73a2fd97c85b (tree) |
---|---|
l'heure | 2020-02-08 20:06:10 |
Auteur | umorigu <umorigu@gmai...> |
Commiter | umorigu |
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.
@@ -2,7 +2,7 @@ | ||
2 | 2 | // PukiWiki - Yet another WikiWikiWeb clone. |
3 | 3 | // en.lng.php |
4 | 4 | // Copyright |
5 | -// 2002-2018 PukiWiki Development Team | |
5 | +// 2002-2020 PukiWiki Development Team | |
6 | 6 | // 2001-2002 Originally written by yu-ji |
7 | 7 | // License: GPL v2 or (at your option) any later version |
8 | 8 | // |
@@ -65,7 +65,7 @@ $_msg_edit_unloadbefore_message = 'Data you have entered will not be saved.'; | ||
65 | 65 | /////////////////////////////////////// |
66 | 66 | // Symbols |
67 | 67 | $_symbol_anchor = '†'; |
68 | -$_symbol_noexists = '?'; | |
68 | +$_symbol_noexists = ''; | |
69 | 69 | |
70 | 70 | /////////////////////////////////////// |
71 | 71 | // Form buttons |
@@ -2,7 +2,7 @@ | ||
2 | 2 | // PukiWiki - Yet another WikiWikiWeb clone. |
3 | 3 | // ja.lng.php |
4 | 4 | // Copyright |
5 | -// 2002-2018 PukiWiki Development Team | |
5 | +// 2002-2020 PukiWiki Development Team | |
6 | 6 | // 2001-2002 Originally written by yu-ji |
7 | 7 | // License: GPL v2 or (at your option) any later version |
8 | 8 | // |
@@ -67,7 +67,7 @@ $_msg_edit_unloadbefore_message = '入力したデータは保存されません | ||
67 | 67 | /////////////////////////////////////// |
68 | 68 | // Symbols |
69 | 69 | $_symbol_anchor = '†'; |
70 | -$_symbol_noexists = '?'; | |
70 | +$_symbol_noexists = ''; | |
71 | 71 | |
72 | 72 | /////////////////////////////////////// |
73 | 73 | // Form buttons |
@@ -559,13 +559,18 @@ function strip_htmltag($str, $all = TRUE) | ||
559 | 559 | global $_symbol_noexists; |
560 | 560 | static $noexists_pattern; |
561 | 561 | |
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 | + } | |
569 | 574 | if ($all) { |
570 | 575 | // All other HTML tags |
571 | 576 | return preg_replace('#<[^>]+>#', '', $str); |
@@ -2,7 +2,7 @@ | ||
2 | 2 | // PukiWiki - Yet another WikiWikiWeb clone. |
3 | 3 | // make_link.php |
4 | 4 | // Copyright |
5 | -// 2003-2019 PukiWiki Development Team | |
5 | +// 2003-2020 PukiWiki Development Team | |
6 | 6 | // 2001-2002 Originally written by yu-ji |
7 | 7 | // License: GPL v2 or (at your option) any later version |
8 | 8 | // |
@@ -811,15 +811,18 @@ function make_pagelink($page, $alias = '', $anchor = '', $refer = '', $isautolin | ||
811 | 811 | } |
812 | 812 | // Dangling link |
813 | 813 | if (PKWK_READONLY) return $s_alias; // No dacorations |
814 | - | |
815 | - $retval = $s_alias . '<a href="' . | |
816 | - $script . '?cmd=edit&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&page=' . $r_page . $r_refer; | |
820 | + if ($link_compact && $_symbol_noexists != '') { | |
821 | + $retval = '<a href="' . $href . '">' . $_symbol_noexists . '</a>'; | |
820 | 822 | return $retval; |
821 | 823 | } 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>'; | |
823 | 826 | } |
824 | 827 | } |
825 | 828 | } |
@@ -1,7 +1,7 @@ | ||
1 | 1 | <?php |
2 | 2 | // PukiWiki - Yet another WikiWikiWeb clone |
3 | 3 | // yetlist.inc.php |
4 | -// Copyright 2001-2017 PukiWiki Development Team | |
4 | +// Copyright 2001-2020 PukiWiki Development Team | |
5 | 5 | // License: GPL v2 or (at your option) any later version |
6 | 6 | // |
7 | 7 | // Yet list plugin - Show a list of dangling links (not yet created) |
@@ -54,10 +54,15 @@ function plugin_yetlist_action() | ||
54 | 54 | $href = $s_page; |
55 | 55 | } else { |
56 | 56 | // 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="' . | |
58 | 63 | $script . '?cmd=edit&page=' . rawurlencode($page) . |
59 | - '&refer=' . $r_refer . '">' . $_symbol_noexists . | |
60 | - '</a></span>'; | |
64 | + '&refer=' . $r_refer . '">' . $s_page . | |
65 | + '</a>' . $symbol_html . '</span>'; | |
61 | 66 | } |
62 | 67 | $retval['body'] .= '<li>' . $href . ' <em>(' . $link_ref . ')</em></li>' . "\n"; |
63 | 68 | } |