Index: /controller/wpsg_ProduktController.class.php
===================================================================
--- /controller/wpsg_ProduktController.class.php	(revision 7533)
+++ /controller/wpsg_ProduktController.class.php	(revision 7534)
@@ -779,6 +779,7 @@
 		 * Wird beim kopieren eines Produkts aufgerufen
 		 */
-		public function copyAction()
-		{
+		public function copyAction() {
+			
+			if (!wpsg_checkInput($_REQUEST['edit_id'], WPSG_SANITIZE_INT)) throw new \Exception(__('Requestfehler', 'wpsg'));
 
 			$produkt_db = $this->db->fetchRow("SELECT * FROM `".WPSG_TBL_PRODUCTS."` WHERE `id` = '".wpsg_q($_REQUEST['edit_id'])."' ");
@@ -809,4 +810,19 @@
 			}
 
+			// Bilder kopieren
+			$ih = new wpsg_imagehandler();
+			
+			$arAttachments = $ih->getAttachmentIDs($_REQUEST['edit_id']);
+			$GLOBALS['wpsg_product_copy_imagemapping'] = [];
+			
+			foreach ($arAttachments as $a_id) {
+				
+				$post = $this->db->fetchRow("SELECT * FROM `".$GLOBALS['wpdb']->prefix."posts` WHERE `ID`='".wpsg_q($a_id)."'");
+				$n_a_id = $ih->addImageToProduct($post['guid'], $new_id);
+				
+				if (wpsg_isSizedInt($n_a_id)) $GLOBALS['wpsg_product_copy_imagemapping'][$a_id] = $n_a_id;
+				
+			}
+			
 			$this->shop->callMods('produkt_copy', array(&$_REQUEST['edit_id'], &$new_id));
 
Index: /lib/wpsg_imagehandler.class.php
===================================================================
--- /lib/wpsg_imagehandler.class.php	(revision 7533)
+++ /lib/wpsg_imagehandler.class.php	(revision 7534)
@@ -55,9 +55,11 @@
 			// https://codex.wordpress.org/Function_Reference/wp_insert_attachment
 			
+			if (!wpsg_isSizedString($file)) return null;
+			
 			$wp_upload_dir = wp_upload_dir();
 			
 			$mt_filetype = wp_check_filetype(basename($file), null);
 			$mt_filename = $wp_upload_dir['path'].'/'.basename($file);
-			
+						
 			copy($file, $mt_filename);
 			
Index: /mods/wpsg_mod_productvariants.class.php
===================================================================
--- /mods/wpsg_mod_productvariants.class.php	(revision 7533)
+++ /mods/wpsg_mod_productvariants.class.php	(revision 7534)
@@ -205,6 +205,31 @@
 					$pvari['variation_id'] = $newvvid;
 					$pvari['product_id'] = $copy_id;
-
+					
+					$images = explode(',', $pvari['images']);
+					$images_set = explode(',', $pvari['images_set']);
+					
+					foreach ($images as $k => $i_id) {
+						
+						if (isset($GLOBALS['wpsg_product_copy_imagemapping'][$i_id])) $images[$k] = $GLOBALS['wpsg_product_copy_imagemapping'][$i_id];
+						else unset($images[$k]);
+						
+					}
+					
+					foreach ($images_set as $k => $i_id) {
+						
+						if (isset($GLOBALS['wpsg_product_copy_imagemapping'][$i_id])) $images_set[$k] = $GLOBALS['wpsg_product_copy_imagemapping'][$i_id];
+						else unset($images_set[$k]);
+						
+					}
+					
+					$pvari['images'] = implode(',', $images);
+					$pvari['images_set'] = implode(',', $images_set);
+					
+					unset($pvari['id']);
+					
+					$this->db->ImportQuery(WPSG_TBL_PRODUCTS_VARIATION, $pvari);
+					
 					// images/images_set
+					/*
 					$images = explode(',', $pvari['images']);
 					$images_set = explode(',', $pvari['images_set']);
@@ -216,5 +241,13 @@
 					foreach ($images as $postid) {
 
-						if (!in_array($postid, $mimages['alt'])) {
+						if (wpsg_isSizedInt($postid)) {
+							
+							$post = $this->db->fetchRow("SELECT * FROM `".$GLOBALS['wpdb']->prefix."posts` WHERE `ID`='".wpsg_q($postid)."'");							
+							$npostid = $ih->addImageToProduct($post['guid'], $copy_id);
+															
+						}
+						
+						if (!wpsg_isSizedArray($mimages['alt']) || !in_array($postid, $mimages['alt'])) {
+							
 							$mimages['alt'][] = $postid;
 							$post = $this->db->fetchRow("SELECT * FROM `".$GLOBALS['wpdb']->prefix."posts` WHERE `ID`='".wpsg_q($postid)."'");
@@ -238,7 +271,10 @@
 
 					$pvari['images'] = implode(',', $nimages);
-					$pvari[images_set] = implode(',', $nimages_set);
+					$pvari['images_set'] = implode(',', $nimages_set);
 					unset($pvari['id']);
 					$newpvid = $this->db->ImportQuery(WPSG_TBL_PRODUCTS_VARIATION, $pvari);
+					*/
+					
+					
 
 				}
