includes/php/upload.php
//Check if file name is allowed and remove illegal windows chars
Check if file name is allowed and remove illegal windows chars
Check if file name is allowed and remove illegal windows chars
private function checkName()
	{
		$windowsReserved	= array('CON', 'PRN', 'AUX', 'NUL','COM1', 'COM2', 'COM3', 'COM4', 'COM5', 'COM6', 'COM7', 'COM8', 'COM9',
				'LPT1', 'LPT2', 'LPT3', 'LPT4', 'LPT5', 'LPT6', 'LPT7', 'LPT8', 'LPT9');
		$badWinChars		= array_merge(array_map('chr', range(0,31)), array("<", ">", ":", '"', "/", "\\", "|", "?", "*"));
		$this->file_name	= str_replace($badWinChars, '', $this->file_name);
		if(in_array($this->file_name, $windowsReserved))
		{
			return false;
		}
		return true;
	}
private function checkName ( ) { $ windowsReserved = array ( 'CON' , 'PRN' , 'AUX' , 'NUL' , 'COM1' , 'COM2' , 'COM3' , 'COM4' , 'COM5' , 'COM6' , 'COM7' , 'COM8' , 'COM9' , 'LPT1' , 'LPT2' , 'LPT3' , 'LPT4' , 'LPT5' , 'LPT6' , 'LPT7' , 'LPT8' , 'LPT9' ) ; $ badWinChars = array_merge ( array_map ( 'chr' , range ( 0 , 31 ) ) , array ( " < " , " > " , " : " , '"' , " / " , " \\ " , " | " , " ? " , " * " ) ) ; $ this -> file_name = str_replace ( $ badWinChars , '' , $ this -> file_name ) ; if ( in_array ( $ this -> file_name , $ windowsReserved ) ) { return false ; } return true ; }
Check if file name is allowed and remove illegal windows chars
Check if file name is allowed and remove illegal windows chars
//comment if not using windows web server //check if legal windows file name