[evolvis-commits] r7120: some viewvc bugfixin?==?UTF-8?Q?g↵

mirabilos at evolvis.org mirabilos at evolvis.org
Mon Dec 20 16:17:26 CET 2010


Author: mirabilos
Date: 2010-12-20 16:17:26 +0100 (Mon, 20 Dec 2010)
New Revision: 7120

Modified:
   trunk/gforge_base/evolvisforge/gforge/www/scm/include/viewvc_utils.php
   trunk/gforge_base/evolvisforge/gforge/www/scm/viewvc.php
Log:
some viewvc bugfixing


Modified: trunk/gforge_base/evolvisforge/gforge/www/scm/include/viewvc_utils.php
===================================================================
--- trunk/gforge_base/evolvisforge/gforge/www/scm/include/viewvc_utils.php	2010-12-20 15:17:24 UTC (rev 7119)
+++ trunk/gforge_base/evolvisforge/gforge/www/scm/include/viewvc_utils.php	2010-12-20 15:17:26 UTC (rev 7120)
@@ -11,8 +11,6 @@
  * @version   $ID$
  */
 
-define ('SEPARATOR', "\n\t\r\0\x0B");
-
 /**
  *      viewcvs_is_html() - Test if ViewCVS returns HTML.
  *

Modified: trunk/gforge_base/evolvisforge/gforge/www/scm/viewvc.php
===================================================================
--- trunk/gforge_base/evolvisforge/gforge/www/scm/viewvc.php	2010-12-20 15:17:24 UTC (rev 7119)
+++ trunk/gforge_base/evolvisforge/gforge/www/scm/viewvc.php	2010-12-20 15:17:26 UTC (rev 7120)
@@ -99,19 +99,20 @@
 	$content = viewcvs_execute($unix_name, $repos_type);
 }
 
-// Set content type header from the value set by ViewCVS
-// No other headers are generated by ViewCVS because in generate_etags
-// is set to 0 in the ViewCVS config file
-$found = false;
-$line = strtok($content,SEPARATOR);
-while ($line && !$found) {
+$line = preg_split('/[\t\r\0\x0B]*\n[\t\r\0\x0B]*\n/', $content, 2);
+$header = preg_split('/[\t\r\0\x0B]*\n/', $line[0]);
+$content = $line[1];
+foreach ($header as $line) {
+	if (preg_match('/^Location:(.*)$/', $line, $matches)) {
+		$tgt = ltrim($matches[1]);
+		if ($tgt[0] == '/')
+			$tgt = util_make_url($tgt);
+		session_redirect_uri($tgt);
+	}
 	if (preg_match('/^Content-Type:(.*)$/',$line,$matches)) {
 		sysdebug_off('Content-Type:' . $matches[1]);
- 		$found = true;
- 	}
-	$line = strtok(SEPARATOR);	
+	}
 }
-$content = substr($content, strpos($content,$line));
 
 if (viewcvs_is_html()) {
 	// If we output html and we found the mbstring extension, we



More information about the evolvis-commits mailing list