Niels Breet xfade at lists.slony.info
Tue Apr 3 08:10:47 PDT 2007
Update of /home/cvsd/slony1/slony1-www
In directory main.slony.info:/tmp/cvs-serv1964

Modified Files:
	index.php 
Log Message:
Make sure we only show existing pages. Return a 404 when no page is found. Problem observed by Devrim.

Index: index.php
===================================================================
RCS file: /home/cvsd/slony1/slony1-www/index.php,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** index.php	27 Mar 2007 12:22:45 -0000	1.10
--- index.php	3 Apr 2007 15:10:45 -0000	1.11
***************
*** 11,20 ****
  	break;
    case 'docs':
          $file = str_replace(array("/",".."),"",$_GET["file"]);
          if ($file == "") $file="index.html";
!         echo layout_header();
!         $text=file_get_contents('./adminguide/current/doc/adminguide/'.$file);
! 	$title=between("TITLE\n>","</TITLE",$text);
!         echo layout_defaultblock($title,$link,$text);
          break;
    case 'download':
--- 11,27 ----
  	break;
    case 'docs':
+ 	$text = '';
          $file = str_replace(array("/",".."),"",$_GET["file"]);
          if ($file == "") $file="index.html";
!         $text=@file_get_contents('./adminguide/current/doc/adminguide/'.$file);
! 	if ($text == ''){
! 		header("HTTP/1.0 404 Not Found");
! 		echo layout_header();
! 		echo layout_defaultblock('404, NOT FOUND','',file_get_contents('./content/404.txt'));
! 	} else {
!         	echo layout_header();
! 		$title=between("TITLE\n>","</TITLE",$text);
! 	        echo layout_defaultblock($title,$link,$text);
! 	}
          break;
    case 'download':



More information about the Slony1-commit mailing list