diff --git a/inc/admin.php b/inc/admin.php index 78ab1a2..73f968a 100644 --- a/inc/admin.php +++ b/inc/admin.php @@ -82,7 +82,9 @@ function manualGen($hash, $log) { $line = explode(' --- ', $line); $hash = sha1($GLOBALS['config']['salt'].rawurldecode($line[1])); file_put_contents('cache/tmp/manual.txt', $line[1]); - exec('bin/thumb_server.sh manual '.escapeshellarg($hash).' '.escapeshellarg($line[3]).' '.escapeshellarg($line[4]).' 0 1', $result); + chdir('bin/'); + exec('bash thumb_server.sh manual '.escapeshellarg($hash).' '.escapeshellarg($line[3]).' '.escapeshellarg($line[4]).' 0 1', $result); + chdir('../'); if ((int)$result[0] === 1) { $res['success'] = 1; $res['filePath'] = pathForFile($line[4], $hash).'.png'; @@ -108,10 +110,13 @@ function tryRootDomain($hash, $log) { $parts = parse_url($line[1]); $url = $parts['scheme'].'://'.trim($parts['host']); file_put_contents('cache/tmp/manual.txt', $url); - exec('bin/thumb_server.sh manual '.escapeshellarg($hash).' '.escapeshellarg($line[3]).' '.escapeshellarg($line[4]).' 0 1', $result); + chdir('bin/'); + exec('bash thumb_server.sh manual '.escapeshellarg($hash).' '.escapeshellarg($line[3]).' '.escapeshellarg($line[4]).' 0 1', $result); + chdir('../'); if ((int)$result[0] === 1) { $res['success'] = 1; $res['filePath'] = pathForFile($line[4], $hash).'.png'; + $res['base64'] = 'data:image/png;base64,'.base64_encode(file_get_contents($res['filePath'])); return $res; } } @@ -155,7 +160,7 @@ echo '