2) { $outp=shell_exec('ksh ' . rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . 'agtoslides.ksh ' . $infl . ' ' . str_replace('+',' ',urldecode($argv[2]))) . ' ' . $infill; } else { $outp=shell_exec('ksh ' . rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . 'agtoslides.ksh ' . $infl . ' 1' . ' ' . $infill); } } else { if (isset($_GET['agname'])) { if (isset($_GET['random'])) { $infill=trim(str_replace('+',' ',urldecode($_GET['random']))); } $infl=str_replace(' ','+',urldecode($_GET['agname'])); if (strpos($infl, 'data:image/') !== false) { $infl=str_replace(' ','+',urldecode($_GET['agname'])); file_put_contents('/tmp/agtoslides/xx' . $infill . '_xx.' . str_replace('jpeg','jpg',explode(';',explode('/', $infl )[1])[0]), base64_decode(explode(';base64,', $infl )[1] )); $infl='/tmp/agtoslides/xx' . $infill . '_xx.' . str_replace('jpeg','jpg',explode(';',explode('/', $infl )[1])[0]); } else if (strpos($infl, $_SERVER['SERVER_NAME']) === false && strpos($infl, 'http') !== false) { $infl=str_replace(' ','+',urldecode($_GET['agname'])); file_put_contents('/tmp/agtoslides/xx' . $infill . '_xx.' . str_replace('jpeg','jpg',explode(';',explode('/', $infl )[1])[0]), file_get_contents(str_replace('https:','http:',$infl)) ); $infl='/tmp/agtoslides/xx' . $infill . '_xx.' . str_replace('jpeg','jpg',explode(';',explode('/', $infl )[1])[0]); } if ((!file_exists($infl) || strpos($infl, DIRECTORY_SEPARATOR) === false) && strpos($infl, 'data:image/') === false) { $infl=rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . $infl; } if (isset($_GET['slidenumber'])) { //echo 'ksh ' . rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . 'agtoslides.ksh ' . $infl . ' ' . str_replace('+',' ',urldecode($_GET['slidenumber'])); //exit; $outp=shell_exec('ksh ' . rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . 'agtoslides.ksh ' . $infl . ' ' . str_replace('+',' ',urldecode($_GET['slidenumber'])) . ' ' . $infill . ' 2> ' . rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . 'agtoslides.err'); //echo ' --- ' . $outp; //exit; } else { $outp=shell_exec('ksh ' . rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . 'agtoslides.ksh ' . $infl . ' 1' . ' ' . $infill); } } else if (isset($_POST['agname'])) { if (isset($_POST['random'])) { $infill=trim(str_replace('+',' ',urldecode($_POST['random']))); } $infl=str_replace(' ','+',urldecode($_POST['agname'])); if (strpos($infl, 'data:image/') !== false) { $infl=str_replace(' ','+',urldecode($_POST['agname'])); file_put_contents('/tmp/agtoslides/xx' . $infill . '_xx.' . str_replace('jpeg','jpg',explode(';',explode('/', $infl )[1])[0]), base64_decode(explode(';base64,', $infl )[1] )); $infl='/tmp/agtoslides/xx' . $infill . '_xx.' . str_replace('jpeg','jpg',explode(';',explode('/', $infl )[1])[0]); //if (strlen($infl) != 0) { //file_put_contents('x.xx', $infl . ' ' . shell_exec('ls -l /tmp/agtoslides/*.*')); //} } else if (strpos($infl, $_SERVER['SERVER_NAME']) === false && strpos($infl, 'http') !== false) { $infl=str_replace(' ','+',urldecode($_POST['agname'])); file_put_contents('/tmp/agtoslides/xx' . $infill . '_xx.' . str_replace('jpeg','jpg',explode(';',explode('/', $infl )[1])[0]), file_get_contents(str_replace('https:','http:',$infl)) ); $infl='/tmp/agtoslides/xx' . $infill . '_xx.' . str_replace('jpeg','jpg',explode(';',explode('/', $infl )[1])[0]); //if (strlen($infl) != 0) { //file_put_contents('x.xxxx', $infl . ' ' . shell_exec('ls -l /tmp/agtoslides/*.*')); //} // } else { //file_put_contents('x.xxxxx', $infl . ' ' . shell_exec('ls -l /tmp/agtoslides/*.*')); } if ((!file_exists($infl) || strpos($infl, DIRECTORY_SEPARATOR) === false) && strpos($infl, 'data:image/') === false) { $infl=rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . $infl; //if (strlen($infl) != 0) { //file_put_contents('x.xxx', $infl . ' ' . shell_exec('ls -l /tmp/agtoslides/*.*')); //} } if (isset($_POST['slidenumber'])) { $outp=shell_exec('ksh ' . rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . 'agtoslides.ksh ' . $infl . ' ' . str_replace('+',' ',urldecode($_POST['slidenumber'])) . ' ' . $infill); } else { $outp=shell_exec('ksh ' . rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . 'agtoslides.ksh ' . $infl . ' 1' . ' ' . $infill); } } else { $fp = fopen("php://input", "r"); $post = "" . file_get_contents("php://input"); fclose($fp); if (strpos($post, "agname=") !== false && strpos($post, "random=") !== false && strpos($post, "slidenumber=") !== false) { $infill=explode('&', explode('random=', $post)[1])[0]; $sn=explode('&', explode('slidenumber=', $post)[1])[0]; $infl=str_replace(' ','+',urldecode(explode('&', explode('agname=', $post)[1])[0])); if (strpos($infl, 'data:image/') !== false) { file_put_contents('/tmp/agtoslides/xx' . $infill . '_xx.' . str_replace('jpeg','jpg',explode(';',explode('/', $infl )[1])[0]), base64_decode(explode(';base64,', $infl )[1] )); $infl='/tmp/agtoslides/xx' . $infill . '_xx.' . str_replace('jpeg','jpg',explode(';',explode('/', $infl )[1])[0]); } //file_put_contents('x.xxx', $infl . ' ' . shell_exec('ls -l /tmp/agtoslides/*.*')); $outp=shell_exec('ksh ' . rtrim(dirname(__FILE__), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . 'agtoslides.ksh ' . $infl . ' ' . $sn . ' ' . $infill); } } } } } echo $outp; exit; ?>