<commit_before>
function xResolveUrl(url) {
   var image = new Image();
   image.src = url;
   return image.src;
}
function xLateUrl(aCollection, sProp) {
   var i = 0;
   for(i = 0; i < aCollection.length; i++) {
      if (typeof(aCollection[i][sProp]) == "string") {
         if (aCollection[i][sProp].indexOf("mailto:") == -1 &&
            aCollection[i][sProp].indexOf("javascript:") == -1) {

            if(aCollection[i][sProp].indexOf("http") == 0) {
               aCollection[i][sProp] = sWayBackCGI + aCollection[i][sProp];
            } else {
               aCollection[i][sProp] = sWayBackCGI + xResolveUrl(aCollection[i][sProp]);
            }
         }
      }
   }
}

xLateUrl(document.getElementsByTagName("IMG"),"src");
xLateUrl(document.getElementsByTagName("A"),"href");
xLateUrl(document.getElementsByTagName("AREA"),"href");
xLateUrl(document.getElementsByTagName("OBJECT"),"codebase");
xLateUrl(document.getElementsByTagName("OBJECT"),"data");
xLateUrl(document.getElementsByTagName("APPLET"),"codebase");
xLateUrl(document.getElementsByTagName("APPLET"),"archive");
xLateUrl(document.getElementsByTagName("EMBED"),"src");
xLateUrl(document.getElementsByTagName("BODY"),"background");<commit_msg>BUGFIX: sourceforge bug # 1522832. Added javascript to verify that elements actually have a property defined, before attempting to update it. Specifically this was a problem with named anchor tags.<commit_after>
function xResolveUrl(url) {
   var image = new Image();
   image.src = url;
   return image.src;
}
function xLateUrl(aCollection, sProp) {
   var i = 0;
   for(i = 0; i < aCollection.length; i++) {

      if (aCollection[i].hasAttribute(sProp) &&
         typeof(aCollection[i][sProp]) == "string") {

         if (aCollection[i][sProp].indexOf("mailto:") == -1 &&
            aCollection[i][sProp].indexOf("javascript:") == -1) {

            if(aCollection[i][sProp].indexOf("http") == 0) {
               aCollection[i][sProp] = sWayBackCGI + aCollection[i][sProp];
            } else {
               aCollection[i][sProp] = sWayBackCGI + xResolveUrl(aCollection[i][sProp]);
            }
         }
      }
   }
}

xLateUrl(document.getElementsByTagName("IMG"),"src");
xLateUrl(document.getElementsByTagName("A"),"href");
xLateUrl(document.getElementsByTagName("AREA"),"href");
xLateUrl(document.getElementsByTagName("OBJECT"),"codebase");
xLateUrl(document.getElementsByTagName("OBJECT"),"data");
xLateUrl(document.getElementsByTagName("APPLET"),"codebase");
xLateUrl(document.getElementsByTagName("APPLET"),"archive");
xLateUrl(document.getElementsByTagName("EMBED"),"src");
xLateUrl(document.getElementsByTagName("BODY"),"background");
{'fraction_non_alphanumeric': 0.1692192753081808, 'fraction_numerical': 0.00635039223010833, 'mean_word_length': 4.498973305954825, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '868480', 'n_tokens_mistral': 910, 'n_tokens_neox': 864, 'n_words': 124}