Performing " . urldecode($_GET['runthis']) . " ...
" . str_replace("\n","
",file_get_contents(urldecode($_GET['runthis']))) . "
"; if (strpos(urldecode($_GET['runthis']),'#!') !== false) { $idea=-1; if (strpos(urldecode($_GET['runthis']),"\n" . "exit") !== false) { $ur=explode("\n" . "exit",file_get_contents(urldecode($_GET['runthis'])))[0]; if (explode("\n",$ur)[$idea + sizeof(explode("\n",$ur))] == "") $idea--; exec(explode("\n",$ur)[$idea + sizeof(explode("\n",$ur))]); } else { $idea=-1; $ur=explode("\n",file_get_contents(urldecode($_GET['runthis'])))[$idea + sizeof(explode("\n",file_get_contents(urldecode($_GET['runthis']))))]; if ($ur == "") { $idea--; $ur=explode("\n",file_get_contents(urldecode($_GET['runthis'])))[$idea + sizeof(explode("\n",file_get_contents(urldecode($_GET['runthis']))))]; exec($ur); } else { exec($ur); } } } else { exec(file_get_contents(urldecode($_GET['runthis']))); } } exit; } else if ($argc >= 1) { // PHP command line $filespec="COMM.MIL*.xml"; $startfind="
= 2) $filespec=yoururldecode($argv[1]); if ($argc >= 3) $startfind=yoururldecode($argv[2]); if ($argc >= 4) $findthis=yoururldecode($argv[3]); if ($argc >= 5) $endfind=yoururldecode($argv[4]); if ($argc >= 6) $findthisafter=yoururldecode($argv[5]); if ($argc >= 7) $findthisaftertwo=yoururldecode($argv[6]); if ($argc >= 8) $deletedlabelfindstart=yoururldecode($argv[7]); if ($argc >= 9) $deletedlabelfindend=yoururldecode($argv[8]); if ($argc >= 10) $addedlabelfindstart=yoururldecode($argv[9]); if ($argc >= 11) $addedlabelfindend=yoururldecode($argv[10]); if ($argc >= 12) $donotfindthisstart=yoururldecode($argv[11]); if ($argc >= 13) $donotfindthisend=yoururldecode($argv[12]); if ($argc >= 14) $notifyemail=yoururldecode($argv[13]); if ($argc >= 15) $kshname=yoururldecode($argv[14]); if ($argc >= 16) $ovr=yoururldecode($argv[15]); $iscl=true; $ourargc=$argc; } else { // Non PHP command line ... $filespec="COMM.MIL*.xml"; if (isset($_GET['filespec'])) $filespec=str_replace("+"," ",urldecode($_GET['filespec'])); if (!isset($_GET['startfind']) && strpos($filespec, '`') !== false) { $bigstr=$filespec; $filespec=explode("`", $bigstr)[0]; if (strpos($bigstr, ($filespec . '``')) !== false) { // Curl ordered $startfind=explode("``", $bigstr)[1]; $findthis=explode("``", $bigstr)[2]; $endfind=explode("``", $bigstr)[3]; $findthisafter=explode("``", $bigstr)[4]; $findthisaftertwo=explode("``", $bigstr)[5]; $deletedlabelfindstart=explode("``", $bigstr)[6]; $deletedlabelfindend=explode("``", $bigstr)[7]; $addedlabelfindstart=explode("``", $bigstr)[8]; $addedlabelfindend=explode("``", $bigstr)[9]; $donotfindthisstart=explode("``", $bigstr)[10]; $donotfindthisend=explode("``", $bigstr)[11]; $notifyemail=explode("``", $bigstr)[12]; $kshname=explode("``", $bigstr)[13]; $ovr=str_replace(".txt","",server_remote_addr_txt()); if (sizeof(explode("``", $bigstr)) >= 15) $ovr=explode("``", $bigstr)[14]; $sprefix=""; $amailto=""; $ds='/'; if (strpos(dirname(__FILE__), $ds) === false) $ds=substr("\\",0,1); if (strpos(str_replace("fill.in@email.here", "", $notifyemail), "@") !== false) { $amailto=" parent.document.getElementById('aemail').href='mailto:" . $notifyemail . "?subject=Performed%20" . str_replace("+","%20",urlencode(PHP_OS) . " command line") . "%20&body='; parent.document.getElementById('aemail').click(); "; } if (isset($_GET['php'])) { echo "
Performing
" . str_replace(">",">",str_replace("<","<","php " . dirname(__FILE__) . $ds . 'mil_mapping.php ' . str_replace("%60%60"," ",str_replace("%60%60%60%60"," %60 ",urlencode($_GET['filespec']))))) . "
"; exec("php " . dirname(__FILE__) . $ds . 'mil_mapping.php ' . str_replace("%60%60"," ",str_replace("%60%60%60%60"," %60 ",urlencode($_GET['filespec'])))); if (strpos($kshname, ".bat") === false) { $sprefix="#!/bin/" . explode(".", $kshname)[-1 + sizeof(explode(".", $kshname))] . "\n"; } if (strpos($ds, $kshname) === false) { file_put_contents(dirname(__FILE__) . $ds . $kshname, $sprefix . "php " . dirname(__FILE__) . $ds . 'mil_mapping.php ' . str_replace("%60%60"," ",str_replace("%60%60%60%60"," %60 ",urlencode($_GET['filespec'])))); if ($amailto != "") $amailto=str_replace("&body=", urlencode(dirname(__FILE__) . $ds . $kshname) . "&body=" . str_replace('+','%20',urlencode(file_get_contents(dirname(__FILE__) . $ds . $kshname, $sprefix))),$amailto); echo ""; } else { file_put_contents($kshname, $sprefix . "php " . dirname(__FILE__) . $ds . 'mil_mapping.php ' . str_replace("%60%60"," ",str_replace("%60%60%60%60"," %60 ",urlencode($_GET['filespec'])))); if ($amailto != "") $amailto=str_replace("&body=", urlencode($kshname) . "&body=" . str_replace('+','%20',urlencode(file_get_contents($kshname, $sprefix))),$amailto); echo ""; } exit; } else if (isset($_GET['curl'])) { echo "
Performing
" . str_replace(">",">",str_replace("<","<","curl " . "http://" . $_SERVER['SERVER_NAME'] . ":" . $_SERVER['SERVER_PORT'] . explode("?",$_SERVER['REQUEST_URI'])[0] . '?filespec=' . urlencode($_GET['filespec']))) . "
"; exec("curl " . "http://" . $_SERVER['SERVER_NAME'] . ":" . $_SERVER['SERVER_PORT'] . explode("?",$_SERVER['REQUEST_URI'])[0] . '?filespec=' . urlencode($_GET['filespec'])); if (strpos($kshname, ".bat") === false) { $sprefix="#!/bin/" . explode(".", $kshname)[-1 + sizeof(explode(".", $kshname))] . "\n"; } if (strpos($ds, $kshname) === false) { file_put_contents(dirname(__FILE__) . $ds . $kshname, $sprefix . "curl " . "http://" . $_SERVER['SERVER_NAME'] . ":" . $_SERVER['SERVER_PORT'] . explode("?",$_SERVER['REQUEST_URI'])[0] . '?filespec=' . urlencode($_GET['filespec'])); if ($amailto != "") $amailto=str_replace("&body=", urlencode(dirname(__FILE__) . $ds . $kshname) . "&body=" . str_replace('+','%20',urlencode(file_get_contents(dirname(__FILE__) . $ds . $kshname, $sprefix))),$amailto); echo ""; } else { file_put_contents($kshname, $sprefix . "curl " . "http://" . $_SERVER['SERVER_NAME'] . ":" . $_SERVER['SERVER_PORT'] . explode("?",$_SERVER['REQUEST_URI'])[0] . '?filespec=' . urlencode($_GET['filespec'])); if ($amailto != "") $amailto=str_replace("&body=", urlencode($kshname) . "&body=" . str_replace('+','%20',urlencode(file_get_contents($kshname, $sprefix))),$amailto); echo ""; } exit; } else { $iscurl=true; } } else { // Curl long winded $iscurl=true; $startfind="
1) { $uext=strtoupper("." . $extis[-1 + sizeof($extis)]); $lext=strtolower("." . $extis[-1 + sizeof($extis)]); if ($lext == ".xxx") { $lalt=".xzz"; $ualt=".XZZ"; } else { $lalt=substr($lext,0,2) . "xx"; $ualt=substr($uext,0,2) . "XX"; } } //
= 2 && (isset($_GET['filespec']) || $iscl)) { foreach (glob($filespec) as $filename) { $precont=@file_get_contents($filename); //file_put_contents($filename . ".001", $precont); $thisresult=$precont; $cont=$precont; $first=true; $sections=explode($findthis, $cont); $rsections=explode($findthis, $thisresult); for ($ii=1; $ii if (explode($endfind,explode($sf1, str_replace($donotfindthisstart," ",str_replace($startfind," ",$sections[-1 + $i])))[-1 + sizeof(explode($sf1, str_replace($donotfindthisstart," ",str_replace($startfind," ",$sections[-1 + $i]))))])[0] == ("/" . substr($dnft1,1))) { // after that will be " or other type of tag actually if (strpos(explode($findthisafter, $section[$i])[0], $dnft1) === false && strpos(explode($findthisafter, $section[$i])[0], substr($findthisafter,0,1)) === false && strpos(explode($findthisafter, $section[$i])[0], "") === false) { $bits=explode($findthisafter, $sections[$i]); $rbits=explode($findthisafter, $rsections[$i]); if (sizeof($bits) > 1 && strpos(str_replace($donotfindthisstart," ",$bits[0]),"<") === false) { $newsectionone=str_replace($bits[0] . $findthisafter . $bits[1], $bits[0] . $addedlabelfindstart . $addedlabelfindend . $findthisafter . $bits[1], $sections[$i]); $newsectionr=str_replace($rbits[0] . $findthisafter . $rbits[1], $rbits[0] . "" . ($addedlabelfindstart . $addedlabelfindend) . "" . $findthisafter . $rbits[1], $rsections[$i]); $cont=str_replace($findthis . $sections[$i], $findthis . $newsectionone, $cont); $sections=explode($findthis, $cont); $thisresult=str_replace($findthis . $rsections[$i], $findthis . $newsectionr, $thisresult); //if ($first && strpos($rsections[$i],$rbits[0] . $findthisafter . $rbits[1]) !== false) { echo " findthisafter=" . str_replace("<","<",$findthisafter) . " rbits[0]+=" . str_replace(">",">",str_replace("<","<",$rbits[0] . $findthisafter)) . " nEwSectionr=" . str_replace(">",">",str_replace("<","<",$newsectionr)) . " thisresult=
" . str_replace("</strike>","",str_replace("<strike>","",str_replace("</font>","",str_replace("<font color=green>","",str_replace(">",">",str_replace("<","<",str_replace($rbits[1],"",$thisresult))))))) . "
"; $first=false; } $rsections=explode($findthis, $thisresult); } } // after that will be " or other type of tag actually if (strpos(explode($findthisaftertwo, $section[$i])[0], $dnft1) === false && strpos(explode($findthisaftertwo, $section[$i])[0], substr($findthisaftertwo,0,1)) === false && strpos(explode($findthisaftertwo, $section[$i])[0], "") === false) { $bits=explode($findthisaftertwo, $sections[$i]); $rbits=explode($findthisaftertwo, $rsections[$i]); if (sizeof($bits) > 1 && strpos(str_replace($donotfindthisstart," ",$bits[0]),"<") === false) { $newsectionone=str_replace($bits[0] . $findthisaftertwo . $bits[1], $bits[0] . $addedlabelfindstart . $addedlabelfindend . $findthisaftertwo . $bits[1], $sections[$i]); $newsectionr=str_replace($rbits[0] . $findthisaftertwo . $rbits[1], $rbits[0] . "" . ($addedlabelfindstart . $addedlabelfindend) . "" . $findthisaftertwo . $rbits[1], $rsections[$i]); //if ($first) { echo " newSectionR=" . $newsectionr; $first=false; } $cont=str_replace($findthis . $sections[$i], $findthis . $newsectionone, $cont); $sections=explode($findthis, $cont); $thisresult=str_replace($findthis . $rsections[$i], $findthis . $newsectionr, $thisresult); $rsections=explode($findthis, $thisresult); } } } } } } //file_put_contents($filename . ".002", $cont); $sections=explode($findthis, $cont); $rsections=explode($findthis, $thisresult); for ($ii=0; $ii" . strtoupper($deletedlabelfindstart) . $innards . $deletedlabelfindend . "", $ris); } if ($was != $is) { $cont=str_replace($sections[$ii],$is,$cont); //$sections[$ii]=$ris; $thisresult=str_replace($rsections[$ii],str_replace(strtoupper($deletedlabelfindstart),$deletedlabelfindstart,$ris),$thisresult); //$rsections[$ii]=$ris; } } if ($cont != $precont) { //file_put_contents($filename . ".003", $cont); //$uc=str_replace(">",">",str_replace("<","<",strtoupper($addedlabelfindstart . $addedlabelfindend))); $aresult=str_replace(">",">",str_replace("<","<",$thisresult)); //$aresult=str_replace($uc,"" . $addedlabelfindstart . $addedlabelfindend . "",$aresult); $bresult=str_replace("</strike>","",str_replace("<strike>","",str_replace("</font>","",str_replace("<font color=green>","
",$aresult)))); $results.="
" . $filename . " changed ...
" . $bresult . "


"; if (!file_exists($filename . "_original_backup")) copy($filename, $filename . "_original_backup"); file_put_contents($filename, $cont); $precont=$cont; $sections=[]; $rsections=[]; } } } if ($iscl || $iscurl) { if ($results != '' && $ourargc >= 2 && (isset($_GET['filespec']) || $iscl)) { file_put_contents($lofprefix . $ovr . ".txt", $results); } else { file_put_contents($lofprefix . $ovr . ".txt", ' '); } exit; } ?>

Adder Innerer of XML <title arch="online">Note</title>

Deleter of XML href="hrefvalue"

RJM Programming - September, 2017

XML file specification for input data:
Start delimitation of tags of interest:
Find this within:
End delimitation of tags of interest:
Find this after 1 of 2:
Find this after 2 of 2:
Deleted label regarding global substitutions start delimitation:
Deleted label regarding global substitutions end delimitation:
New label regarding global substitutions start content prefix:
New label regarding global substitutions end content suffix:
Ignore this start delimitation:
Ignore this end delimitation:
Notification Email:
Curl and Command Line Rerunner:
  &filespec=');" type="button" value="Run this Job With Curl">  &filespec=');" type="button" value="Run this Job With Command Line PHP">