All pastes #779856 Raw Edit

Stuff

public text v1 · immutable
·published 2007-11-18 13:28 UTC
rendered paste body
		$path = 'includes/'; 
		$extension = '.php'; 
		$default = 'news';
		$page = (isset($_GET['page'])) ? $_GET['page'] : $default; 
		$includedFile = $path.'error'.$extension;
		
		if(preg_match('#^[a-z0-9_]+$#i',$page)){
		
			$file = $path.$page.$extension;
			
			if (is_file($file)){ 
				$includedFile = $file; 
			}
		}
		
		include($includedFile);