mirror of
				https://github.com/crater-invoice/crater.git
				synced 2025-10-30 21:21:09 -04:00 
			
		
		
		
	Fix HTML injection exploit (#682)
Escape html special characters from the $fields array to prevent html injection in the generated pdfs.
This commit is contained in:
		| @ -157,6 +157,10 @@ trait GeneratesPdfTrait | ||||
|         foreach ($customerCustomFields as $customField) { | ||||
|             $fields['{'.$customField->customField->slug.'}'] = $customField->defaultAnswer; | ||||
|         } | ||||
|          | ||||
|         foreach ($fields as $key => $field) { | ||||
|             $fields[$key] = htmlspecialchars($field, ENT_QUOTES, 'UTF-8'); | ||||
|         } | ||||
|  | ||||
|         return $fields; | ||||
|     } | ||||
|  | ||||
		Reference in New Issue
	
	Block a user