Fix undefined order warning
Fix undefined order warning

--- a/include/display.git_project_list.php
+++ b/include/display.git_project_list.php
@@ -14,14 +14,15 @@
  include_once('display.git_project_listentry.php');
  include_once('gitutil.git_read_projects.php');
 
-function git_project_list($projectroot,$projectlist,$order)
+function git_project_list($projectroot,$projectlist,$order = "project")
 {
 	global $tpl,$git_projects;
 	$projects = git_read_projects($projectroot,$projectlist);
 	if (is_array($projects)) {
 		if (count($projects) > 0) {
 			$tpl->clear_all_assign();
-			$tpl->assign("order",$order);
+			if ($order)
+				$tpl->assign("order",$order);
 			$tpl->display("projlist_header.tpl");
 			if (!isset($git_projects)) {
 				switch ($order) {

file:a/index.php -> file:b/index.php
--- a/index.php
+++ b/index.php
@@ -1,4 +1,5 @@
 <?php
+error_reporting(E_ALL | E_STRICT);
 /*
  *  index.php
  *  gitphp: A PHP git repository browser
@@ -127,7 +128,7 @@
  } else {
  	$tpl->display("hometext.tpl");
 	include_once('include/display.git_project_list.php');
- 	git_project_list($gitphp_conf['projectroot'],$git_projects,$_GET['o']);
+ 	git_project_list($gitphp_conf['projectroot'],$git_projects,(isset($_GET['o']) ? $_GET['o'] : "project"));
  }
  $main = ob_get_contents();
  ob_end_clean();

comments