<?php
$htmlis=file_get_contents("./merge_photos.htm");
if (strpos($htmlis, "if (document.URL.substring(1).toLowerCase().indexOf('http') != -1) {") !== false) {
  $parts=explode("if (document.URL.substring(1).toLowerCase().indexOf('http') != -1) {", $htmlis);
  echo $parts[0] . "if (document.URL.substring(1).toLowerCase().indexOf('http') != -1) { \n";
  foreach( $_GET as $name=>$val ) {
   if (strpos($val, ".") !== false && strpos(strtolower($val), "http") !== false && strpos(strtolower($val), "rjmprogramming.com.au") === false) {
     $url=str_replace(" ","+",str_replace("Https:","http:",str_replace("HTTPS:","http:",str_replace("https:","http:",str_replace("+"," ",urldecode($val))))));
     try {
     $thiscont=file_get_contents($url);
     } catch (Exception $ew) {
     $thiscont="";
     }
     if ($thiscont != "") { 
     echo "\n phpcontname.push('" . str_replace(" ","+",urldecode($val)) . "'); \n";
     echo "\n phpname.push('" . $name . "'); \n";
     echo "\n phpcont.push('data:image/" . str_replace('jpg','jpeg',strtolower(explode('.',$url)[-1 + sizeof(explode('.',$url))])) . ';base64,' . base64_encode($thiscont) . "'); \n";
     }
   }
  }
  echo str_replace("location.href=document.URL","// location.href=document.URL",$parts[1]);
} else {
  echo $htmlis;
}
exit;
?>
