Index: sandbox/expressoMail1_2/MailArchiver/2.2/phpgwapi/setup/setup.inc.php
===================================================================
--- sandbox/expressoMail1_2/MailArchiver/2.2/phpgwapi/setup/setup.inc.php	(revision 4644)
+++ sandbox/expressoMail1_2/MailArchiver/2.2/phpgwapi/setup/setup.inc.php	(revision 4876)
@@ -14,5 +14,5 @@
 	$setup_info['phpgwapi']['name']      = 'phpgwapi';
 	$setup_info['phpgwapi']['title']     = 'API';
-	$setup_info['phpgwapi']['version']   = '2.2.4';
+	$setup_info['phpgwapi']['version']   = '2.2.6';
 	$setup_info['phpgwapi']['versions']['current_header'] = '2.2';
 	$setup_info['phpgwapi']['enable']    = 3;
Index: sandbox/expressoMail1_2/MailArchiver/2.2/phpgwapi/setup/tables_update.inc.php
===================================================================
--- sandbox/expressoMail1_2/MailArchiver/2.2/phpgwapi/setup/tables_update.inc.php	(revision 4644)
+++ sandbox/expressoMail1_2/MailArchiver/2.2/phpgwapi/setup/tables_update.inc.php	(revision 4876)
@@ -133,3 +133,9 @@
 		return $GLOBALS['setup_info']['phpgwapi']['currentver'];
 	}
+	$test[] = '2.2.4';
+	function phpgwapi_upgrade2_2_4()
+	{
+		$GLOBALS['setup_info']['phpgwapi']['currentver'] = '2.2.6';
+		return $GLOBALS['setup_info']['phpgwapi']['currentver'];
+	}
 ?>
Index: sandbox/expressoMail1_2/MailArchiver/2.2/news_admin/setup/setup.inc.php
===================================================================
--- sandbox/expressoMail1_2/MailArchiver/2.2/news_admin/setup/setup.inc.php	(revision 4173)
+++ sandbox/expressoMail1_2/MailArchiver/2.2/news_admin/setup/setup.inc.php	(revision 4876)
@@ -14,5 +14,5 @@
 	$setup_info['news_admin']['name']      = 'news_admin';
 	$setup_info['news_admin']['title']     = 'News Admin';
-	$setup_info['news_admin']['version']   = '2.2.1';
+	$setup_info['news_admin']['version']   = '2.2.6';
 	$setup_info['news_admin']['app_order'] = 16;
 	$setup_info['news_admin']['enable']    = 1;
Index: sandbox/expressoMail1_2/MailArchiver/2.2/news_admin/setup/tables_update.inc.php
===================================================================
--- sandbox/expressoMail1_2/MailArchiver/2.2/news_admin/setup/tables_update.inc.php	(revision 4173)
+++ sandbox/expressoMail1_2/MailArchiver/2.2/news_admin/setup/tables_update.inc.php	(revision 4876)
@@ -43,3 +43,9 @@
 		return $GLOBALS['setup_info']['news_admin']['currentver'];
 	}
+	$test[] = '2.2.1';
+	function news_admin_upgrade2_2_1()
+	{
+		$GLOBALS['setup_info']['news_admin']['currentver'] = '2.2.6';
+		return $GLOBALS['setup_info']['news_admin']['currentver'];
+	}
 ?>
Index: sandbox/expressoMail1_2/MailArchiver/2.2/reports/setup/setup.inc.php
===================================================================
--- sandbox/expressoMail1_2/MailArchiver/2.2/reports/setup/setup.inc.php	(revision 4173)
+++ sandbox/expressoMail1_2/MailArchiver/2.2/reports/setup/setup.inc.php	(revision 4876)
@@ -13,5 +13,5 @@
 	$setup_info['reports']['title']     	= 'Expresso Reports';
 	/* Ao incrementar versão, não esquecer de declarar função do tables_update.inc.php*/
-	$setup_info['reports']['version']   	= '2.2.1';
+	$setup_info['reports']['version']   	= '2.2.6';
 	$setup_info['reports']['app_order']	= 17;
 	$setup_info['reports']['tables']    = '';
Index: sandbox/expressoMail1_2/MailArchiver/2.2/mobile/setup/setup.inc.php
===================================================================
--- sandbox/expressoMail1_2/MailArchiver/2.2/mobile/setup/setup.inc.php	(revision 4644)
+++ sandbox/expressoMail1_2/MailArchiver/2.2/mobile/setup/setup.inc.php	(revision 4876)
@@ -14,5 +14,5 @@
 	$setup_info['mobile']['name']      = 'mobile';
 	$setup_info['mobile']['title']     = 'Expresso Mini';
-	$setup_info['mobile']['version']   = '2.2.4';
+	$setup_info['mobile']['version']   = '2.2.6';
 	$setup_info['mobile']['app_order'] = 4;
 	$setup_info['mobile']['enable']    = 2;
Index: sandbox/expressoMail1_2/MailArchiver/2.2/expressoAdmin1_2/setup/tables_update.inc.php
===================================================================
--- sandbox/expressoMail1_2/MailArchiver/2.2/expressoAdmin1_2/setup/tables_update.inc.php	(revision 4644)
+++ sandbox/expressoMail1_2/MailArchiver/2.2/expressoAdmin1_2/setup/tables_update.inc.php	(revision 4876)
@@ -79,3 +79,9 @@
 		return $GLOBALS['setup_info']['expressoAdmin1_2']['currentver'];
 	}
+	$test[] = '2.2.3';
+	function expressoAdmin1_2_upgrade2_2_3()
+	{
+		$GLOBALS['setup_info']['expressoAdmin1_2']['currentver'] = '2.2.6';
+		return $GLOBALS['setup_info']['expressoAdmin1_2']['currentver'];
+	}
 ?>
Index: sandbox/expressoMail1_2/MailArchiver/2.2/expressoAdmin1_2/setup/setup.inc.php
===================================================================
--- sandbox/expressoMail1_2/MailArchiver/2.2/expressoAdmin1_2/setup/setup.inc.php	(revision 4644)
+++ sandbox/expressoMail1_2/MailArchiver/2.2/expressoAdmin1_2/setup/setup.inc.php	(revision 4876)
@@ -13,5 +13,5 @@
 	$setup_info['expressoAdmin1_2']['title']     	= 'Expresso Admin';
 	/* Ao incrementar versão, não esquecer de declarar função do tables_update.inc.php*/
-	$setup_info['expressoAdmin1_2']['version']   	= '2.2.3';
+	$setup_info['expressoAdmin1_2']['version']   	= '2.2.6';
 	$setup_info['expressoAdmin1_2']['app_order']	= 1;
 	$setup_info['expressoAdmin1_2']['tables'][]		= 'phpgw_expressoadmin';
Index: sandbox/expressoMail1_2/MailArchiver/2.2/jabberit_messenger/setup/setup.inc.php
===================================================================
--- sandbox/expressoMail1_2/MailArchiver/2.2/jabberit_messenger/setup/setup.inc.php	(revision 4644)
+++ sandbox/expressoMail1_2/MailArchiver/2.2/jabberit_messenger/setup/setup.inc.php	(revision 4876)
@@ -8,5 +8,5 @@
 	$setup_info['jabberit_messenger']['name']      	= 'jabberit_messenger';
 	$setup_info['jabberit_messenger']['title']     	= 'Expresso Messenger';
-	$setup_info['jabberit_messenger']['version']   	= '2.2.2';
+	$setup_info['jabberit_messenger']['version']   	= '2.2.6';
 	$setup_info['jabberit_messenger']['app_order'] 	= 9;
 	$setup_info['jabberit_messenger']['enable']    	= 1;
Index: sandbox/expressoMail1_2/MailArchiver/2.2/calendar/setup/setup.inc.php
===================================================================
--- sandbox/expressoMail1_2/MailArchiver/2.2/calendar/setup/setup.inc.php	(revision 4173)
+++ sandbox/expressoMail1_2/MailArchiver/2.2/calendar/setup/setup.inc.php	(revision 4876)
@@ -13,5 +13,5 @@
 	$setup_info['calendar']['name']    = 'calendar';
 	$setup_info['calendar']['title']    = 'Calendar';
-	$setup_info['calendar']['version'] = '2.2.1';
+	$setup_info['calendar']['version'] = '2.2.6';
 	$setup_info['calendar']['app_order'] = 3;
 	$setup_info['calendar']['enable']  = 1;
Index: sandbox/expressoMail1_2/MailArchiver/2.2/calendar/setup/tables_update.inc.php
===================================================================
--- sandbox/expressoMail1_2/MailArchiver/2.2/calendar/setup/tables_update.inc.php	(revision 4173)
+++ sandbox/expressoMail1_2/MailArchiver/2.2/calendar/setup/tables_update.inc.php	(revision 4876)
@@ -86,3 +86,9 @@
 		return $GLOBALS['setup_info']['calendar']['currentver'];
 	}
+	$test[] = '2.2.1';
+	function calendar_upgrade2_2_1()
+	{
+		$GLOBALS['setup_info']['calendar']['currentver'] = '2.2.6';
+		return $GLOBALS['setup_info']['calendar']['currentver'];
+	}
 ?>
Index: sandbox/expressoMail1_2/MailArchiver/2.2/workflow/setup/setup.inc.php
===================================================================
--- sandbox/expressoMail1_2/MailArchiver/2.2/workflow/setup/setup.inc.php	(revision 4173)
+++ sandbox/expressoMail1_2/MailArchiver/2.2/workflow/setup/setup.inc.php	(revision 4876)
@@ -13,5 +13,5 @@
 	$setup_info['workflow']['name']			= 'workflow';
 	$setup_info['workflow']['title']		= 'Workflow Management';
-	$setup_info['workflow']['version']		= '2.2.1';
+	$setup_info['workflow']['version']		= '2.2.6';
 	$setup_info['workflow']['app_order']	= 10;
 	$setup_info['workflow']['enable']		= 1;
Index: sandbox/expressoMail1_2/MailArchiver/2.2/workflow/setup/tables_update.inc.php
===================================================================
--- sandbox/expressoMail1_2/MailArchiver/2.2/workflow/setup/tables_update.inc.php	(revision 4173)
+++ sandbox/expressoMail1_2/MailArchiver/2.2/workflow/setup/tables_update.inc.php	(revision 4876)
@@ -210,3 +210,10 @@
 		return $GLOBALS['setup_info']['workflow']['currentver'];
 	}
+		$test[] = '2.2.1';
+	function workflow_upgrade2_2_1()
+	{
+		#updating the current version
+		$GLOBALS['setup_info']['workflow']['currentver'] = '2.2.6';
+		return $GLOBALS['setup_info']['workflow']['currentver'];
+	}
 ?>
Index: sandbox/expressoMail1_2/MailArchiver/2.2/expressoMail1_2/setup/tables_update.inc.php
===================================================================
--- sandbox/expressoMail1_2/MailArchiver/2.2/expressoMail1_2/setup/tables_update.inc.php	(revision 4644)
+++ sandbox/expressoMail1_2/MailArchiver/2.2/expressoMail1_2/setup/tables_update.inc.php	(revision 4876)
@@ -121,3 +121,8 @@
 		return $setup_info['expressoMail1_2']['currentver'];
 	}
+	$test[] = '2.2.4';
+	function expressoMail1_2_upgrade2_2_4() {
+		$setup_info['expressoMail1_2']['currentver'] = '2.2.6';
+		return $setup_info['expressoMail1_2']['currentver'];
+	}
 ?>
Index: sandbox/expressoMail1_2/MailArchiver/2.2/expressoMail1_2/setup/setup.inc.php
===================================================================
--- sandbox/expressoMail1_2/MailArchiver/2.2/expressoMail1_2/setup/setup.inc.php	(revision 4778)
+++ sandbox/expressoMail1_2/MailArchiver/2.2/expressoMail1_2/setup/setup.inc.php	(revision 4876)
@@ -12,5 +12,5 @@
 	$setup_info['expressoMail1_2']['name']      	= 'expressoMail1_2';
 	$setup_info['expressoMail1_2']['title']     	= 'Expresso Mail';
-	$setup_info['expressoMail1_2']['version']   	= '2.2.4';
+	$setup_info['expressoMail1_2']['version']   	= '2.2.6';
 	$setup_info['expressoMail1_2']['app_order'] 	= 2;
 	$setup_info['expressoMail1_2']['tables'][]		= 'phpgw_expressomail_contacts';
Index: sandbox/expressoMail1_2/MailArchiver/2.2/expressoMail1_2/js/local_messages.js
===================================================================
--- sandbox/expressoMail1_2/MailArchiver/2.2/expressoMail1_2/js/local_messages.js	(revision 4319)
+++ sandbox/expressoMail1_2/MailArchiver/2.2/expressoMail1_2/js/local_messages.js	(revision 4876)
@@ -711,15 +711,7 @@
 	    Element("check_box_message_" + msgs_to_set[i]).checked = false;
 	
-	for (var i in mail.thumbs) { 
-		/*
-		 * Os thumbs contÃªm aspas simples que impactam na sql. 
-		 * Aqui eu substituo as aspas simples por duas simples(escape no sqlite),
-		 * Caso jÃ¡ venham duas juntas, elas continuam sem serem duplicadas.
-		 */
-		mail.thumbs[i] = mail.thumbs[i].replace(/([^'])'([^'])('?)/g,"$1''$2$3$3");
-	}
-	
-	this.dbGears.execute("update mail set mail='"+connector.serialize(mail)+"',header='"+connector.serialize(header)+
-								"',unseen="+unseen+" where rowid="+msgs_to_set[i]);
+
+	this.dbGears.execute("update mail set mail=?,header=?,unseen=? where rowid=?",[connector.serialize(mail),connector.serialize(header),unseen,msgs_to_set[i]]);
+
     }
     if(Element('chk_box_select_all_messages'))
