|
1 | 1 | <?php
|
2 | 2 | include "functions.php";
|
3 | 3 | ?><html>
|
4 |
| -<head><title>Phar extraction result</title></head> |
5 |
| -<body><font face="Comic Sans MS"> |
| 4 | +<head> |
| 5 | + <title>Phar extraction result</title> |
| 6 | + <script src="//code.jquery.com/jquery-1.11.3.min.js"></script> |
| 7 | + <script> |
| 8 | + $(document).ready(function(){ |
| 9 | + var dl = $("#dlButton"); |
| 10 | + if(typeof pmt.agree.lock !== typeof undefined){ |
| 11 | + var agreeKey = "yes"; |
| 12 | + if(typeof pmt.agree.key !== typeof undefined){ |
| 13 | + agreeKey = pmt.agree.key; |
| 14 | + }else{ |
| 15 | + agreeLock += "\nType \"yes\" if you agree with the above terms to continue"; |
| 16 | + } |
| 17 | + if(prompt(pmt.agree.lock).toLowerCase() != agreeKey.toLowerCase()){ |
| 18 | + alert("You must agree with the terms to download the zip!"); |
| 19 | + window.location.replace("/unphar.php"); |
| 20 | + return; |
| 21 | + } |
| 22 | + } |
| 23 | + dl.css("display", "block"); |
| 24 | + }); |
| 25 | + </script> |
| 26 | +</head> |
| 27 | +<body><font face="Helvetica"> |
6 | 28 | <?php
|
7 | 29 | if(!isset($_FILES["file"])){
|
8 | 30 | http_response_code(400);
|
|
42 | 64 | goto end;
|
43 | 65 | }
|
44 | 66 | unphar_toZip($file["tmp_name"], $result, substr($file["name"], 0, -5));
|
| 67 | +$pmt = []; |
45 | 68 | /** @var string|null $tmpDir */
|
46 | 69 | /** @var string|null $zipPath */
|
47 | 70 | /** @var string|null $zipRelativePath */
|
48 | 71 | /** @var string|null $basename */
|
49 | 72 | /** @var bool $error */
|
50 | 73 | extract($result);
|
| 74 | +if(!is_array($pmt)) $pmt = []; |
51 | 75 | if($error){
|
52 | 76 | goto end;
|
53 | 77 | }
|
54 | 78 | usage_inc("unphar", $timestamp);
|
| 79 | +echo "<script>var pmt = " + json_encode($pmt) + ";</script>"; |
55 | 80 | echo <<<EOS
|
56 | 81 | <h1>Success</h1>
|
57 | 82 | <p>Phar has been successfully converted to zip.<br>
|
58 |
| -Download the ZIP file <a href="$zipRelativePath">here</a>, or download with an alternative name:</p> |
| 83 | +Download the ZIP file <a id="dlButton" href="$zipRelativePath">here</a>, or download with an alternative name:</p> |
59 | 84 | <p><i><font color="#2f4f4f">The altname download is currently not available.</font></i></p>
|
60 | 85 | <!--<iframe width="500" src="/data/dlPhar.php?path=$basename"></iframe>-->
|
61 | 86 | <p>The download link is available for <i>at least</i> <b>2 hours</b>.</p>
|
|
0 commit comments