Description links should not have an indent class
Description links should not have an indent class

--- a/include/display.git_commit.php
+++ b/include/display.git_commit.php
@@ -56,7 +56,7 @@
 		$tpl->assign("difftreesize",count($difftree)+1);
 		$difftreelines = array();
 		foreach ($difftree as $i => $line) {
-			if (ereg("^:([0-7]{6}) ([0-7]{6}) ([0-9a-fA-F]{40}) ([0-9a-fA-F]{40}) (.)([0-9]{0,3})\t(.*)$",$line,$regs)) {
+			if (preg_match("/^:([0-7]{6}) ([0-7]{6}) ([0-9a-fA-F]{40}) ([0-9a-fA-F]{40}) (.)([0-9]{0,3})\t(.*)$/",$line,$regs)) {
 				$difftreeline = array();
 				$difftreeline["from_mode"] = $regs[1];
 				$difftreeline["to_mode"] = $regs[2];

--- a/include/display.git_commitdiff.php
+++ b/include/display.git_commitdiff.php
@@ -41,7 +41,7 @@
 		$tpl->assign("comment",$co['comment']);
 		$difftreelines = array();
 		foreach ($difftree as $i => $line) {
-			if (ereg("^:([0-7]{6}) ([0-7]{6}) ([0-9a-fA-F]{40}) ([0-9a-fA-F]{40}) (.)\t(.*)$",$line,$regs)) {
+			if (preg_match("/^:([0-7]{6}) ([0-7]{6}) ([0-9a-fA-F]{40}) ([0-9a-fA-F]{40}) (.)\t(.*)$/",$line,$regs)) {
 				$difftreeline = array();
 				$difftreeline["from_mode"] = $regs[1];
 				$difftreeline["to_mode"] = $regs[2];

--- a/include/display.git_commitdiff_plain.php
+++ b/include/display.git_commitdiff_plain.php
@@ -54,7 +54,7 @@
 		$tpl->assign("comment",$co['comment']);
 		$diffs = array();
 		foreach ($difftree as $i => $line) {
-			if (ereg("^:([0-7]{6}) ([0-7]{6}) ([0-9a-fA-F]{40}) ([0-9a-fA-F]{40}) (.)\t(.*)$",$line,$regs)) {
+			if (preg_match("/^:([0-7]{6}) ([0-7]{6}) ([0-9a-fA-F]{40}) ([0-9a-fA-F]{40}) (.)\t(.*)$/",$line,$regs)) {
 				if ($regs[5] == "A")
 					$diffs[] = git_diff($projectroot . $project, null, "/dev/null", $regs[4], "b/" . $regs[6]);
 				else if ($regs[5] == "D")

--- a/include/display.git_history.php
+++ b/include/display.git_history.php
@@ -36,9 +36,9 @@
 		$lines = explode("\n", $cmdout);
 		$historylines = array();
 		foreach ($lines as $i => $line) {
-			if (ereg("^([0-9a-fA-F]{40})",$line,$regs))
+			if (preg_match("/^([0-9a-fA-F]{40})/",$line,$regs))
 				$commit = $regs[1];
-			else if (ereg(":([0-7]{6}) ([0-7]{6}) ([0-9a-fA-F]{40}) ([0-9a-fA-F]{40}) (.)\t(.*)$",$line,$regs) && isset($commit)) {
+			else if (preg_match("/:([0-7]{6}) ([0-7]{6}) ([0-9a-fA-F]{40}) ([0-9a-fA-F]{40}) (.)\t(.*)$/",$line,$regs) && isset($commit)) {
 					$historyline = array();
 					$co = git_read_commit($projectroot . $project, $commit);
 					$historyline["agestringage"] = $co['age_string_age'];

--- a/include/display.git_rss.php
+++ b/include/display.git_rss.php
@@ -38,7 +38,7 @@
 			$diffout = git_diff_tree($projectroot . $project, $co['parent'] . " " . $co['id']);
 			$tok = strtok($diffout,"\n");
 			while ($tok !== false) {
-				if (ereg("^:([0-7]{6}) ([0-7]{6}) ([0-9a-fA-F]{40}) ([0-9a-fA-F]{40}) (.)([0-9]{0,3})\t(.*)$",$tok,$regs))
+				if (preg_match("/^:([0-7]{6}) ([0-7]{6}) ([0-9a-fA-F]{40}) ([0-9a-fA-F]{40}) (.)([0-9]{0,3})\t(.*)$/",$tok,$regs))
 					$difftree[] = $regs[7];
 				$tok = strtok("\n");
 			}

--- a/include/display.git_tree.php
+++ b/include/display.git_tree.php
@@ -50,7 +50,7 @@
 		$treelines = array();
 		$tok = strtok($lsout,"\0");
 		while ($tok !== false) {
-			if (ereg("^([0-9]+) (.+) ([0-9a-fA-F]{40})\t(.+)$",$tok,$regs)) {
+			if (preg_match("/^([0-9]+) (.+) ([0-9a-fA-F]{40})\t(.+)$/",$tok,$regs)) {
 				$treeline = array();
 				$treeline["filemode"] = mode_str($regs[1]);
 				$treeline["type"] = $regs[2];

--- a/include/gitutil.git_filesearch.php
+++ b/include/gitutil.git_filesearch.php
@@ -21,9 +21,9 @@
 	$lines = explode("\n",$grepout);
 	foreach ($lines as $j => $line) {
 		if ($case)
-			$ret = ereg("^([^:]+):([^:]+):(.*" . quotemeta($search) . ".*)",$line,$regs);
+			$ret = preg_match("/^([^:]+):([^:]+):(.*" . quotemeta($search) . ".*)/",$line,$regs);
 		else
-			$ret = eregi("^([^:]+):([^:]+):(.*" . quotemeta($search) . ".*)",$line,$regs);
+			$ret = preg_match(("/^([^:]+):([^:]+):(.*" . quotemeta($search) . ".*)/i",$line,$regs);
 		if ($ret) {
 			$fname = trim($regs[2]);
 			if (!isset($matches[$fname])) {
@@ -40,16 +40,16 @@
 	 $lsout = git_ls_tree($project, $hash, false, true);
 	 $entries = explode("\n",$lsout);
 	 foreach ($entries as $j => $line) {
-		$ret = ereg("^([0-9]+) (.+) ([0-9a-fA-F]{40})\t(.+)",$line,$regs);
+		$ret = preg_match("/^([0-9]+) (.+) ([0-9a-fA-F]{40})\t(.+)/",$line,$regs);
 		$fname = trim($regs[4]);
 		if (isset($matches[$fname])) {
 			$matches[$fname]['hash'] = $regs[3];
 			$matches[$fname]['type'] = $regs[2];
 		} else {
 			if ($case)
-				$ret = ereg("^([0-9]+) (.+) ([0-9a-fA-F]{40})\t(.*" . quotemeta($search) . "[^/]*)$",$line,$regs);
+				$ret = preg_match("/^([0-9]+) (.+) ([0-9a-fA-F]{40})\t(.*" . quotemeta($search) . "[^/]*)$/",$line,$regs);
 			else
-				$ret = eregi("^([0-9]+) (.+) ([0-9a-fA-F]{40})\t(.*" . quotemeta($search) . "[^/]*)$",$line,$regs);
+				$ret = preg_match("/^([0-9]+) (.+) ([0-9a-fA-F]{40})\t(.*" . quotemeta($search) . "[^/]*)$/i",$line,$regs);
 			if ($ret) {
 				$fname = trim($regs[4]);
 				$matches[$fname] = array();

--- a/include/gitutil.git_get_hash_by_path.php
+++ b/include/gitutil.git_get_hash_by_path.php
@@ -18,7 +18,7 @@
 		$lsout = git_ls_tree($project, $tree);
 		$entries = explode("\n",$lsout);
 		foreach ($entries as $j => $line) {
-			if (ereg("^([0-9]+) (.+) ([0-9a-fA-F]{40})\t(.+)$",$line,$regs)) {
+			if (preg_match("/^([0-9]+) (.+) ([0-9a-fA-F]{40})\t(.+)$/",$line,$regs)) {
 				if ($regs[4] == $part) {
 					if ($i == ($partcount)-1)
 						return $regs[3];

--- a/include/gitutil.git_read_commit.php
+++ b/include/gitutil.git_read_commit.php
@@ -14,7 +14,7 @@
 function git_read_commit($proj,$head)
 {
 	$lines = git_read_revlist($proj,$head,1,NULL,TRUE,TRUE);
-	if (!($lines[0]) || !ereg("^[0-9a-fA-F]{40}",$lines[0]))
+	if (!($lines[0]) || !preg_match("/^[0-9a-fA-F]{40}/",$lines[0]))
 		return null;
 	$commit = array();
 	$tok = strtok($lines[0]," ");
@@ -30,25 +30,25 @@
 		$commit['parent'] = $parents[0];
 	$comment = array();
 	foreach ($lines as $i => $line) {
-		if (ereg("^tree ([0-9a-fA-F]{40})$",$line,$regs))
+		if (preg_match("/^tree ([0-9a-fA-F]{40})$/",$line,$regs))
 			$commit['tree'] = $regs[1];
-		else if (ereg("^author (.*) ([0-9]+) (.*)$",$line,$regs)) {
+		else if (preg_match("/^author (.*) ([0-9]+) (.*)$/",$line,$regs)) {
 			$commit['author'] = $regs[1];
 			$commit['author_epoch'] = $regs[2];
 			$commit['author_tz'] = $regs[3];
-			if (ereg("^([^<]+) <",$commit['author'],$r))
+			if (preg_match("/^([^<]+) </",$commit['author'],$r))
 				$commit['author_name'] = $r[1];
 			else
 				$commit['author_name'] = $commit['author'];
-		} else if (ereg("^committer (.*) ([0-9]+) (.*)$",$line,$regs)) {
+		} else if (preg_match("/^committer (.*) ([0-9]+) (.*)$/",$line,$regs)) {
 			$commit['committer'] = $regs[1];
 			$commit['committer_epoch'] = $regs[2];
 			$commit['committer_tz'] = $regs[3];
 			$commit['committer_name'] = $commit['committer'];
-			$commit['committer_name'] = ereg_replace(" <.*","",$commit['committer_name']);
+			$commit['committer_name'] = preg_replace("/ <.*/","",$commit['committer_name']);
 		} else {
 			$trimmed = trim($line);
-			if ((strlen($trimmed) > 0) && !ereg("^[0-9a-fA-F]{40}",$trimmed) && !ereg("^parent [0-9a-fA-F]{40}",$trimmed)) {
+			if ((strlen($trimmed) > 0) && !preg_match("/^[0-9a-fA-F]{40}/",$trimmed) && !preg_match("/^parent [0-9a-fA-F]{40}/",$trimmed)) {
 				if (!isset($commit['title'])) {
 					$commit['title'] = $trimmed;
 					if (strlen($trimmed) > GITPHP_TRIM_LENGTH)

--- a/include/gitutil.git_read_tag.php
+++ b/include/gitutil.git_read_tag.php
@@ -17,13 +17,13 @@
 	$comment = array();
 	$tok = strtok($tagout,"\n");
 	while ($tok !== false) {
-		if (ereg("^object ([0-9a-fA-F]{40})$",$tok,$regs))
+		if (preg_match("/^object ([0-9a-fA-F]{40})$/",$tok,$regs))
 			$tag['object'] = $regs[1];
-		else if (ereg("^type (.+)$",$tok,$regs))
+		else if (preg_match("/^type (.+)$/",$tok,$regs))
 			$tag['type'] = $regs[1];
-		else if (ereg("^tag (.+)$",$tok,$regs))
+		else if (preg_match("/^tag (.+)$/",$tok,$regs))
 			$tag['name'] = $regs[1];
-		else if (ereg("^tagger (.*) ([0-9]+) (.*)$",$tok,$regs)) {
+		else if (preg_match("/^tagger (.*) ([0-9]+) (.*)$/",$tok,$regs)) {
 			$tag['author'] = $regs[1];
 			$tag['epoch'] = $regs[2];
 			$tag['tz'] = $regs[3];

--- a/include/gitutil.read_info_ref.php
+++ b/include/gitutil.read_info_ref.php
@@ -17,7 +17,7 @@
 	$showrefs = git_exec($project, $cmd);
 	$lines = explode("\n",$showrefs);
 	foreach ($lines as $no => $line) {
-		if (ereg("^([0-9a-fA-F]{40}) .*" . $type . "/([^\^]+)",$line,$regs)) {
+		if (preg_match("`^([0-9a-fA-F]{40}) .*" . $type . "/([^\^]+)`",$line,$regs)) {
 			if (isset($refs[$regs[1]]))
 				$refs[$regs[1]] .= " / " . $regs[2];
 			else

--- a/include/util.date_str.php
+++ b/include/util.date_str.php
@@ -17,7 +17,7 @@
 	$date['month'] = date("M",$epoch);
 	$date['rfc2822'] = date("r",$epoch);
 	$date['mday-time'] = date("d M H:i",$epoch);
-	if (ereg("^([+\-][0-9][0-9])([0-9][0-9])$",$tz,$regs)) {
+	if (preg_match("/^([+\-][0-9][0-9])([0-9][0-9])$/",$tz,$regs)) {
 		$local = $epoch + ((((int)$regs[1]) + ($regs[2]/60)) * 3600);
 		$date['hour_local'] = date("H",$local);
 		$date['minute_local'] = date("i",$local);

--- a/include/util.highlight.php
+++ b/include/util.highlight.php
@@ -9,7 +9,7 @@
 
 function highlight($haystack, $needle, $highlightclass, $trimlen = NULL, $escape = false)
 {
-	if (eregi("(.*)(" . quotemeta($needle) . ")(.*)",$haystack,$regs)) {
+	if (preg_match("/(.*)(" . quotemeta($needle) . ")(.*)/i",$haystack,$regs)) {
 		if (isset($trimlen) && ($trimlen > 0)) {
 			$linelen = strlen($regs[0]);
 			if ($linelen > $trimlen) {

file:a/index.php -> file:b/index.php
--- a/index.php
+++ b/index.php
@@ -28,7 +28,7 @@
   * Instantiate Smarty
   */
  require_once($gitphp_conf['smarty_prefix'] . "Smarty.class.php");
- $tpl =& new Smarty;
+ $tpl = new Smarty;
  if ((!isset($_GET['a'])) || (
      	($_GET['a'] != "commitdiff_plain") &&
      	($_GET['a'] != "blob_plain") &&
@@ -55,10 +55,11 @@
  */
  if ($gitphp_conf['cache']) {
  	$tpl->caching = 2;
-	$tpl->cache_lifetime = $gitphp_conf['cachelifetime'];
-	if ($gitphp_conf['cacheexpire']) {
+	if (isset($gitphp_conf['cachelifetime']))
+		$tpl->cache_lifetime = $gitphp_conf['cachelifetime'];
+	if (!(isset($gitphp_conf['cacheexpire']) && ($gitphp_conf['cacheexpire'] === FALSE))) {
 		require_once('include/cache.cache_expire.php');
-		cache_expire($gitphp_conf['projectroot'], (isset($_GET['p']) ? $_GET['p'] : null), $git_projects);
+		cache_expire($gitphp_conf['projectroot'], (isset($_GET['p']) ? $_GET['p'] : null), (isset($git_projects) ? $git_projects : null));
 	}
  }
 
@@ -207,7 +208,7 @@
 	}
  } else {
 	require_once('include/display.git_project_list.php');
- 	git_project_list($gitphp_conf['projectroot'],$git_projects,(isset($_GET['o']) ? $_GET['o'] : "project"));
+	git_project_list($gitphp_conf['projectroot'], (isset($git_projects) ? $git_projects : null), (isset($_GET['o']) ? $_GET['o'] : "project"));
  }
 
  if ($gitphp_conf['debug'] && $extraoutput)

--- a/templates/projectlist.tpl
+++ b/templates/projectlist.tpl
@@ -58,7 +58,7 @@
             <td>
               <a href="{$SCRIPT_NAME}?p={$plist[proj].project}&a=summary" class="list {if $categ != "none"}indent{/if}">{$plist[proj].project}</a>
             </td>
-            <td>{$plist[proj].descr}</td>
+            <td><a href="{$SCRIPT_NAME}?p={$plist[proj].project}&a=summary" class="list">{$plist[proj].descr}</a></td>
             <td><i>{$plist[proj].owner}</i></td>
             <td>
               {if $plist[proj].age < 7200}   {* 60*60*2, or 2 hours *}
@@ -82,7 +82,7 @@
           <td>
             <a href="{$SCRIPT_NAME}?p={$projects[proj].project}&a=summary" class="list">{$projects[proj].project}</a>
           </td>
-          <td>{$projects[proj].descr}</td>
+          <td><a href="{$SCRIPT_NAME}?p={$projects[proj].project}&a=summary" class="list">{$projects[proj].descr}</a></td>
           <td><i>{$projects[proj].owner}</i></td>
           <td>
             {if $projects[proj].age < 7200}   {* 60*60*2, or 2 hours *}

comments