public function automaticFilename($data)
	{
		$filename = $data['filename'];
		$filename = preg_replace("/[^A-Za-z0-9.]/i", '-', $filename);

		$ext = strrchr($filename, '.');
		$prefix = substr($filename, 0, -strlen($ext));

		if (strlen($prefix) > 240)
		{
			$prefix = substr($prefix, 0, 240);
			$filename = $prefix . $ext;
		}

		$data['filename'] = $filename;

		return $data['filename'];
	}
public function automaticFilename($data)
	{
		$filename = $data['filename'];
		$filename = preg_replace("/[^A-Za-z0-9.]/i", '-', $filename);

		$ext = strrchr($filename, '.');
		$prefix = substr($filename, 0, -strlen($ext));

		if (strlen($prefix) > 240)
		{
			$prefix = substr($prefix, 0, 240);
			$filename = $prefix . $ext;
		}

		$data['filename'] = $filename;

		return $data['filename'];
	}
public function automaticFilename ( $ data ) { $ filename = $ data [ 'filename' ] ; $ filename = preg_replace ( "/[^A-Za-z0-9.]/i" , '-' , $ filename ) ; $ ext = strrchr ( $ filename , '.' ) ; $ prefix = substr ( $ filename , 0 , - strlen ( $ ext ) ) ; if ( strlen ( $ prefix ) > 240 ) { $ prefix = substr ( $ prefix , 0 , 240 ) ; $ filename = $ prefix . $ ext ; } $ data [ 'filename' ] = $ filename ; return $ data [ 'filename' ] ; }
Ensure no invalid characters

@param   array  $data
@return  string
Ensure no invalid characters