Updated drawing uploads to use user id in image name
- Instead of user name. - Due to issues with advanced charts like emoji zero-width-joiners. - Could also have security concerns on untrusted instances with certain webserver config due to double extension possibilities. Closes #1993
This commit is contained in:
		
							parent
							
								
									ef416d3e86
								
							
						
					
					
						commit
						3500182c5f
					
				| 
						 | 
				
			
			@ -138,7 +138,7 @@ class ImageRepo
 | 
			
		|||
     */
 | 
			
		||||
    public function saveDrawing(string $base64Uri, int $uploadedTo): Image
 | 
			
		||||
    {
 | 
			
		||||
        $name = 'Drawing-' . user()->getShortName(40) . '-' . strval(time()) . '.png';
 | 
			
		||||
        $name = 'Drawing-' . strval(user()->id) . '-' . strval(time()) . '.png';
 | 
			
		||||
        return $this->imageService->saveNewFromBase64Uri($base64Uri, $name, 'drawio', $uploadedTo);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue