We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 2fe1694 + c1d8e82 commit 86b7ebbCopy full SHA for 86b7ebb
assets/modules/store/update.php
@@ -1,7 +1,13 @@
1
<?php
2
3
+error_reporting(0);
4
$url = "http://modx-store.com/get.php?get=file&cid=1";
5
$newfname = 'update.zip';
6
+
7
+if(!preg_match('/200/', get_headers($url)[0])){
8
+ die('Server not response!');
9
+}
10
11
if (ini_get('allow_url_fopen') == true) {
12
$file = fopen ($url, "rb");
13
if (! $file) {
@@ -28,13 +34,13 @@
28
34
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
29
35
}
30
36
$content = curl_exec ($ch);
31
- file_put_contents($newfname,$content);
32
-}
33
-
37
+ file_put_contents($newfname,$content);
38
39
40
$zip = new ZipArchive;
41
$res = $zip->open(dirname(__FILE__).'/update.zip');
42
$zip->extractTo( dirname(__FILE__) );
43
$zip->close();
44
echo dirname(__FILE__).'/update.zip';
45
unlink('update.zip');
-?>
46
+?>
0 commit comments