From: Hendrik B. <nh...@us...> - 2010-06-03 21:08:58
|
Update of /cvsroot/arianne/stendhal_website In directory sfp-cvsdas-4.v30.ch3.sourceforge.com:/tmp/cvs-serv15343 Modified Files: index.php Log Message: code format Index: index.php =================================================================== RCS file: /cvsroot/arianne/stendhal_website/index.php,v retrieving revision 1.132 retrieving revision 1.133 diff -C2 -d -r1.132 -r1.133 *** index.php 3 Jun 2010 20:39:00 -0000 1.132 --- index.php 3 Jun 2010 21:08:51 -0000 1.133 *************** *** 47,91 **** */ function decidePageToLoad($url) { ! $ERROR="content/main"; ! ! if(strpos($url,".")!==false) { ! return $ERROR; ! } ! ! if(strpos($url,"//")!==false) { ! return $ERROR; ! } ! ! if(strpos($url,":")!==false) { // http://, https://, ftp:// ! return $ERROR; ! } ! if(strpos($url,"http")!==false) { ! return $ERROR; ! } ! ! if(strpos($url,"/")==0) { ! return $ERROR; ! } ! ! if(strpos($url.'.php',".php")===false) { ! return $ERROR; ! } ! ! if(!file_exists($url.'.php')) { ! return $ERROR; ! } ! ! return $url; } /* ! * This code decide the page to load. ! */ $page_url="content/main"; ! if(isset($_REQUEST["id"])) ! { ! $page_url=decidePageToLoad($_REQUEST["id"]); ! } require_once("content/page.php"); --- 47,86 ---- */ function decidePageToLoad($url) { ! $ERROR="content/main"; ! if(strpos($url,".")!==false) { ! return $ERROR; ! } ! ! if(strpos($url,"//")!==false) { ! return $ERROR; ! } ! ! if(strpos($url,":")!==false) { // http://, https://, ftp:// ! return $ERROR; ! } ! ! if(strpos($url,"/")==0) { ! return $ERROR; ! } ! ! if(strpos($url.'.php',".php")===false) { ! return $ERROR; ! } ! ! if(!file_exists($url.'.php')) { ! return $ERROR; ! } ! ! return $url; } /* ! * This code decides the page to load. ! */ $page_url="content/main"; ! if(isset($_REQUEST["id"])) { ! $page_url=decidePageToLoad($_REQUEST["id"]); ! } require_once("content/page.php"); |