From 4fc51abc5736d818d029640029d3de0f8ab8cc15 Mon Sep 17 00:00:00 2001
From: Stephen Warren <swarren@wwwdotorg.org>
Date: Mon, 22 Feb 2010 22:09:14 +0100
Subject: [PATCH] Omit do=show from URLs

It looks like when there is no "do=" parameter to doku.php, "show" is
assumed. When clean URLs are used (via mod_rewrite), regular
page-to-page links hence just link to "pagename". However, if you "Show
pagesource", then "Show page", the browser is sent back to
"pagename?do=show" instead of just "pagename". This seems like a "less
clean" URL to me.

So, the attached patch removes "do=show" from URLs in this case, so
cleaner URLs are used.
---
 inc/template.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/inc/template.php b/inc/template.php
index df0c94437..f15b51694 100644
--- a/inc/template.php
+++ b/inc/template.php
@@ -630,7 +630,7 @@ function tpl_actionlink($type,$pre='',$suf='',$inner='',$return=false){
                                 'class="action source" accesskey="v" rel="nofollow"',1);
                 }
             }else{
-                $out .= tpl_link(wl($ID,'do=show'),
+                $out .= tpl_link(wl($ID,''),
                         $pre.(($inner)?$inner:$lang['btn_show']).$suf,
                         'class="action show" accesskey="v" rel="nofollow"',1);
             }
@@ -659,7 +659,7 @@ function tpl_actionlink($type,$pre='',$suf='',$inner='',$return=false){
             break;
         case 'back':
             if ($parent = tpl_getparent($ID)) {
-                $out .= tpl_link(wl($parent,'do=show'),
+                $out .= tpl_link(wl($parent,''),
                         $pre.(($inner)?$inner:$lang['btn_back']).$suf,
                         'class="action back" accesskey="b" rel="nofollow"',1);
             }
-- 
GitLab