$attachments should aways be an array
In order to avoid a PHP 7.2 error when using count()
This commit is contained in:
		
					parent
					
						
							
								23371880e8
							
						
					
				
			
			
				commit
				
					
						9bb11ccfa5
					
				
			
		
					 1 changed files with 2 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -2716,7 +2716,7 @@ function api_convert_item($item)
 | 
			
		|||
 *
 | 
			
		||||
 * @param string $body
 | 
			
		||||
 *
 | 
			
		||||
 * @return array|false
 | 
			
		||||
 * @return array
 | 
			
		||||
 */
 | 
			
		||||
function api_get_attachments(&$body)
 | 
			
		||||
{
 | 
			
		||||
| 
						 | 
				
			
			@ -2727,7 +2727,7 @@ function api_get_attachments(&$body)
 | 
			
		|||
	$ret = preg_match_all("/\[img\]([$URLSearchString]*)\[\/img\]/ism", $text, $images);
 | 
			
		||||
 | 
			
		||||
	if (!$ret) {
 | 
			
		||||
		return false;
 | 
			
		||||
		return [];
 | 
			
		||||
	}
 | 
			
		||||
 | 
			
		||||
	$attachments = [];
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue