mirror of
https://github.com/demostf/backup.git
synced 2026-06-03 14:04:10 +02:00
encode url for download
This commit is contained in:
parent
d94e7d672b
commit
b0ac0adb30
1 changed files with 5 additions and 2 deletions
|
|
@ -17,7 +17,10 @@ class Backup {
|
|||
}
|
||||
|
||||
private function backupDemo(string $name, string $url, string $hash): bool {
|
||||
$handle = fopen($url, 'r');
|
||||
$encodedUrl = rawurlencode($url);
|
||||
$encodedUrl = str_replace('%2F', '/', $encodedUrl);
|
||||
$encodedUrl = str_replace('%3A//', '://', $encodedUrl);
|
||||
$handle = fopen($encodedUrl, 'r');
|
||||
$storedHash = $this->store->store($name, $handle);
|
||||
return $hash === '' || $hash === $storedHash;
|
||||
}
|
||||
|
|
@ -47,4 +50,4 @@ class Backup {
|
|||
}
|
||||
return $currentPage;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue