Added check as suggested by @MrPetovan for empty $message.
This commit is contained in:
		
					parent
					
						
							
								f2b7326650
							
						
					
				
			
			
				commit
				
					
						962b06bf41
					
				
			
		
					 1 changed files with 8 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -143,6 +143,14 @@ class HTML
 | 
			
		|||
	 */
 | 
			
		||||
	public static function toBBCode(string $message, string $basepath = ''): string
 | 
			
		||||
	{
 | 
			
		||||
		/*
 | 
			
		||||
		 * Check if message is empty to prevent a lot code below being executed
 | 
			
		||||
		 * for just an empty message.
 | 
			
		||||
		 */
 | 
			
		||||
		if (empty($message)) {
 | 
			
		||||
			return '';
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		DI::profiler()->startRecording('rendering');
 | 
			
		||||
		$message = str_replace("\r", "", $message);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue