Remove white-spaces, tabs and new-lines from screenshot urls before fetching in sync (#3)
* Remove white-spaces, tabs and new-lines from screenshot urls before fetching in sync * Use trim instead of preg_replace to remove leading and trailing white spaces, tabs and new lines in screenshot urls * Use trimmed url only to get data (not for base64 cache id)
This commit is contained in:
Родитель
d3cf4ad6a0
Коммит
f0b77f0daa
5
sync.php
5
sync.php
|
@ -46,8 +46,9 @@ foreach($supportedVersions as $version) {
|
|||
foreach($app['screenshots'] as $screenshot) {
|
||||
$url = $screenshot['url'];
|
||||
if(!file_exists(__DIR__ . '/cache/' . base64_encode($url))) {
|
||||
if (substr($url, 0, 8) === 'https://') {
|
||||
$data = file_get_contents($url);
|
||||
$trimmedUrl = trim($url);
|
||||
if (substr($trimmedUrl, 0, 8) === 'https://') {
|
||||
$data = file_get_contents($trimmedUrl);
|
||||
file_put_contents(__DIR__ . '/cache/' . base64_encode($url), $data);
|
||||
echo(
|
||||
sprintf(
|
||||
|
|
Загрузка…
Ссылка в новой задаче