リビジョン | 16703c9c7c4bc4e932e60f30d90acbfb5e9c5290 (tree) |
---|---|
日時 | 2021-11-29 01:05:04 |
作者 | umorigu <umorigu@gmai...> |
コミッター | umorigu |
BugTrack/2525 Support make_link
@@ -858,10 +858,7 @@ function get_base_uri($uri_type = PKWK_URI_RELATIVE) | ||
858 | 858 | */ |
859 | 859 | function get_page_uri($page, $uri_type = PKWK_URI_RELATIVE) |
860 | 860 | { |
861 | - global $defaultpage, $pkwk_page_uri_handler; | |
862 | - if ($page === $defaultpage) { | |
863 | - return get_base_uri($uri_type); | |
864 | - } | |
861 | + global $pkwk_page_uri_handler; | |
865 | 862 | return get_base_uri($uri_type) . $pkwk_page_uri_handler->get_page_uri_fragment($page); |
866 | 863 | } |
867 | 864 |
@@ -854,9 +854,6 @@ function make_pagelink($page, $alias = '', $anchor = '', $refer = '', $isautolin | ||
854 | 854 | |
855 | 855 | if ($page == '') return '<a href="' . $anchor . '">' . $s_alias . '</a>'; |
856 | 856 | |
857 | - $r_page = pagename_urlencode($page); | |
858 | - $r_refer = ($refer == '') ? '' : '&refer=' . rawurlencode($refer); | |
859 | - | |
860 | 857 | $page_filetime = fast_get_filetime($page); |
861 | 858 | $is_page = $page_filetime !== 0; |
862 | 859 | if (! isset($related[$page]) && $page !== $vars['page'] && $is_page) { |
@@ -877,12 +874,14 @@ function make_pagelink($page, $alias = '', $anchor = '', $refer = '', $isautolin | ||
877 | 874 | if ($s_page !== $s_alias) { |
878 | 875 | $title_attr_html = ' title="' . $s_page . '"'; |
879 | 876 | } |
880 | - return $al_left . '<a ' . 'href="' . $script . '?' . $r_page . $anchor . | |
877 | + return $al_left . '<a ' . 'href="' . get_page_uri($page) . $anchor . | |
881 | 878 | '"' . $title_attr_html . ' class="' . |
882 | 879 | $attrs['class'] . '" data-mtime="' . $attrs['data_mtime'] . |
883 | 880 | '">' . $s_alias . '</a>' . $al_right; |
884 | 881 | } else { |
885 | 882 | // Support Page redirection |
883 | + $r_page = rawurlencode($page); | |
884 | + $r_refer = ($refer == '') ? '' : '&refer=' . rawurlencode($refer); | |
886 | 885 | $redirect_page = get_pagename_on_redirect($page); |
887 | 886 | if ($redirect_page !== false) { |
888 | 887 | return make_pagelink($redirect_page, $s_alias); |