| 
					
				 | 
			
			
				@@ -2,6 +2,7 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 require_once('../controller/validator.php'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 require_once('../controller/formparser.php'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 require_once('../controller/forms.php'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+require_once('../controller/util.php'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 require_once('../templates/templates.php'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 require_once('../controller/generateform.php'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -60,10 +61,8 @@ function proccessRequest ($data) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $html = generateFormHTML($form); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         storeNewForm($form, $keys, $formSource); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $path = saveHTML($form['title'], $keys[1], $html); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $link = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            "https" : "http") . "://" . $_SERVER['HTTP_HOST'] . 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-            '/forms/'.$path; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-        $context = ['link'=>$link, 'secret'=>$keys[0], 'title'=>$form['title']]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $link = generateURI('/forms/'.$path); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        $context = ['link'=> htmlspecialchars($link), 'secret'=>$keys[0], 'title'=>$form['title']]; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         $success = getTemplate('created_successful.html'); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				         echo parseTemplate($success, $context); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 |