Blob Blame History Raw
--- wwwroot/cgi-bin/awstats.pl	2007/07/07 11:00:05	1.892
+++ wwwroot/cgi-bin/awstats.pl	2007/07/12 21:38:20	1.894
@@ -2211,7 +2211,7 @@
 			}
 
 			# Analyze fields
-			@field=split(/\s+/,($readxml?CleanFromTags($_):$_));
+			@field=split(/\s+/,($readxml?XMLDecodeFromHisto($_):$_));
 			if (! $field[0]) { next; }
 
 			# Here version MUST be defined
@@ -2282,7 +2282,7 @@
 					}
 					$_=<HISTORY>;
 					chomp $_; s/\r//;
-					@field=split(/\s+/,($readxml?CleanFromTags($_):$_)); $countlines++;
+					@field=split(/\s+/,($readxml?XMLDecodeFromHisto($_):$_)); $countlines++;
 				}
 				until ($field[0] eq 'END_MISC' || $field[0] eq "${xmleb}END_MISC" || ! $_);
 				if ($field[0] ne 'END_MISC' && $field[0] ne "${xmleb}END_MISC") { error("History file \"$filetoread\" is corrupted (End of section MISC not found).\nRestore a recent backup of this file (data for this month will be restored to backup date), remove it (data for month will be lost), or remove the corrupted section in file (data for at least this section will be lost).","","",1); }
@@ -2313,7 +2313,7 @@
 					}
 					$_=<HISTORY>;
 					chomp $_; s/\r//;
-					@field=split(/\s+/,($readxml?CleanFromTags($_):$_)); $countlines++;
+					@field=split(/\s+/,($readxml?XMLDecodeFromHisto($_):$_)); $countlines++;
 				}
 				until ($field[0] eq 'END_CLUSTER' || $field[0] eq "${xmleb}END_CLUSTER" || ! $_);
 				if ($field[0] ne 'END_CLUSTER' && $field[0] ne "${xmleb}END_CLUSTER") { error("History file \"$filetoread\" is corrupted (End of section CLUSTER not found).\nRestore a recent backup of this file (data for this month will be restored to backup date), remove it (data for month will be lost), or remove the corrupted section in file (data for at least this section will be lost).","","",1); }
@@ -2357,7 +2357,7 @@
 					}
 					$_=<HISTORY>;
 					chomp $_; s/\r//;
-					@field=split(/\s+/,($readxml?CleanFromTags($_):$_)); $countlines++;
+					@field=split(/\s+/,($readxml?XMLDecodeFromHisto($_):$_)); $countlines++;
 				}
 				until ($field[0] eq 'END_TIME' || $field[0] eq "${xmleb}END_TIME" || ! $_);
 				if ($field[0] ne 'END_TIME' && $field[0] ne "${xmleb}END_TIME") { error("History file \"$filetoread\" is corrupted (End of section TIME not found).\nRestore a recent backup of this file (data for this month will be restored to backup date), remove it (data for month will be lost), or remove the corrupted section in file (data for at least this section will be lost).","","",1); }
@@ -2396,7 +2396,7 @@
 					}
 					$_=<HISTORY>;
 					chomp $_; s/\r//;
-					@field=split(/\s+/,($readxml?CleanFromTags($_):$_)); $countlines++;
+					@field=split(/\s+/,($readxml?XMLDecodeFromHisto($_):$_)); $countlines++;
 				}
 				until ($field[0] eq 'END_ORIGIN' || $field[0] eq "${xmleb}END_ORIGIN" || ! $_);
 				if ($field[0] ne 'END_ORIGIN' && $field[0] ne "${xmleb}END_ORIGIN") { error("History file \"$filetoread\" is corrupted (End of section ORIGIN not found).\nRestore a recent backup of this file (data for this month will be restored to backup date), remove it (data for month will be lost), or remove the corrupted section in file (data for at least this section will be lost).","","",1); }
@@ -2427,7 +2427,7 @@
 					}
 					$_=<HISTORY>;
 					chomp $_; s/\r//;
-					@field=split(/\s+/,($readxml?CleanFromTags($_):$_)); $countlines++;
+					@field=split(/\s+/,($readxml?XMLDecodeFromHisto($_):$_)); $countlines++;
 				}
 				until ($field[0] eq 'END_DAY' || $field[0] eq "${xmleb}END_DAY" || ! $_);
 				if ($field[0] ne 'END_DAY' && $field[0] ne "${xmleb}END_DAY") { error("History file \"$filetoread\" is corrupted (End of section DAY not found).\nRestore a recent backup of this file (data for this month will be restored to backup date), remove it (data for month will be lost), or remove the corrupted section in file (data for at least this section will be lost).","","",1); }
@@ -2534,7 +2534,7 @@
 					}
 					$_=<HISTORY>;
 					chomp $_; s/\r//;
-					@field=split(/\s+/,($readxml?CleanFromTags($_):$_)); $countlines++;
+					@field=split(/\s+/,($readxml?XMLDecodeFromHisto($_):$_)); $countlines++;
 				}
 				until ($field[0] eq 'END_VISITOR' || $field[0] eq "${xmleb}END_VISITOR" || ! $_);
 				if ($field[0] ne 'END_VISITOR' && $field[0] ne "${xmleb}END_VISITOR") { error("History file \"$filetoread\" is corrupted (End of section VISITOR not found).\nRestore a recent backup of this file (data for this month will be restored to backup date), remove it (data for month will be lost), or remove the corrupted section in file (data for at least this section will be lost).","","",1); }
@@ -2564,7 +2564,7 @@
 					}
 					$_=<HISTORY>;
 					chomp $_; s/\r//;
-					@field=split(/\s+/,($readxml?CleanFromTags($_):$_)); $countlines++;
+					@field=split(/\s+/,($readxml?XMLDecodeFromHisto($_):$_)); $countlines++;
 				}
 				until ($field[0] eq 'END_UNKNOWNIP' || $field[0] eq "${xmleb}END_UNKNOWNIP" || ! $_);
 				if ($field[0] ne 'END_UNKNOWNIP' && $field[0] ne "${xmleb}END_UNKNOWNIP") { error("History file \"$filetoread\" is corrupted (End of section UNKOWNIP not found).\nRestore a recent backup of this file (data for this month will be restored to backup date), remove it (data for month will be lost), or remove the corrupted section in file (data for at least this section will be lost).","","",1); }
@@ -2602,7 +2602,7 @@
 					}
 					$_=<HISTORY>;
 					chomp $_; s/\r//;
-					@field=split(/\s+/,($readxml?CleanFromTags($_):$_)); $countlines++;
+					@field=split(/\s+/,($readxml?XMLDecodeFromHisto($_):$_)); $countlines++;
 				}
 				until ($field[0] eq 'END_LOGIN' || $field[0] eq "${xmleb}END_LOGIN" || ! $_);
 				if ($field[0] ne 'END_LOGIN' && $field[0] ne "${xmleb}END_LOGIN") { error("History file \"$filetoread\" is corrupted (End of section LOGIN not found).\nRestore a recent backup of this file (data for this month will be restored to backup date), remove it (data for month will be lost), or remove the corrupted section in file (data for at least this section will be lost).","","",1); }
@@ -2632,7 +2632,7 @@
 					}
 					$_=<HISTORY>;
 					chomp $_; s/\r//;
-					@field=split(/\s+/,($readxml?CleanFromTags($_):$_)); $countlines++;
+					@field=split(/\s+/,($readxml?XMLDecodeFromHisto($_):$_)); $countlines++;
 				}
 				until ($field[0] eq 'END_DOMAIN' || $field[0] eq "${xmleb}END_DOMAIN" || ! $_);
 				if ($field[0] ne 'END_DOMAIN' && $field[0] ne "${xmleb}END_DOMAIN") { error("History file \"$filetoread\" is corrupted (End of section DOMAIN not found).\nRestore a recent backup of this file (data for this month will be restored to backup date), remove it (data for month will be lost), or remove the corrupted section in file (data for at least this section will be lost).","","",1); }
@@ -2660,7 +2660,7 @@
 					}
 					$_=<HISTORY>;
 					chomp $_; s/\r//;
-					@field=split(/\s+/,($readxml?CleanFromTags($_):$_)); $countlines++;
+					@field=split(/\s+/,($readxml?XMLDecodeFromHisto($_):$_)); $countlines++;
 				}
 				until ($field[0] eq 'END_SESSION' || $field[0] eq "${xmleb}END_SESSION" || ! $_);
 				if ($field[0] ne 'END_SESSION' && $field[0] ne "${xmleb}END_SESSION") { error("History file \"$filetoread\" is corrupted (End of section SESSION not found).\nRestore a recent backup of this file (data for this month will be restored to backup date), remove it (data for month will be lost), or remove the corrupted section in file (data for at least this section will be lost).","","",1); }
@@ -2689,7 +2689,7 @@
 					}
 					$_=<HISTORY>;
 					chomp $_; s/\r//;
-					@field=split(/\s+/,($readxml?CleanFromTags($_):$_)); $countlines++;
+					@field=split(/\s+/,($readxml?XMLDecodeFromHisto($_):$_)); $countlines++;
 				}
 				until ($field[0] eq 'END_OS' || $field[0] eq "${xmleb}END_OS" || ! $_);
 				if ($field[0] ne 'END_OS' && $field[0] ne "${xmleb}END_OS") { error("History file \"$filetoread\" is corrupted (End of section OS not found).\nRestore a recent backup of this file (data for this month will be restored to backup date), remove it (data for month will be lost), or remove the corrupted section in file (data for at least this section will be lost).","","",1); }
@@ -2717,7 +2717,7 @@
 					}
 					$_=<HISTORY>;
 					chomp $_; s/\r//;
-					@field=split(/\s+/,($readxml?CleanFromTags($_):$_)); $countlines++;
+					@field=split(/\s+/,($readxml?XMLDecodeFromHisto($_):$_)); $countlines++;
 				}
 				until ($field[0] eq 'END_BROWSER' || $field[0] eq "${xmleb}END_BROWSER" || ! $_);
 				if ($field[0] ne 'END_BROWSER' && $field[0] ne "${xmleb}END_BROWSER") { error("History file \"$filetoread\" is corrupted (End of section BROWSER not found).\nRestore a recent backup of this file (data for this month will be restored to backup date), remove it (data for month will be lost), or remove the corrupted section in file (data for at least this section will be lost).","","",1); }
@@ -2745,7 +2745,7 @@
 					}
 					$_=<HISTORY>;
 					chomp $_; s/\r//;
-					@field=split(/\s+/,($readxml?CleanFromTags($_):$_)); $countlines++;
+					@field=split(/\s+/,($readxml?XMLDecodeFromHisto($_):$_)); $countlines++;
 				}
 				until ($field[0] eq 'END_UNKNOWNREFERER' || $field[0] eq "${xmleb}END_UNKNOWNREFERER" || ! $_);
 				if ($field[0] ne 'END_UNKNOWNREFERER' && $field[0] ne "${xmleb}END_UNKNOWNREFERER") { error("History file \"$filetoread\" is corrupted (End of section UNKNOWNREFERER not found).\nRestore a recent backup of this file (data for this month will be restored to backup date), remove it (data for month will be lost), or remove the corrupted section in file (data for at least this section will be lost).","","",1); }
@@ -2773,7 +2773,7 @@
 					}
 					$_=<HISTORY>;
 					chomp $_; s/\r//;
-					@field=split(/\s+/,($readxml?CleanFromTags($_):$_)); $countlines++;
+					@field=split(/\s+/,($readxml?XMLDecodeFromHisto($_):$_)); $countlines++;
 				}
 				until ($field[0] eq 'END_UNKNOWNREFERERBROWSER' || $field[0] eq "${xmleb}END_UNKNOWNREFERERBROWSER" || ! $_);
 				if ($field[0] ne 'END_UNKNOWNREFERERBROWSER' && $field[0] ne "${xmleb}END_UNKNOWNREFERERBROWSER") { error("History file \"$filetoread\" is corrupted (End of section UNKNOWNREFERERBROWSER not found).\nRestore a recent backup of this file (data for this month will be restored to backup date), remove it (data for month will be lost), or remove the corrupted section in file (data for at least this section will be lost).","","",1); }
@@ -2801,7 +2801,7 @@
 					}
 					$_=<HISTORY>;
 					chomp $_; s/\r//;
-					@field=split(/\s+/,($readxml?CleanFromTags($_):$_)); $countlines++;
+					@field=split(/\s+/,($readxml?XMLDecodeFromHisto($_):$_)); $countlines++;
 				}
 				until ($field[0] eq 'END_SCREENSIZE' || $field[0] eq "${xmleb}END_SCREENSIZE" || ! $_);
 				if ($field[0] ne 'END_SCREENSIZE' && $field[0] ne "${xmleb}END_SCREENSIZE") { error("History file \"$filetoread\" is corrupted (End of section SCREENSIZE not found).\nRestore a recent backup of this file (data for this month will be restored to backup date), remove it (data for month will be lost), or remove the corrupted section in file (data for at least this section will be lost).","","",1); }
@@ -2832,7 +2832,7 @@
 					}
 					$_=<HISTORY>;
 					chomp $_; s/\r//;
-					@field=split(/\s+/,($readxml?CleanFromTags($_):$_)); $countlines++;
+					@field=split(/\s+/,($readxml?XMLDecodeFromHisto($_):$_)); $countlines++;
 				}
 				until ($field[0] eq 'END_ROBOT' || $field[0] eq "${xmleb}END_ROBOT" || ! $_);
 				if ($field[0] ne 'END_ROBOT' && $field[0] ne "${xmleb}END_ROBOT") { error("History file \"$filetoread\" is corrupted (End of section ROBOT not found).\nRestore a recent backup of this file (data for this month will be restored to backup date), remove it (data for month will be lost), or remove the corrupted section in file (data for at least this section will be lost).","","",1); }
@@ -2862,7 +2862,7 @@
 					}
 					$_=<HISTORY>;
 					chomp $_; s/\r//;
-					@field=split(/\s+/,($readxml?CleanFromTags($_):$_)); $countlines++;
+					@field=split(/\s+/,($readxml?XMLDecodeFromHisto($_):$_)); $countlines++;
 				}
 				until ($field[0] eq 'END_WORMS' || $field[0] eq "${xmleb}END_WORMS" || ! $_);
 				if ($field[0] ne 'END_WORMS' && $field[0] ne "${xmleb}END_WORMS") { error("History file \"$filetoread\" is corrupted (End of section WORMS not found).\nRestore a recent backup of this file (data for this month will be restored to backup date), remove it (data for month will be lost), or remove the corrupted section in file (data for at least this section will be lost).","","",1); }
@@ -2892,7 +2892,7 @@
 					}
 					$_=<HISTORY>;
 					chomp $_; s/\r//;
-					@field=split(/\s+/,($readxml?CleanFromTags($_):$_)); $countlines++;
+					@field=split(/\s+/,($readxml?XMLDecodeFromHisto($_):$_)); $countlines++;
 				}
 				until ($field[0] eq 'END_EMAILSENDER' || $field[0] eq "${xmleb}END_EMAILSENDER" || ! $_);
 				if ($field[0] ne 'END_EMAILSENDER' && $field[0] ne "${xmleb}END_EMAILSENDER") { error("History file \"$filetoread\" is corrupted (End of section EMAILSENDER not found).\nRestore a recent backup of this file (data for this month will be restored to backup date), remove it (data for month will be lost), or remove the corrupted section in file (data for at least this section will be lost).","","",1); }
@@ -2922,7 +2922,7 @@
 					}
 					$_=<HISTORY>;
 					chomp $_; s/\r//;
-					@field=split(/\s+/,($readxml?CleanFromTags($_):$_)); $countlines++;
+					@field=split(/\s+/,($readxml?XMLDecodeFromHisto($_):$_)); $countlines++;
 				}
 				until ($field[0] eq 'END_EMAILRECEIVER' || $field[0] eq "${xmleb}END_EMAILRECEIVER" || ! $_);
 				if ($field[0] ne 'END_EMAILRECEIVER' && $field[0] ne "${xmleb}END_EMAILRECEIVER") { error("History file \"$filetoread\" is corrupted (End of section EMAILRECEIVER not found).\nRestore a recent backup of this file (data for this month will be restored to backup date), remove it (data for month will be lost), or remove the corrupted section in file (data for at least this section will be lost).","","",1); }
@@ -2984,7 +2984,7 @@
 					}
 					$_=<HISTORY>;
 					chomp $_; s/\r//;
-					@field=split(/\s+/,($readxml?CleanFromTags($_):$_)); $countlines++;
+					@field=split(/\s+/,($readxml?XMLDecodeFromHisto($_):$_)); $countlines++;
 				}
 				until ($field[0] eq 'END_SIDER' || $field[0] eq "${xmleb}END_SIDER" || ! $_);
 				if ($field[0] ne 'END_SIDER' && $field[0] ne "${xmleb}END_SIDER") { error("History file \"$filetoread\" is corrupted (End of section SIDER not found).\nRestore a recent backup of this file (data for this month will be restored to backup date), remove it (data for month will be lost), or remove the corrupted section in file (data for at least this section will be lost).","","",1); }
@@ -3016,7 +3016,7 @@
 					}
 					$_=<HISTORY>;
 					chomp $_; s/\r//;
-					@field=split(/\s+/,($readxml?CleanFromTags($_):$_)); $countlines++;
+					@field=split(/\s+/,($readxml?XMLDecodeFromHisto($_):$_)); $countlines++;
 				}
 				until ($field[0] eq 'END_FILETYPES' || $field[0] eq "${xmleb}END_FILETYPES" || ! $_);
 				if ($field[0] ne 'END_FILETYPES' && $field[0] ne "${xmleb}END_FILETYPES") { error("History file \"$filetoread\" is corrupted (End of section FILETYPES not found).\nRestore a recent backup of this file (data for this month will be restored to backup date), remove it (data for month will be lost), or remove the corrupted section in file (data for at least this section will be lost).","","",1); }
@@ -3066,7 +3066,7 @@
 					}
 					$_=<HISTORY>;
 					chomp $_; s/\r//;
-					@field=split(/\s+/,($readxml?CleanFromTags($_):$_)); $countlines++;
+					@field=split(/\s+/,($readxml?XMLDecodeFromHisto($_):$_)); $countlines++;
 				}
 				until ($field[0] eq 'END_SEREFERRALS' || $field[0] eq "${xmleb}END_SEREFERRALS" || ! $_);
 				if ($field[0] ne 'END_SEREFERRALS' && $field[0] ne "${xmleb}END_SEREFERRALS") { error("History file \"$filetoread\" is corrupted (End of section SEREFERRALS not found).\nRestore a recent backup of this file (data for this month will be restored to backup date), remove it (data for month will be lost), or remove the corrupted section in file (data for at least this section will be lost).","","",1); }
@@ -3109,7 +3109,7 @@
 					}
 					$_=<HISTORY>;
 					chomp $_; s/\r//;
-					@field=split(/\s+/,($readxml?CleanFromTags($_):$_)); $countlines++;
+					@field=split(/\s+/,($readxml?XMLDecodeFromHisto($_):$_)); $countlines++;
 				}
 				until ($field[0] eq 'END_PAGEREFS' || $field[0] eq "${xmleb}END_PAGEREFS" || ! $_);
 				if ($field[0] ne 'END_PAGEREFS' && $field[0] ne "${xmleb}END_PAGEREFS") { error("History file \"$filetoread\" is corrupted (End of section PAGEREFS not found).\nRestore a recent backup of this file (data for this month will be restored to backup date), remove it (data for month will be lost), or remove the corrupted section in file (data for at least this section will be lost).","","",1); }
@@ -3173,7 +3173,7 @@
 					}
 					$_=<HISTORY>;
 					chomp $_; s/\r//;
-					@field=split(/\s+/,($readxml?CleanFromTags($_):$_)); $countlines++;
+					@field=split(/\s+/,($readxml?XMLDecodeFromHisto($_):$_)); $countlines++;
 				}
 				until ($field[0] eq 'END_SEARCHWORDS' || $field[0] eq "${xmleb}END_SEARCHWORDS" || ! $_);
 				if ($field[0] ne 'END_SEARCHWORDS' && $field[0] ne "${xmleb}END_SEARCHWORDS") { error("History file \"$filetoread\" is corrupted (End of section SEARCHWORDS not found).\nRestore a recent backup of this file (data for this month will be restored to backup date), remove it (data for month will be lost), or remove the corrupted section in file (data for at least this section will be lost).","","",1); }
@@ -3210,7 +3210,7 @@
 					}
 					$_=<HISTORY>;
 					chomp $_; s/\r//;
-					@field=split(/\s+/,($readxml?CleanFromTags($_):$_)); $countlines++;
+					@field=split(/\s+/,($readxml?XMLDecodeFromHisto($_):$_)); $countlines++;
 				}
 				until ($field[0] eq 'END_KEYWORDS' || $field[0] eq "${xmleb}END_KEYWORDS" || ! $_);
 				if ($field[0] ne 'END_KEYWORDS' && $field[0] ne "${xmleb}END_KEYWORDS") { error("History file \"$filetoread\" is corrupted (End of section KEYWORDS not found).\nRestore a recent backup of this file (data for this month will be restored to backup date), remove it (data for month will be lost), or remove the corrupted section in file (data for at least this section will be lost).","","",1); }
@@ -3239,7 +3239,7 @@
 					}
 					$_=<HISTORY>;
 					chomp $_; s/\r//;
-					@field=split(/\s+/,($readxml?CleanFromTags($_):$_)); $countlines++;
+					@field=split(/\s+/,($readxml?XMLDecodeFromHisto($_):$_)); $countlines++;
 				}
 				until ($field[0] eq 'END_ERRORS' || $field[0] eq "${xmleb}END_ERRORS" || ! $_);
 				if ($field[0] ne 'END_ERRORS' && $field[0] ne "${xmleb}END_ERRORS") { error("History file \"$filetoread\" is corrupted (End of section ERRORS not found).\nRestore a recent backup of this file (data for this month will be restored to backup date), remove it (data for month will be lost), or remove the corrupted section in file (data for at least this section will be lost).","","",1); }
@@ -3271,7 +3271,7 @@
 						}
 						$_=<HISTORY>;
 						chomp $_; s/\r//;
-						@field=split(/\s+/,($readxml?CleanFromTags($_):$_)); $countlines++;
+						@field=split(/\s+/,($readxml?XMLDecodeFromHisto($_):$_)); $countlines++;
 					}
 					until ($field[0] eq "END_SIDER_$code" || $field[0] eq "${xmleb}END_SIDER_$code" || ! $_);
 					if ($field[0] ne "END_SIDER_$code" && $field[0] ne "${xmleb}END_SIDER_$code") { error("History file \"$filetoread\" is corrupted (End of section SIDER_$code not found).\nRestore a recent backup of this file (data for this month will be restored to backup date), remove it (data for month will be lost), or remove the corrupted section in file (data for at least this section will be lost).","","",1); }
@@ -3304,7 +3304,7 @@
 						}
 						$_=<HISTORY>;
 						chomp $_; s/\r//;
-						@field=split(/\s+/,($readxml?CleanFromTags($_):$_)); $countlines++;
+						@field=split(/\s+/,($readxml?XMLDecodeFromHisto($_):$_)); $countlines++;
 					}
 					until ($field[0] eq "END_EXTRA_$extranum" || $field[0] eq "${xmleb}END_EXTRA_$extranum" || ! $_);
 					if ($field[0] ne "END_EXTRA_$extranum" && $field[0] ne "${xmleb}END_EXTRA_$extranum") { error("History file \"$filetoread\" is corrupted (End of section EXTRA_$extranum not found).\nRestore a recent backup of this file (data for this month will be restored to backup date), remove it (data for month will be lost), or remove the corrupted section in file (data for at least this section will be lost).","","",1); }
@@ -3352,7 +3352,7 @@
 					do {
 						$_=<HISTORY>;
 						chomp $_; s/\r//;
-						@field=split(/\s+/,($readxml?CleanFromTags($_):$_)); $countlines++;
+						@field=split(/\s+/,($readxml?XMLDecodeFromHisto($_):$_)); $countlines++;
 					}
 					until ($field[0] eq "END_PLUGIN_$pluginname" || $field[0] eq "${xmleb}END_PLUGIN_$pluginname" || ! $_);
    				}
@@ -3811,13 +3811,13 @@
 			$keysinkeylist{$_}=1;
 			my $newkey=$_;
 			$newkey =~ s/([^:])\/\//$1\//g;		# Because some targeted url were taped with 2 / (Ex: //rep//file.htm). We must keep http://rep/file.htm
-			print HISTORYTMP "${xmlrb}$newkey${xmlrs}".int($_url_p{$_}||0)."${xmlrs}".int($_url_k{$_}||0)."${xmlrs}".int($_url_e{$_}||0)."${xmlrs}".int($_url_x{$_}||0)."${xmlre}\n";
+			print HISTORYTMP "${xmlrb}".XMLEncodeForHisto($newkey)."${xmlrs}".int($_url_p{$_}||0)."${xmlrs}".int($_url_k{$_}||0)."${xmlrs}".int($_url_e{$_}||0)."${xmlrs}".int($_url_x{$_}||0)."${xmlre}\n";
 		}
 		foreach (keys %_url_p) {
 			if ($keysinkeylist{$_}) { next; }
 			my $newkey=$_;
 			$newkey =~ s/([^:])\/\//$1\//g;		# Because some targeted url were taped with 2 / (Ex: //rep//file.htm). We must keep http://rep/file.htm
-			print HISTORYTMP "${xmlrb}$newkey ".int($_url_p{$_}||0)."${xmlrs}".int($_url_k{$_}||0)."${xmlrs}".int($_url_e{$_}||0)."${xmlrs}".int($_url_x{$_}||0)."${xmlre}\n";
+			print HISTORYTMP "${xmlrb}".XMLEncodeForHisto($newkey)."${xmlrs}".int($_url_p{$_}||0)."${xmlrs}".int($_url_k{$_}||0)."${xmlrs}".int($_url_e{$_}||0)."${xmlrs}".int($_url_x{$_}||0)."${xmlre}\n";
 		}
 		print HISTORYTMP "${xmleb}END_SIDER${xmlee}\n";
 	}
@@ -4340,7 +4340,8 @@
 }
 
 #------------------------------------------------------------------------------
-# Function:		Transforms spaces into %20 and special chars by entities as needed in XML/XHTML
+# Function:		Transforms spaces into %20 and special chars by HTML entities as needed in XML/XHTML
+#				Decoding is done by XMLDecodeFromHisto
 # Parameters:	stringtoencode
 # Return:		encodedstring
 #------------------------------------------------------------------------------
@@ -4348,6 +4349,7 @@
 	my $string = shift;
     $string =~ s/\s/%20/g;
 	if ($BuildHistoryFormat ne 'xml') { return $string; }
+	$string =~ s/=/%3d/g;
 	$string =~ s/&/&amp;/g;
 	$string =~ s/</&lt;/g;
 	$string =~ s/>/&gt;/g;
@@ -4445,10 +4447,16 @@
 # Output:       None
 # Return:		decodedstring
 #------------------------------------------------------------------------------
-sub CleanFromTags {
+sub XMLDecodeFromHisto {
 	my $stringtoclean=shift;
 	$stringtoclean =~ s/$regclean1/ /g;	# Replace <recnb> or </td> with space
-	$stringtoclean =~ s/$regclean2//g;	# Remove <xxx>
+	$stringtoclean =~ s/$regclean2//g;	# Remove others <xxx>
+	$stringtoclean =~ s/%3d/=/g;
+	$stringtoclean =~ s/&amp;/&/g;
+	$stringtoclean =~ s/&lt;/</g;
+	$stringtoclean =~ s/&gt;/>/g;
+    $stringtoclean =~ s/&quot;/\"/g;
+    $stringtoclean =~ s/&apos;/\'/g;
 	return $stringtoclean;
 }