Don't show invalid actions
Don't show invalid actions

file:a/index.php -> file:b/index.php
--- a/index.php
+++ b/index.php
@@ -56,8 +56,10 @@
 	$tpl->assign("project",$_GET['p']);
 	require_once('include/gitutil.git_project_descr.php');
 	$tpl->assign("projectdescription",git_project_descr($gitphp_conf['projectroot'],$_GET['p']));
-	if (isset($_GET['a']))
+	if (isset($_GET['a'])) {
 		$tpl->assign("action",$_GET['a']);
+		$tpl->assign("validaction", TRUE);
+	}
  }
  if (isset($_GET['st']))
  	$tpl->assign("currentsearchtype",$_GET['st']);
@@ -174,6 +176,7 @@
 					git_tag($gitphp_conf['projectroot'],$_GET['p'],$_GET['h']);
 					break;
 				default:
+					$tpl->assign("validaction", FALSE);
 					require_once('include/display.git_message.php');
 					git_message("Unknown action", TRUE);
 					break;

--- a/templates/header.tpl
+++ b/templates/header.tpl
@@ -12,7 +12,7 @@
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
   <!-- gitphp web interface {$version}, (C) 2006 Christopher Han <xiphux@gmail.com> -->
   <head>
-    <title>{$pagetitle}{if $project && $validproject} :: {$project}{if $action}/{$action}{/if}{/if}</title>
+    <title>{$pagetitle}{if $project && $validproject} :: {$project}{if $action && $validaction}/{$action}{/if}{/if}</title>
     {if $validproject}
       <link rel="alternate" title="{$project} log" href="{$SCRIPT_NAME}?p={$project}&a=rss" type="application/rss+xml" />
     {/if}
@@ -27,7 +27,7 @@
       <a href="index.php">projects</a> / 
       {if $project && $validproject}
         <a href="{$SCRIPT_NAME}?p={$project}&a=summary">{$project}</a>
-        {if $action}
+        {if $action && $validaction}
            / {$action}
         {/if}
         {if $enablesearch}

comments