Index: /changelog
===================================================================
--- /changelog	(revision 7601)
+++ /changelog	(revision 7602)
@@ -295,2 +295,3 @@
 - Bugfix: Gutscheinprodukt und flexibler Preis arbeitet mit "Mehrfach mit Menge 1"
 - Bugfix: Speichern im alternatives Design in der Produktverwaltung wieder mÃ¶glich / Ticket #700
+- Bugfix: Speichern von Produktattributen RTE mit Links wieder mÃ¶glich / Ticket #699
Index: /controller/wpsg_ProduktController.class.php
===================================================================
--- /controller/wpsg_ProduktController.class.php	(revision 7601)
+++ /controller/wpsg_ProduktController.class.php	(revision 7602)
@@ -1003,5 +1003,5 @@
 			}
 
-			die();
+			exit;
 
 		} // public function saveAction()
Index: /controller/wpsg_SystemController.class.php
===================================================================
--- /controller/wpsg_SystemController.class.php	(revision 7601)
+++ /controller/wpsg_SystemController.class.php	(revision 7602)
@@ -245,5 +245,18 @@
 
 		} // public function addBackendMessage($message)
-
+	
+		public function addInputFieldError($field_name, $field_label) {
+			
+			$this->addBackendError(
+				wpsg_translate(
+					__('ÃberprÃŒfen Sie die Eingaben im Feld "#1#", diese war ungÃŒltig.', 'wpsg'),
+					$field_label
+				)
+			);
+			
+			$_SESSION['sanitization_err_fields'][$field_name] = 0;
+			
+		}
+		
 		/**
 		 * FÃŒgt eine neue Fehlermeldung eines Backend Moduls hinzu
Index: /lib/filter_functions.inc.php
===================================================================
--- /lib/filter_functions.inc.php	(revision 7601)
+++ /lib/filter_functions.inc.php	(revision 7602)
@@ -511,5 +511,4 @@
     function wpsg_admin_footer() {
     	
-		
         if (is_admin() && preg_match('/wpsg/', wpsg_getStr($_REQUEST['page']))) {
 
@@ -527,12 +526,20 @@
 		        	if ($_SESSION['sanitization_err_fields'][$field_name] >= 1) unset($_SESSION['sanitization_err_fields'][$field_name]);
 
-		        	$sanitization_err_code .= "document.getElementsByName('$field_name').forEach(el => { el.style.borderColor = '#D9534F'; });\n";
+		        	$sanitization_err_code .= "document.getElementsByName('$field_name').forEach(el => { 
+		        	
+		        		if ((' ' + el.className + ' ').replace(/[\\n\\t]/g, ' ').indexOf(' wp-editor-area ') > -1 ) {
+		        		
+		        			el.parentNode.style.borderColor = '#D9534F';
+		        		
+		        		} else { el.style.borderColor = '#D9534F'; } 
+		        	
+		        	});\n";
 					
 		        }
 		        
 	        }
- 	        	        
+			
             $content .= '
-                    <script type="text/javascript">
+                    <script>
                             
                         jQuery(document).ready(function() {
Index: /lib/functions.inc.php
===================================================================
--- /lib/functions.inc.php	(revision 7601)
+++ /lib/functions.inc.php	(revision 7602)
@@ -714,14 +714,7 @@
 		
 		if (!wpsg_checkInput($value, $type, $param)) {
-		
-			wpsg_ShopController::getShop()->addBackendError(
-				wpsg_translate(
-					__('ÃberprÃŒfen Sie die Eingaben im Feld "#1#", diese war ungÃŒltig.', 'wpsg'),
-					$strLabel
-				)
-			);
-			
-			$_SESSION['sanitization_err_fields'][$name] = 0;
-						
+			
+			wpsg_ShopController::getShop()->addInputFieldError($name, $strLabel);
+			 						
 			return false;
 			
Index: /model/wpsg_exception.class.php
===================================================================
--- /model/wpsg_exception.class.php	(revision 7601)
+++ /model/wpsg_exception.class.php	(revision 7602)
@@ -57,4 +57,10 @@
         	
 		}
+		
+		public static function getInvalidValueException() {
+        	
+        	return new Exception('Aufrufsfehler');
+        	
+		} 
         
     } // class exception extends \Exception
Index: /mods/wpsg_mod_produktattribute.class.php
===================================================================
--- /mods/wpsg_mod_produktattribute.class.php	(revision 7601)
+++ /mods/wpsg_mod_produktattribute.class.php	(revision 7602)
@@ -198,44 +198,78 @@
 		} // public function settings_save()
 
-		public function produkt_save(&$produkt_id)
-		{
-
-			foreach ((array)$_REQUEST as $pa_id => $pa_value)
-			{
-
-				// Musste ich so abÃ€ndern, da der RTE keine namen Felder vom Typ pa[name] erlaubt.
-				if (preg_match('/^pa_/', $pa_id))
-				{
-
-					$pa_id = wpsg_sinput("key", substr($pa_id, 3));
-					$pa_value = wpsg_xss($pa_value);
-
-					$nExists = $this->db->fetchOne("
-						SELECT COUNT(*) FROM `".WPSG_TBL_PRODUCTS_AT."` WHERE `a_id` = '".wpsg_q($pa_id)."' AND `p_id` = '".wpsg_q($produkt_id)."'
-					");
-
-					$pa = $this->db->fetchRow("SELECT * FROM `".WPSG_TBL_AT."` WHERE `id` = '".wpsg_q($pa_id)."' ORDER BY `pos` ASC, `id` ASC ");
-
-					if ($pa['typ'] == 1 && $this->shop->get_option('wpsg_options_nl2br') == '1') $pa_value = nl2br($pa_value);
-
-					if ($nExists > 0)
-					{
-
-						$this->db->UpdateQuery(WPSG_TBL_PRODUCTS_AT, array(
-							'value' => wpsg_q($pa_value)
-						), "`a_id` = '".wpsg_q($pa_id)."' AND `p_id` = '".wpsg_q($produkt_id)."' ");
-
+		public function produkt_save(&$produkt_id) {
+
+			foreach ((array)$_REQUEST as $pa_id => $pa_value) {
+
+				$field_label = $pa_id;
+				
+				try {
+				
+					// Musste ich so abÃ€ndern, da der RTE keine namen Felder vom Typ pa[name] erlaubt.
+					if (preg_match('/^pa_/', $pa_id)) {
+	
+						$pa_id_clear = intval(substr($pa_id, 3));
+						
+						if (!wpsg_checkInput($pa_id_clear, WPSG_SANITIZE_INT)) throw \wpsg\Exception::getSanitizeException();
+						
+						$pa = $this->db->fetchRow("SELECT * FROM `".WPSG_TBL_AT."` WHERE `id` = '".wpsg_q($pa_id_clear)."' ORDER BY `pos` ASC, `id` ASC ");
+	
+						if (!wpsg_checkInput($pa['id'], WPSG_SANITIZE_INT)) throw \wpsg\Exception::getInvalidValueException();
+						
+						$field_label = __($pa['name'], 'wpsg');
+						
+						$nExists = $this->db->fetchOne("
+							SELECT COUNT(*) FROM `".WPSG_TBL_PRODUCTS_AT."` WHERE `a_id` = '".wpsg_q($pa_id_clear)."' AND `p_id` = '".wpsg_q($produkt_id)."'
+						");
+												
+						if ($pa['typ'] === '0') {
+						
+							if (!wpsg_checkInput($pa_value, WPSG_SANITIZE_TEXTAREA)) throw \wpsg\Exception::getSanitizeException();
+								
+						} else if ($pa['typ'] === '1') {
+							
+							if (!wpsg_checkInput($pa_value, WPSG_SANITIZE_HTML)) throw \wpsg\Exception::getSanitizeException();
+							
+							if ($this->shop->get_option('wpsg_options_nl2br') == '1') {
+								
+								$pa_value = nl2br($pa_value);
+								
+							}
+							
+						} else if ($pa['typ'] === '2') {
+							
+							$arSelect = explode('|', $pa['auswahl']);
+							
+							if (!wpsg_checkInput($pa_value, WPSG_SANITIZE_INT)) throw \wpsg\Exception::getSanitizeException();
+							if (!array_key_exists(intval($pa_value), $arSelect)) throw new \Exception(__('UngÃŒltige Auswahl', 'wpsg'));
+													
+						} else if ($pa['typ'] === '3') {
+							
+							if (!wpsg_checkInput($pa_value, WPSG_SANITIZE_CHECKBOX)) throw \wpsg\Exception::getSanitizeException();
+							
+						} else throw \wpsg\Exception::getInvalidValueException();
+	
+						if ($nExists > 0) {
+	
+							$this->db->UpdateQuery(WPSG_TBL_PRODUCTS_AT, array(
+								'value' => wpsg_q($pa_value)
+							), "`a_id` = '".wpsg_q($pa_id_clear)."' AND `p_id` = '".wpsg_q($produkt_id)."' ");
+	
+						} else {
+	
+							$this->db->ImportQuery(WPSG_TBL_PRODUCTS_AT, array(
+								'value' => wpsg_q($pa_value),
+								'a_id' => wpsg_q($pa_id_clear),
+								'p_id' => wpsg_q($produkt_id)
+							));
+	
+						}
+	
 					}
-					else
-					{
-
-						$this->db->ImportQuery(WPSG_TBL_PRODUCTS_AT, array(
-							'value' => wpsg_q($pa_value),
-							'a_id' => wpsg_q($pa_id),
-							'p_id' => wpsg_q($produkt_id)
-						));
-
-					}
-
+					
+				} catch (\Exception $e) {
+					
+					wpsg_ShopController::getShop()->addInputFieldError($pa_id, $field_label);
+										
 				}
 
